⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmdrjc.frm

📁 用VB开发的车辆数据库管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            DataField       =   "运营次数"
            Caption         =   "运营次数"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "维修费用"
            Caption         =   "维修费用"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "违章次数"
            Caption         =   "违章次数"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column06 
            DataField       =   "事故次数"
            Caption         =   "事故次数"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column07 
            DataField       =   "日期"
            Caption         =   "日期"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column08 
            DataField       =   "每月得分"
            Caption         =   "每月得分"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column09 
            DataField       =   "每月奖金"
            Caption         =   "每月奖金"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               ColumnWidth     =   884.976
            EndProperty
            BeginProperty Column01 
               ColumnWidth     =   659.906
            EndProperty
            BeginProperty Column02 
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column03 
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column04 
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column05 
               ColumnWidth     =   794.835
            EndProperty
            BeginProperty Column06 
               ColumnWidth     =   824.882
            EndProperty
            BeginProperty Column07 
               ColumnWidth     =   794.835
            EndProperty
            BeginProperty Column08 
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column09 
               ColumnWidth     =   840.189
            EndProperty
         EndProperty
      End
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00E0E0E0&
      Height          =   270
      Left            =   1335
      TabIndex        =   0
      Top             =   120
      Width           =   1350
   End
   Begin VB.Image Imgsave 
      Height          =   330
      Left            =   6675
      Picture         =   "frmDrJC.frx":1C7A
      Stretch         =   -1  'True
      Top             =   810
      Width           =   900
   End
   Begin VB.Image Imgprint 
      Height          =   330
      Left            =   6675
      Picture         =   "frmDrJC.frx":5A47
      Stretch         =   -1  'True
      Top             =   420
      Width           =   900
   End
   Begin VB.Label Label10 
      Caption         =   "本月奖金:"
      Height          =   225
      Left            =   4440
      TabIndex        =   20
      Top             =   810
      Width           =   945
   End
   Begin VB.Label Label9 
      Caption         =   "驾驶员姓名:"
      Height          =   210
      Left            =   120
      TabIndex        =   18
      Top             =   480
      Width           =   1230
   End
   Begin VB.Label Label8 
      Caption         =   "日期:"
      Height          =   165
      Left            =   120
      TabIndex        =   16
      Top             =   810
      Width           =   765
   End
   Begin VB.Label Label7 
      Caption         =   "司机驾驶车号:"
      Height          =   210
      Left            =   120
      TabIndex        =   7
      Top             =   165
      Width           =   1425
   End
   Begin VB.Label Label6 
      Caption         =   "运营次数:"
      Height          =   225
      Left            =   2775
      TabIndex        =   6
      Top             =   465
      Width           =   945
   End
   Begin VB.Label Label5 
      Caption         =   "违章次数:"
      Height          =   225
      Left            =   4440
      TabIndex        =   5
      Top             =   480
      Width           =   945
   End
   Begin VB.Label Label4 
      Caption         =   "事故次数:"
      Height          =   225
      Left            =   4440
      TabIndex        =   4
      Top             =   150
      Width           =   945
   End
   Begin VB.Label Label3 
      Caption         =   "本月得分:"
      Height          =   225
      Left            =   2775
      TabIndex        =   3
      Top             =   810
      Width           =   945
   End
   Begin VB.Label Label2 
      Caption         =   "维修费用:"
      Height          =   225
      Left            =   6030
      TabIndex        =   2
      Top             =   165
      Width           =   945
   End
   Begin VB.Label Label1 
      Caption         =   "运营收入:"
      Height          =   225
      Left            =   2775
      TabIndex        =   1
      Top             =   165
      Width           =   945
   End
End
Attribute VB_Name = "frmDrJC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:frmDrJC
'**版权说明:吉林省明日科技有限公司享有本软件的所有版权,如果本软件用于商
'**          业用途,必须经过吉林省明日科技有限公司授权。如果提供网上免费
'**          下载,必须经过吉林省明日科技有限公司授权,并保证程序的完整,
'**          不得修改代码、注释和相关内容,否则,我公司将追究其法律责任
'**网    址:www.mingrisoft.com  价值无限,服务无限
'**电    话:(0431)84978981,84978982
'**创 建 人:明日科技
'**日    期:2007-10-31
'**修 改 人:mraj
'**日    期:2007-10-31
'**描    述:
'*************************************************************************


Private Sub Form_Load()
  frmDrJC.Width = 7845: frmDrJC.Height = 3840  '设置窗体大小
  '清空文本框内容
  Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = ""
  Text5.Text = "": Text6.Text = "": Text7.Text = "": Text8.Text = ""
  TName.Text = "": Text9.Text = ""
  '自动识别路径
  AdoJF.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
  AdoJF.RecordSource = "select * from 奖罚表"
  AdoJF.Refresh
  Set DataGrid1.DataSource = AdoJF
  
  AdoSG.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
  AdoSG.RecordSource = "select * from 车辆事故表"
  AdoSG.Refresh
  
  AdoWX.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
  AdoWX.RecordSource = "select * from 车辆维修表"
  AdoWX.Refresh
  
  AdoWZ.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
  AdoWZ.RecordSource = "select * from 车辆违章表"
  AdoWZ.Refresh
  
  AdoYY.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clgl.mdb;Persist Security Info=False"
  AdoYY.RecordSource = "select * from 车辆运营表"
  AdoYY.Refresh

  Text10.Text = Format(Date, "YYYY - MM - DD")
 
 End Sub

Private Sub Imgprint_Click()
  DataReport1.Show
End Sub
Private Sub Imgsave_Click()  '保存
    If Text1.Text = "" Then
       MsgBox "车牌号码,不能为空!", , "车辆管理系统"
       Text1.SetFocus
       Exit Sub
    End If
    Dim strdate As String
    Dim strNo As String
    strdate = Mid(Date, 1, 7)

    AdoJF.RecordSource = "select * from 奖罚表 where 车牌号码='" + Text1.Text + "'"
    AdoJF.Refresh
    For i = 0 To AdoJF.Recordset.RecordCount - 1
        On Error Resume Next
        strNo = Mid(AdoJF.Recordset.Fields(7), 1, 7)
        AdoJF.Recordset.MoveNext
        strNo = Mid(AdoJF.Recordset.Fields(7), 1, 7)
        If strdate = strNo Then
           MsgBox "车牌号码为:" + Text1.Text + "本月已经统计过运营情况了", , "车辆管理系统"
           Text1.Text = ""
           Text1.SetFocus
           Exit Sub
        End If
    Next i
  On Error Resume Next
  AdoJF.Recordset.AddNew   '添加一条新记录
  AdoJF.Recordset.Fields("车牌号码") = Text1.Text
  AdoJF.Recordset.Fields("姓名") = TName.Text
  AdoJF.Recordset.Fields("运营收入") = Text2.Text
  AdoJF.Recordset.Fields("运营次数") = Text4.Text
  AdoJF.Recordset.Fields("维修费用") = Text3.Text
  AdoJF.Recordset.Fields("违章次数") = Text6.Text
  AdoJF.Recordset.Fields("事故次数") = Text5.Text
  AdoJF.Recordset.Fields("日期") = Text8.Text
  AdoJF.Recordset.Fields("每月得分") = Text7.Text
  AdoJF.Recordset.Fields("每月奖金") = Text9.Text
  AdoJF.Recordset.Update  '更新数据表
  '清空文本框
  Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = ""
  Text5.Text = "": Text6.Text = "": Text7.Text = "": Text8.Text = ""
  TName.Text = "": Text9.Text = ""
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     DataGrid1.SetFocus
     Text3.Text = ""
  End If
End Sub
Private Sub Text1_LostFocus()
   Dim rss1 As New ADODB.Recordset
     Call main1
     Set rss1 = adoCon.Execute("select * from 车辆异动表 where 车牌号码='" & Text1.Text & "'")
     If rss1.EOF Then
     Else
        MsgBox "该车为异动车辆!", , "车辆管理系统"
        Text1.Text = ""
        Text1.SetFocus
        Exit Sub
     End If
    rss1.Close
    Dim rss2 As New ADODB.Recordset
     Set rss2 = adoCon.Execute("select * from 车辆报废表 where 车牌号码='" & Text1.Text & "'")
     If rss2.EOF Then
     Else
        MsgBox "该车已经报废!", , "车辆管理系统"
        Text1.Text = ""
        Text1.SetFocus
        Exit Sub
     End If
    rss2.Close
    adoCon.Close
  If Text1.Text = "" Then Exit Sub
  Text8.Text = Format(Date, "yyyy-mm-dd")
  On Error Resume Next
  AdoYY.RecordSource = "select * from 车辆运营表 where 车牌号码='" & Text1.Text & "'"
  AdoYY.Refresh
  If AdoYY.Recordset.RecordCount > 0 Then
    Else
     MsgBox "此车没有参加运营!", , "车辆管理系统"
     '清空文本框
     Text1.Text = "": Text2.Text = "": Text3.Text = "": Text4.Text = ""
     Text5.Text = "": Text6.Text = "": Text7.Text = "": Text8.Text = ""
     TName.Text = "": Text9.Text = ""
     Exit Sub
     AdoYY.Recordset.Close   '关闭数据对象
  End If
  a = Trim(Left(Text10.Text, 5)) + "-" + Right(Left(Text10.Text, 9), 2)
  Dim myrs As New ADODB.Recordset
  myrs.Open "select 驾驶员编号 from 车辆档案 where 车牌号码 ='" + Text1.Text + "'", cnn, adOpenKeyset, adLockOptimistic
  If myrs.RecordCount > 0 Then
    Dim myrs1 As New ADODB.Recordset
    myrs1.Open "select  姓名 from 驾驶员档案  where 驾驶员编号 ='" + myrs.Fields(0) + "'", cnn, adOpenKeyset, adLockOptimistic
    If myrs1.RecordCount > 0 Then
      TName.Text = myrs1.Fields(0)
    End If
  End If
  
  AdoYY.RecordSource = "select sum(运营收入) as 收入,count(运营收入) as 次数 from 车辆运营表 where 车牌号码='" & Text1.Text & "'and 运营日期 like '%" + a + "%'"
  AdoYY.Refresh
  Text2.Text = AdoYY.Recordset.Fields(0).Value
  Text4.Text = AdoYY.Recordset.Fields(1).Value
  AdoWX.RecordSource = "select sum(共计费用) as 费用 from 车辆维修表 where 车牌号码='" & Text1.Text & "' and 维修日期 like '%" + a + "%'"
  AdoWX.Refresh
  If AdoWX.Recordset.RecordCount > 0 Then
      Text3.Text = AdoWX.Recordset.Fields(0)
  Else
     Text3.Text = 0
  End If
  AdoSG.RecordSource = "select count(车牌号码) as 事故次数 from 车辆事故表 where 车牌号码='" & Text1.Text & "'and 事故时间 like '" + a + "%'"
  AdoSG.Refresh
  Text5.Text = AdoSG.Recordset.Fields(0)
  AdoWZ.RecordSource = "select count(车牌号码) as 违章次数 from 车辆违章表 where 车牌号码='" & Text1.Text & "'and 违章时间 like '" + a + "%'"
  AdoWZ.Refresh
  Text6.Text = AdoWZ.Recordset.Fields(0)
  If Val(tex4.Text) > 30 Then
     Text7.Text = 10 - (Text5.Text * 10 + Text6.Text * 2 + (30 - Text4.Text) * 0.3)
  Else  '>=30次
     Text7.Text = 10 - (Text5.Text * 10 + Text6.Text * 2)
  End If
  If Val(Text7.Text) > 0 Then
      Text9.Text = ((Val(Text2.Text) * 0.2 - Val(Text3.Text) * 0.4) * Val(Text7.Text) * 0.1)
  Else
     Text9.Text = 0
  End If
End Sub




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -