VB宾馆管理系统 第9页

VB宾馆管理系统 第9页
bookin where ammount = '0' and " & sQSql
        frmBookin.Show
    End If
    Me.Hide
End Sub

Private Sub Form_Load()
   
   
    Dim i As Integer
    Dim j As Integer
    Dim sSql As String
    Dim txtSQL As String
    Dim MsgText As String
    Dim mrc As ADODB.Recordset
   
 
    txtSQL = "select distinct datepart(yy,indate) from bookin where ammount = '0' "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        With mrc
751com.cn
boYear(0).ListIndex = 0
       
        For j = 1 To 12
            cboMonth(0).AddItem j
        Next j
        cboMonth(0).Text = Month(Now())
       
        For j = 1 To 31
            cboDay.AddItem j
        Next j
        cboDay.Text = Day(Now())
       
    Else
        cmdOk.Enabled = False
    End If
    mrc.Close
End Sub

Private Sub lblitem_Click(Index As Integer)
    chkItem(Index).Value = vbChecked
   
End Sub

Private Sub txtItem_GotFocus(Index As Integer)
  
    txtItem(Index).SelStart = 0
    txtItem(Index).SelLength = Len(txtItem(Index))
End Sub
3:订房信息列表窗体源代码:
Option Explicit
Public txtSQL As String
Dim mrc As ADODB.Recordset
Dim MsgText As String

 

Private Sub Form_Load()
   
    ShowTitle
    ShowData
    flagBedit = True
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 - 200
    End If
End Sub

 

Public Sub FormClose()
    Unload Me
End Sub

'删除记录
Private Sub Form_Unload(Cancel As Integer)
    flagBedit = False
    gintBmode = 0
End Sub

 

 


'显示Grid的内容

Private Sub ShowData()
   
    Dim j As Integer
    Dim i As Integer

 
    Set mrc = ExecuteSQL(txtSQL, MsgText)
        With msgList
        .Rows = 1
       
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 1 To mrc.Fields.Count
                Select Case mrc.Fields(i - 1).Type
                    Case adDBDate
    751com.cn
mrc.Fields(i - 1) & ""
                End Select
            Next i
            mrc.MoveNext
        Loop
       
         
    End With
    mrc.Close
   
   
End Sub


'显示Grid表头
Private Sub ShowTitle()
    Dim i As Integer
   
    With msgList
        .Cols = 8
        .TextMatrix(0, 1) = ""
        .TextMatrix(0, 2) = "顾客姓名"
        .TextMatrix(0, 3) = "身份证号码"
        .TextMatrix(0, 4) = "房间编号"
        .TextMatrix(0, 5) = "入住日期"
        .TextMatrix(0, 6) = "折扣"
        .TextMatrix(0, 7) = "备注"
       
       
        '固定表头
        .FixedRows = 1
               
        '设置各列的对齐方式
        For i = 0 To 7
            .ColAlignment(i) = 0

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 

  • 上一篇文章:
  • 下一篇文章:
  • Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有