frmMain.frm
上传用户:lizhip88
上传日期:2007-06-21
资源大小:42k
文件大小:13k
源码类别:

交通/航空行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.MDIForm frmMain 
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "运输管理信息系统"
  6.    ClientHeight    =   5112
  7.    ClientLeft      =   132
  8.    ClientTop       =   732
  9.    ClientWidth     =   7740
  10.    LinkTopic       =   "MDIForm1"
  11.    StartUpPosition =   3  'Windows Default
  12.    WindowState     =   2  'Maximized
  13.    Begin MSComctlLib.StatusBar sbStatusBar 
  14.       Align           =   2  'Align Bottom
  15.       Height          =   264
  16.       Left            =   0
  17.       TabIndex        =   0
  18.       Top             =   4848
  19.       Width           =   7740
  20.       _ExtentX        =   13653
  21.       _ExtentY        =   466
  22.       _Version        =   393216
  23.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  24.          NumPanels       =   3
  25.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  26.             AutoSize        =   1
  27.             Object.Width           =   8043
  28.             Text            =   "Status"
  29.             TextSave        =   "Status"
  30.          EndProperty
  31.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  32.             Style           =   6
  33.             AutoSize        =   2
  34.             TextSave        =   "2001-11-3"
  35.          EndProperty
  36.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  37.             Style           =   5
  38.             AutoSize        =   2
  39.             TextSave        =   "20:20"
  40.          EndProperty
  41.       EndProperty
  42.    End
  43.    Begin VB.Menu menuSystem 
  44.       Caption         =   "系统"
  45.       Begin VB.Menu menuModifypwd 
  46.          Caption         =   "修改密码"
  47.       End
  48.       Begin VB.Menu menuAdduser 
  49.          Caption         =   "添加用户"
  50.       End
  51.       Begin VB.Menu menuExit 
  52.          Caption         =   "退出"
  53.       End
  54.    End
  55.    Begin VB.Menu menuDrivers 
  56.       Caption         =   "司机信息管理"
  57.       Begin VB.Menu menuAdddrivers 
  58.          Caption         =   "添加司机信息"
  59.       End
  60.       Begin VB.Menu menuModifydrivers 
  61.          Caption         =   "修改司机信息"
  62.       End
  63.       Begin VB.Menu menuDeletedriver 
  64.          Caption         =   "删除司机信息"
  65.       End
  66.       Begin VB.Menu menuInquiredrivers 
  67.          Caption         =   "查询司机信息"
  68.       End
  69.    End
  70.    Begin VB.Menu menuCars 
  71.       Caption         =   "车辆信息管理"
  72.       Begin VB.Menu menuAddcars 
  73.          Caption         =   "添加车辆信息"
  74.       End
  75.       Begin VB.Menu menuModifycars 
  76.          Caption         =   "修改车辆信息"
  77.       End
  78.       Begin VB.Menu menuDeletecars 
  79.          Caption         =   "删除车辆信息"
  80.       End
  81.       Begin VB.Menu menuInquirecars 
  82.          Caption         =   "查询车辆信息"
  83.       End
  84.    End
  85.    Begin VB.Menu menuOperation 
  86.       Caption         =   "业务管理"
  87.       Begin VB.Menu menuRun 
  88.          Caption         =   "运营管理"
  89.          Begin VB.Menu menuAddrun 
  90.             Caption         =   "添加运营信息"
  91.          End
  92.          Begin VB.Menu menuModifyrun 
  93.             Caption         =   "修改运营信息"
  94.          End
  95.          Begin VB.Menu menuDeleterun 
  96.             Caption         =   "删除运营信息"
  97.          End
  98.          Begin VB.Menu menuInquirerun 
  99.             Caption         =   "查询运营信息"
  100.          End
  101.       End
  102.       Begin VB.Menu menuRepair 
  103.          Caption         =   "维修管理"
  104.          Begin VB.Menu menuAddrepair 
  105.             Caption         =   "添加维修信息"
  106.          End
  107.          Begin VB.Menu menuModifyrepair 
  108.             Caption         =   "修改维修信息"
  109.          End
  110.          Begin VB.Menu menuDeleterepair 
  111.             Caption         =   "删除维修信息"
  112.          End
  113.          Begin VB.Menu menuInquirerepair 
  114.             Caption         =   "查询维修信息"
  115.          End
  116.       End
  117.       Begin VB.Menu menuAccident 
  118.          Caption         =   "事故信息管理"
  119.          Begin VB.Menu menuAddacc 
  120.             Caption         =   "添加事故信息"
  121.          End
  122.          Begin VB.Menu menuModifyacc 
  123.             Caption         =   "修改事故信息"
  124.          End
  125.          Begin VB.Menu menuDeleteacc 
  126.             Caption         =   "删除事故信息"
  127.          End
  128.          Begin VB.Menu menuInquireacc 
  129.             Caption         =   "查询事故信息"
  130.          End
  131.       End
  132.    End
  133. End
  134. Attribute VB_Name = "frmMain"
  135. Attribute VB_GlobalNameSpace = False
  136. Attribute VB_Creatable = False
  137. Attribute VB_PredeclaredId = True
  138. Attribute VB_Exposed = False
  139. Private Sub MDIForm_Load()
  140.     Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
  141.     Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
  142.     Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
  143.     Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
  144.     
  145. End Sub
  146. Private Sub MDIForm_Unload(Cancel As Integer)
  147.     If Me.WindowState <> vbMinimized Then
  148.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  149.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  150.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  151.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  152.     End If
  153. End Sub
  154. Private Sub menuAddacc_Click()
  155.     gintaMode = 1
  156.     frmAcc1.Show
  157.     frmAcc1.ZOrder 0
  158. End Sub
  159. Private Sub menuAddcars_Click()
  160.     gintvMode = 1
  161.     frmVehicle1.Show
  162.     frmVehicle1.ZOrder 0
  163. End Sub
  164. Private Sub menuAdddrivers_Click()
  165.     gintdMode = 1
  166.     frmDriver1.Show
  167.     frmDriver1.ZOrder 0
  168.     
  169. End Sub
  170. Private Sub menuAddrepair_Click()
  171.     gintrMode = 1
  172.     frmRepair1.Show
  173.     frmRepair1.ZOrder 0
  174. End Sub
  175. Private Sub menuAddrun_Click()
  176.     gintsMode = 1
  177.     frmStatistic1.Show
  178.     frmStatistic1.ZOrder 0
  179. End Sub
  180. Private Sub menuDeleteacc_Click()
  181.     Dim txtSQL As String
  182.     Dim intCount As Integer
  183.     Dim mrc As ADODB.Recordset
  184.     Dim MsgText As String
  185.     
  186.     If frmAcc.msgList.Rows > 1 Then
  187.         If MsgBox("真的要删除这条文件记录么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  188.             intCount = frmAcc.msgList.Row
  189.             txtSQL = "delete from accident where sgid='" & Trim(frmAcc.msgList.TextMatrix(intCount, 1)) & "' and sgdate='" & Format(frmAcc.msgList.TextMatrix(intCount, 2), "yyyy-mm-dd") & "' and sgplace='" & Trim(frmAcc.msgList.TextMatrix(intCount, 3)) & "'"
  190.             Set mrc = ExecuteSQL(txtSQL, MsgText)
  191.             
  192.             Unload frmAcc
  193.             frmAcc.txtSQL = "select sgid,sgdate,sgplace,sgreason,sgdriver,sgopp_dept,sgopp_id,sgmode,sgvalue,sgmemo from accident"
  194.             frmAcc.Show
  195.         End If
  196.     End If
  197.     
  198. End Sub
  199. Private Sub menuDeletecars_Click()
  200.     Dim txtSQL As String
  201.     Dim intCount As Integer
  202.     Dim mrc As ADODB.Recordset
  203.     Dim MsgText As String
  204.     
  205.     If frmVehicle.msgList.Rows > 1 Then
  206.         If MsgBox("真的要删除这条文件记录么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  207.             intCount = frmVehicle.msgList.Row
  208.             txtSQL = "delete from vehicle where clid='" & Trim(frmVehicle.msgList.TextMatrix(intCount, 1)) & "'"
  209.             Set mrc = ExecuteSQL(txtSQL, MsgText)
  210.             
  211.             Unload frmVehicle
  212.             frmVehicle.txtSQL = "select * from vehicle"
  213.             frmVehicle.Show
  214.         End If
  215.     End If
  216. End Sub
  217. Private Sub menuDeletedriver_Click()
  218.     Dim txtSQL As String
  219.     Dim intCount As Integer
  220.     Dim mrc As ADODB.Recordset
  221.     Dim MsgText As String
  222.     
  223.     If frmDriver.msgList.Rows > 1 Then
  224.         If MsgBox("真的要删除这条文件记录么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  225.             intCount = frmDriver.msgList.Row
  226.             txtSQL = "delete from driver where sjid='" & Trim(frmDriver.msgList.TextMatrix(frmDriver.msgList.Row, 1)) & "'"
  227.             Set mrc = ExecuteSQL(txtSQL, MsgText)
  228.             
  229.             Unload frmDriver
  230.             frmDriver.txtSQL = "select * from driver"
  231.             frmDriver.Show
  232.         End If
  233.     End If
  234. End Sub
  235. Private Sub menuDeleterepair_Click()
  236.     Dim txtSQL As String
  237.     Dim intCount As Integer
  238.     Dim mrc As ADODB.Recordset
  239.     Dim MsgText As String
  240.     
  241.     If frmRepair.msgList.Rows > 1 Then
  242.         If MsgBox("真的要删除这条文件记录么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  243.             intCount = frmRepair.msgList.Row
  244.             txtSQL = "delete from repair where wxid='" & Trim(frmRepair.msgList.TextMatrix(intCount, 1)) & "' and wxdate='" & Format(frmRepair.msgList.TextMatrix(intCount, 2), "yyyy-mm-dd") & "'"
  245.             Set mrc = ExecuteSQL(txtSQL, MsgText)
  246.             
  247.             Unload frmRepair
  248.             frmRepair.txtSQL = "select * from repair"
  249.             frmRepair.Show
  250.         End If
  251.     End If
  252. End Sub
  253. Private Sub menuDeleterun_Click()
  254.     Dim txtSQL As String
  255.     Dim intCount As Integer
  256.     Dim mrc As ADODB.Recordset
  257.     Dim MsgText As String
  258.     
  259.     If frmStatistic.msgList.Rows > 1 Then
  260.         If MsgBox("真的要删除这条文件记录么?", vbOKCancel + vbExclamation, "警告") = vbOK Then
  261.             intCount = frmStatistic.msgList.Row
  262.             txtSQL = "delete from statistic where yyid='" & Trim(frmStatistic.msgList.TextMatrix(intCount, 1)) & "' and yydriver='" & Trim(frmStatistic.msgList.TextMatrix(intCount, 2)) & "' and yybegin_date='" & Format(frmStatistic.msgList.TextMatrix(intCount, 3), "yyyy-mm-dd") & "'"
  263.             Set mrc = ExecuteSQL(txtSQL, MsgText)
  264.             
  265.             Unload frmStatistic
  266.             frmStatistic.txtSQL = "select * from statistic"
  267.             frmStatistic.Show
  268.         End If
  269.     End If
  270. End Sub
  271. Private Sub menuInquireacc_Click()
  272.     frmAcc2.Show
  273. End Sub
  274. Private Sub menuInquirecars_Click()
  275.     frmVehicle2.Show
  276. End Sub
  277. Private Sub menuInquiredrivers_Click()
  278.     frmDriver2.Show
  279. End Sub
  280. Private Sub menuInquirerepair_Click()
  281.     frmRepair2.Show
  282. End Sub
  283. Private Sub menuInquirerun_Click()
  284.     frmStatistic2.Show
  285. End Sub
  286. Private Sub menuModifyacc_Click()
  287.     Dim intCount As Integer
  288.     If flagaEdit Then
  289.         If frmAcc.msgList.Rows > 1 Then
  290.             gintaMode = 2
  291.             intCount = frmAcc.msgList.Row
  292.             frmAcc1.txtSQL = "select * from accident where  sgid='" & Trim(frmAcc.msgList.TextMatrix(intCount, 1)) & "' and sgdate='" & Format(frmAcc.msgList.TextMatrix(intCount, 2), "yyyy-mm-dd") & "' and sgplace='" & Trim(frmAcc.msgList.TextMatrix(intCount, 3)) & "'"
  293.             frmAcc1.Show
  294.         Else
  295.             Call menuAddcars_Click
  296.         End If
  297.     Else
  298.         frmAcc.txtSQL = "select sgid,sgdate,sgplace,sgreason,sgdriver,sgopp_dept,sgopp_id,sgmode,sgvalue,sgmemo from accident"
  299.         frmAcc.Show
  300.     End If
  301.     
  302. End Sub
  303. Private Sub menuModifycars_Click()
  304.     Dim intCount As Integer
  305.     If flagvEdit Then
  306.         If frmVehicle.msgList.Rows > 1 Then
  307.             gintvMode = 2
  308.             intCount = frmVehicle.msgList.Row
  309.             frmVehicle1.txtSQL = "select * from vehicle where clid='" & Trim(frmVehicle.msgList.TextMatrix(intCount, 1)) & "'"
  310.             frmVehicle1.Show
  311.         Else
  312.             Call menuAddcars_Click
  313.         End If
  314.     Else
  315.         frmVehicle.txtSQL = "select * from vehicle"
  316.         frmVehicle.Show
  317.     End If
  318. End Sub
  319. Private Sub menuModifydrivers_Click()
  320.     Dim intCount As Integer
  321.     If flagdEdit Then
  322.         If frmDriver.msgList.Rows > 1 Then
  323.             gintdMode = 2
  324.             intCount = frmDriver.msgList.Row
  325.             frmDriver1.txtSQL = "select * from driver where sjid='" & Trim(frmDriver.msgList.TextMatrix(frmDriver.msgList.Row, 1)) & "'"
  326.             frmDriver1.Show
  327.         Else
  328.             Call menuAdddrivers_Click
  329.         End If
  330.     Else
  331.         frmDriver.txtSQL = "select * from driver"
  332.         frmDriver.Show
  333.     End If
  334. End Sub
  335. Private Sub menuModifyrepair_Click()
  336.     Dim intCount As Integer
  337.     If flagrEdit Then
  338.         If frmRepair.msgList.Rows > 1 Then
  339.             gintrMode = 2
  340.             intCount = frmRepair.msgList.Row
  341.             frmRepair1.txtSQL = "select * from repair where wxid='" & Trim(frmRepair.msgList.TextMatrix(intCount, 1)) & "' and wxdate='" & Format(frmRepair.msgList.TextMatrix(intCount, 2), "yyyy-mm-dd") & "'"
  342.             frmRepair1.Show
  343.         Else
  344.             Call menuAddrepair_Click
  345.         End If
  346.     Else
  347.         frmRepair.txtSQL = "select * from repair"
  348.         frmRepair.Show
  349.     End If
  350. End Sub
  351. Private Sub menuModifyrun_Click()
  352.     
  353.     Dim intCount As Integer
  354.     If flagsEdit Then
  355.         If frmStatistic.msgList.Rows > 1 Then
  356.             gintsMode = 2
  357.             intCount = frmStatistic.msgList.Row
  358.             frmStatistic1.txtSQL = "select * from statistic where yyid='" & Trim(frmStatistic.msgList.TextMatrix(intCount, 1)) & "'"
  359.             frmStatistic1.Show
  360.         Else
  361.             Call menuAddrun_Click
  362.         End If
  363.     Else
  364.         frmStatistic.txtSQL = "select * from statistic"
  365.         frmStatistic.Show
  366.     End If
  367. End Sub