📄 mdiform1.frm
字号:
Private Sub mnucarbf_Click() '车辆报废
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆报废") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarBFlr.Show '显示车辆报废录入窗体
StatusBar1.Panels(1).Text = "车辆报废录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarbfcha_Click() '车辆报废查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆报废查询") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarBFcha.Show '显示车辆报废查询窗体
StatusBar1.Panels(1).Text = "车辆报废查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucardaadd_Click() '车辆档案录入
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆档案录入") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarDAlr.Show '显示车辆档案录入窗体
StatusBar1.Panels(1).Text = "车辆档案录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucardacha_Click() '车辆档案查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆档案查询") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
StatusBar1.Panels(1).Text = "车辆档案查询窗体"
Load frmcarDAcha '显示车辆档案查询窗体
End If
End If
rs1.Close
End Sub
Private Sub mnucarsgcha_Click() '车辆事故查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("事故管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarSGcha.Show '显示车辆事故查询窗体
StatusBar1.Panels(1).Text = "车辆事故查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarsglist_Click() '车辆事故列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("事故管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarSGlr.Show '显示车辆事故录入窗体
StatusBar1.Panels(1).Text = "车辆事故录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarwxcha_Click() '车辆维修查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("维修管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarWXcha.Show '显示车辆修改查询窗体
StatusBar1.Panels(1).Text = "车辆维修查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarwxlist_Click() '车辆维修列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("维修管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarWXlr.Show '显示车辆维修录入窗体
StatusBar1.Panels(1).Text = "车辆维修录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarwzcha_Click() '车辆违章查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("违章管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarWZcha.Show '显示车辆违章查询窗体
StatusBar1.Panels(1).Text = "车辆违章查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarwzlist_Click() '车辆违章列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("违章管理") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarWZlr.Show '显示车辆违章录入窗体
StatusBar1.Panels(1).Text = "车辆违章录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucaryd_Click() '车辆异动列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆异动列表") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarydlr.Show '显示车辆移动录入窗体
StatusBar1.Panels(1).Text = "车辆异动录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucarydcha_Click() '车辆异动查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆异动查询") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarYDcha.Show '显示车辆移动查询窗体
StatusBar1.Panels(1).Text = "车辆异动查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnucaryycha_Click() '车辆运营查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆运营查询") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarYYcha.Show '显示车辆运营查询窗体
StatusBar1.Panels(1).Text = "车辆运营查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnuexit1_Click()
Unload Me
End Sub
Private Sub mnuexit3_Click()
a = MsgBox("确定退出本系统?", 4, "车辆管理系统")
If a = vbYes Then
Unload Me
End If
End Sub
Private Sub mnuglyset_Click() '管理员设置
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("管理员设置") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmManager.Show '显示管理员设置窗体
StatusBar1.Panels(1).Text = "管理员设置窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnuhf_Click() '数据恢复
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("数据恢复") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmDataHF.Show '显示数据恢复窗体
StatusBar1.Panels(1).Text = "数据恢复窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnujsycha_Click() '驾驶员档案查询
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("驾驶员档案查询") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmDrivercha.Show '显示驾驶员档案查询窗体
StatusBar1.Panels(1).Text = "驾驶员档案查询窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnujsyjc_Click() '驾驶员奖惩
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("驾驶员奖罚") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmDrJC.Show '显示奖金评定窗体
StatusBar1.Panels(1).Text = "奖金评定窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnujsylist_Click() '驾驶员档案列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("驾驶员档案列表") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmDriverlr.Show '显示驾驶员档案录入窗体
StatusBar1.Panels(1).Text = "驾驶员档案录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub mnusyscsh_Click() '系统初始化
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("系统初始化") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
If MsgBox("执行此命令会清空数据库里所有记录,确实要执行吗?", vbOKCancel, "车辆管理系统") = vbOK Then
cnn.Execute ("delete from 车辆档案")
cnn.Execute ("delete from 车辆报废表")
cnn.Execute ("delete from 车辆事故表")
cnn.Execute ("delete from 车辆违章表")
cnn.Execute ("delete from 车辆维修表")
cnn.Execute ("delete from 车辆异动表")
cnn.Execute ("delete from 车辆运营表")
cnn.Execute ("delete from 驾驶员档案")
cnn.Execute ("delete from 零件表")
cnn.Execute ("delete from 奖罚表")
MsgBox "初始化完成!", , "车辆管理系统"
Else
rs1.Close
Exit Sub
End If
End If
End If
rs1.Close
End Sub
Private Sub mnuyydelete_Click() '清空运营表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("清空运营表") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
If MsgBox("真的要清空运营表吗?", vbOKCancel, "车辆管理系统") = vbOK Then
cnn.Execute ("delete from 车辆运营表") '清空车辆运营表
Else
rs1.Close
Exit Sub
End If
End If
End If
rs1.Close
End Sub
Private Sub mnuyylist_Click() '车辆运营列表
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("车辆运营列表") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarYYlr.Show '显示车辆运营录入窗体
StatusBar1.Panels(1).Text = "车辆运营录入窗体"
End If
End If
rs1.Close
End Sub
Private Sub qxsz_Click() '权限设置
rs1.Open "select * from 权限表 where 用户名='" & op & "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
If rs1.Fields("权限设置") = False Then
MsgBox "对不起,您没有使用此项功能的权限!", vbInformation, "车辆管理系统"
Else
frmcarqx.Show '显示管理员设置窗体
StatusBar1.Panels(1).Text = "管理员设置窗体"
End If
End If
rs1.Close
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
Call mnucardaadd_Click '调用车辆档案录入窗体
Case 2
Call mnujsylist_Click '调用驾驶员档案列表窗体
Case 3
Call mnuyylist_Click '调用车辆运营列表窗体
Case 5
Call mnucarwxlist_Click '调用车辆维修列表窗体
Case 6
Call mnucarwzlist_Click '调用车辆违章列表窗体
Case 7
Call mnucarsglist_Click '调用车辆事故列表窗体
End Select
End Sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Select Case ButtonMenu.Index
Case 1
Call mnucardacha_Click '调用车辆档案查询窗体
Case 2
Call mnujsycha_Click '调用驾驶员档案查询窗体
Case 3
Call mnucaryycha_Click '调用车辆运营查询窗体
Case 5
Call mnucarwxcha_Click '调用车辆维修查询窗体
Case 6
Call mnucarwzcha_Click '调用车辆违章查询窗体
Case 7
Call mnucarsgcha_Click '调用车辆事故查询窗体
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -