图6.1登录界面
代码如下:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Private Sub Form_Load()
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
txtUserName.Text = Left$(sBuffer, lSize)
Else
txtUserName.Text = vbNullString
End If
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'ToDo: create test for correct password
'check for correct password
If txtPassword.Text = "" Then
OK = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
进入系统主界面:
若图片无法显示请联系QQ752018766,本论文免费,转发请注明源于www.chuibin.com图6.2系统主界面
代码如下:
Private Sub MDIForm_Load()
Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
If Me.WindowState <> vbMinimized Then
SaveSetting App.Title, "Settings", "MainLeft", Me.Left
SaveSetting App.Title, "Settings", "MainTop", Me.Top
SaveSetting App.Title, "Settings", "MainWidth", Me.Width
SaveSetting App.Title, "Settings", "MainHeight", Me.Height
End If
End Sub
Private Sub menuAirline_Click()
frmAirline.txtSQL = "select * from airlineInfo"
frmAirline.Show 0
End Sub
Private Sub menuBookticket_Click()
frmTicket.txtSQL = "select * from ticketInfo "
frmTicket.Show 0
End Sub
Private Sub menuCarbin_Click()
frmService.txtSQL = "select * from serviceInfo"
frmService.Show 0
End Sub
Private Sub menuCtype_Click()
frmcType.txtSQL = "select * from customerType"
frmcType.Show 0
End Sub
Private Sub menuCustomer_Click()
frmCustomer.txtSQL = "select * from customerInfo"
frmCustomer.Show 0
End Sub
Private Sub menuPlane_Click()
frmPlane.txtSQL = "select * from planeInfo"
frmPlane.Show 0
End Sub
Private Sub searchcustom_Click()
frmCustomer.Show 1
End Sub
选择旅客信息管理:
若图片无法显示请联系QQ752018766,本论文免费,转发请注明源于www.chuibin.com图6.3旅客信息管理界面
代码如下:
Private Sub Form_Load()
    ShowTitle
    ShowData
    End Sub
Private Sub Form_Resize()
    'If Me.WindowState <> vbMinimized And fMainForm.WindowState <> vbMinimized Then
        '边界处理
        'If Me.ScaleHeight < 10 * lblTitle.Height Then
        ' Exit Sub
       ' End If
        'If Me.ScaleWidth < lblTitle.Width + lblTitle.Width / 2 Then
         ' Exit Sub
       ' End If
        '控制控件的位置
      ' lblTitle.Top = lblTitle.Height
       ' lblTitle.Left = (Me.Width - lblTitle.Width) / 2
         'msgList.Top = lblTitle.Top + lblTitle.Height + lblTitle.Height / 2
        'msgList.Width = Me.ScaleWidth - 200
        'msgList.Left = Me.ScaleLeft + 100
        'msgList.Height = Me.ScaleHeight - msgList.Top - 1500
          ' Frame2.Top = msgList.Top + msgList.Height + 50
       ' Frame2.Left = Me.ScaleWidth / 2 - 3000
    'End If
End Sub
Public Sub FormClose()
    Unload Me
End Sub
Private Sub ShowData()
        Dim j As Integer
    Dim i As Integer
    Dim MsgText As String
    Set mrc = ExecuteSQL(txtSQL, MsgText)
        With msgList
        .Rows = 1
                'Do While Not mrc.EOF
            '.Rows = .Rows + 1
            'For i = 1 To mrc.Fields.Count
                'If Not IsNull(Trim(mrc.Fields(i - 1))) Then
               ' Select Case mrc.Fields(i - 1).Type
                   ' Case adDBDate
        '.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
                   ' Case Else
                        '.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
                'End Select
               ' End If
            'Next i
            'mrc.MoveNext
        '
          End With
    'mrc.Close
   End Sub
'显示Grid表头
Private Sub ShowTitle()
    Dim i As Integer
        With msgList
        .Cols = 7
        .TextMatrix(0, 0) = "旅客姓名"
        .TextMatrix(0, 1) = "旅客性别"
        .TextMatrix(0, 2) = "身份证号码"
        .TextMatrix(0, 3) = "联系电话"
        .TextMatrix(0, 4) = "起飞时间"
        .TextMatrix(0, 5) = "目的地"
.TextMatrix(0, 6) = "备注信息"
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>