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

📄 客人列表查询.frm

📁 vb酒店管理系统的原码下载
💻 FRM
📖 第 1 页 / 共 5 页
字号:
Dim Data_Rec As Long
Dim TY_XG As Boolean
Dim FB_table1 As String

Private Sub Command1_Click()
    Adodc1.Recordset.Fields("级别") = "黑名单"
    Adodc1.Recordset.Fields("级别类型") = Me.Combo10.Text
    Adodc1.Recordset.Update
End Sub

Private Sub Command10_Click()
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields("姓名") = KeRen.Text
    Adodc1.Recordset.Fields("英文姓名") = Text2.Text
    Adodc1.Recordset.Fields("性别") = Combo1.Text
    Adodc1.Recordset.Fields("出生日期") = Text4.Text
    Adodc1.Recordset.Fields("籍贯") = Text5.Text
    Adodc1.Recordset.Fields("长住地址") = Text6.Text
    Adodc1.Recordset.Fields("联系电话") = Text7.Text
    Adodc1.Recordset.Fields("身份或职业") = Text8.Text
    Adodc1.Recordset.Fields("证件号码") = Text9.Text
    Adodc1.Recordset.Fields("类别") = Combo2.Text
    Adodc1.Recordset.Fields("级别") = Text11.Text
    Adodc1.Recordset.Fields("密码") = Text12.Text
    Adodc1.Recordset.Fields("折扣") = Text13.Text
    Adodc1.Recordset.Update
    Me.Picture5.Visible = False
End Sub

Private Sub Command11_Click()
    Me.Picture5.Visible = False
End Sub

Private Sub Command2_Click()
    Me.Picture2.Visible = False
End Sub

Private Sub Command4_Click()
    On Error GoTo ERR_pro201

    Picture1.Visible = False
    If Me.Option1.Value Then
        ZH_ysh = " like "
    End If
    If Me.Option2.Value Then
        ZH_ysh = " >= "
    End If
    If Me.Option3.Value Then
        ZH_ysh = " <= "
    End If
    If Me.Option4.Value Then
        ZH_ysh = " = "
    End If
    If Me.Option5.Value Then
        ZH_ysh = " <> "
    End If
    If Me.Option6.Value Then
        ZH_ysh = " like "
    End If

            Field_Value = Field_Z.Text
            'MsgBox Field_Type
            If Field_Value <> "" Then
                If Field_Value = "null" Or field_valu = "NULL" Then
                If ZH_find1 = "" Then
                '空值,单级
                    'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find1 = " not " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find1 = " not " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find1 = " not " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find1 = " not " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find1 = " not " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find1 = " not " & FindFieldC & " is null"
                    Else
                        If Field_Type = 200 Then ZH_find1 = FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find1 = FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find1 = FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find1 = FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find1 = FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find1 = FindFieldC & " is null"
                    End If
                Else
                    '空值,多级
                    'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And not " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and not " & FindFieldC & " is null"
                    Else
                        If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and  " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & " is null"
                    End If
                End If
                
                Else
                If ZH_find1 = "" Then
                    '非空值,单级
                    'ZH_find1 = FindFieldC & " like " & "'" & Field_Value & "'"
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
                        If Field_Type = 202 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
                        If Field_Type = 7 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
                        If Field_Type = 135 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
                        If Field_Type = 2 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
                        If Field_Type = 6 Then ZH_find1 = " (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
                    Else
                        If Field_Type = 200 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
                        If Field_Type = 202 Then ZH_find1 = FindFieldC & ZH_ysh & "'" & Field_Value & "'"
                        If Field_Type = 7 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 135 Then ZH_find1 = FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 2 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
                        If Field_Type = 6 Then ZH_find1 = FindFieldC & ZH_ysh & CInt(Field_Value)
                    End If
                Else
                    '非空值,多级
                    'ZH_find1 = ZH_find1 & " and " & FindFieldC & " like " & "'" & Field_Value & "'"
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null)"
                        If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And (not " & FindFieldC & ZH_ysh & " '" & Field_Value & "' or " & FindFieldC & " is null)"
                        If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
                        If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null)"
                        If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
                        If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and (not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null)"
                    Else
                        If Field_Type = 200 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
                        If Field_Type = 202 Then ZH_find1 = ZH_find1 & " And " & FindFieldC & ZH_ysh & " '" & Field_Value & "'"
                        If Field_Type = 7 Then ZH_find1 = ZH_find1 & " and  " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 135 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 2 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
                        If Field_Type = 6 Then ZH_find1 = ZH_find1 & " and " & FindFieldC & ZH_ysh & CInt(Field_Value)
                    End If

                End If
                
                End If
                '多级与单级分类
                If DJ_query Then
                    ZH_find = " where " & ZH_find1
                Else
                    'ZH_find = " where " & FindFieldC & " like " & "'" & Field_Value & "'"
                If Field_Value = "null" Or field_valu = "NULL" Then
                '空值
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & " is null"
                    Else
                        If Field_Type = 200 Then ZH_find = " where " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find = " where " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find = " where " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find = " where " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find = " where " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find = " where " & FindFieldC & " is null"
                    End If
                Else
                    If Me.Option6.Value Then
                        If Field_Type = 200 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
                        If Field_Type = 202 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "'" & Field_Value & "' or " & FindFieldC & " is null"
                        If Field_Type = 7 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
                        If Field_Type = 135 Then ZH_find = " where not " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "# or " & FindFieldC & " is null"
                        If Field_Type = 2 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
                        If Field_Type = 6 Then ZH_find = " where not " & FindFieldC & ZH_ysh & CInt(Field_Value) & " or " & FindFieldC & " is null"
                    Else
                        If Field_Type = 200 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
                        If Field_Type = 202 Then ZH_find = " where " & FindFieldC & ZH_ysh & "'" & Field_Value & "'"
                        If Field_Type = 7 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 135 Then ZH_find = " where " & FindFieldC & ZH_ysh & "#" & CDate(Field_Value) & "#"
                        If Field_Type = 2 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
                        If Field_Type = 6 Then ZH_find = " where " & FindFieldC & ZH_ysh & CInt(Field_Value)
                    End If
                End If
                End If
                'MsgBox ZH_find
                FB_table2 = " 住宿情况 " & ZH_find & " order by " & Or_Field
                US_Field = " 住宿情况 " & ZH_find
                'MsgBox FB_table2
                Adodc1.CommandType = adCmdText
                Adodc1.RecordSource = "select * from " & FB_table2
                Adodc1.Refresh
                Set DataGrid1.DataSource = Adodc1
                DataGrid1.ReBind
                DataGrid1.Refresh

                If Adodc1.Recordset.RecordCount = 0 Then
                    MsgBox "请注意:你所查找的用户不存在,请核对!", vbOKOnly, "错误信息"
                End If
            End If
            Exit Sub

ERR_pro201:
    MsgBox "请注意:查询错误,重新操作!", 48, "提示"

End Sub

Private Sub Command5_Click()
    Picture1.Visible = False
End Sub

Private Sub Command7_Click()
    Load_Statu = "使用"
    房态图FORM.Show 1
    If Room_Update Then
        Me.F_RoomNo.Text = RoomNO
        Me.F_RoomRate.Text = Room_Rate
    End If
    QAccount_ID = ""
    
End Sub

Private Sub Command8_Click()
Dim Qname As String
Dim Qaid As String

    Qname = Adodc1.Recordset.Fields("姓名")
    Qaid = Adodc1.Recordset.Fields("帐号")

    If Room_Statu = "空房" Then
        If Load_Statu = "使用" Then
            Adodc9.ConnectionString = My_PROVIDER
            Adodc9.CommandType = adCmdText
            Adodc9.RecordSource = "select * from 客房 where 房号 like '" & F_RoomNo & "'"
            Adodc9.Refresh
            Adodc9.Recordset.Fields("当前状态") = "售出"
            Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
            Adodc9.Recordset.Fields("帐号") = Account_ID
            Adodc9.Recordset.Fields("住客") = 1
            Adodc9.Recordset.Update
            Adodc9.Recordset.Close
        End If
    Else
        If Room_Statu = "预订" Then
            If Account_ID = QAccount_ID Then
                Adodc9.ConnectionString = My_PROVIDER
                Adodc9.CommandType = adCmdText
                Adodc9.RecordSource = "select * from 客房 where 房号 like '" & F_RoomNo & "'"
                Adodc9.Refresh
                Adodc9.Recordset.Fields("当前状态") = "售出"
                Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
                Adodc9.Recordset.Fields("帐号") = Account_ID
                Adodc9.Recordset.Update
                Adodc9.Recordset.Close
            Else
                MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
                Room_Update = False
            End If
        Else
            If Room_Statu = "售出" Then
                Select Case Room_Share_Type
                Case "共享"
                    MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
                Case "包房"
                    MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
                Case Else
                    MsgBox "房间状态错误,请核查!", 64, "提示"
                End Select
            End If
        End If
    End If
    
    Adodc9.ConnectionString = My_PROVIDER
    Adodc9.CommandType = adCmdText
    Adodc9.RecordSource = "select * from 客房 where 房号 like '" & Text1 & "'"
    Adodc9.Refresh
    If Adodc9.Recordset.RecordCount > 0 Then
        Adodc9.Recordset.Fields("当前状态") = "脏房"
        Adodc9.Recordset.Fields("出售方式") = ""
        Adodc9.Recordset.Fields("帐号") = ""
        Adodc9.Recordset.Fields("住客") = Adodc9.Recordset.Fields("住客") - 1
        Adodc9.Recordset.Update
    End If
    Adodc9.Recordset.Close
    
    Adodc2.ConnectionString = My_PROVIDER
    Adodc2.CommandType = adCmdText
    Adodc2.RecordSource = "select * from 房号变更表"
    Adodc2.Refresh
    Adodc2.Recordset.AddNew
    Adodc2.Recordset.Fields("日期") = System_Date
    Adodc2.Recordset.Fields("时间") = Left(Time, 5)
    Adodc2.Recordset.Fields("帐号") = Qaid
    Adodc2.Recordset.Fields("姓名") = Qname
    Adodc2.Recordset.Fields("原房号") = Me.Text1.Text
    Adodc2.Recordset.Fields("现房号") = Me.F_RoomNo.Text
    Adodc2.Recordset.Fields("操作员") = CzyName
    Adodc2.Recordset.Update
    Adodc2.Recordset.Close
    'MsgBox Me.F_RoomNo.Text
    Adodc1.Recordset.Fields("房号") = Me.F_RoomNo.Text
    Adodc1.Recordset.Fields("房价") = CCur(Me.F_RoomRate.Text)
    Adodc1.Recordset.Fields("房类") = Room_Type
    Adodc1.Recordset.Update
    Me.Picture3.Visible = False
    MsgBox "换房成功!", 64, "提示"
    
End Sub

Private Sub Command9_Click()
    Me.Picture3.Visible = False
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    On Error GoTo errhandler
    FindFieldC = Adodc1.Recordset.Fields(DataGrid1.Col).Name
    Field_Type = CInt(Adodc1.Recordset.Fields(DataGrid1.Col).Type)
    'MsgBox Adodc1.Recordset.Fields(DataGrid1.Col).DefinedSize
    If InStr(1, Adodc1.RecordSource, "住宿情况") > 0 Then
        Select Case Me.Caption
            Case "在住客人预付和消费表"
                'BB_type = "报表"
                
            Case Else
        Account_ID = Adodc1.Recordset.Fields("帐号")
        QAccount_ID = Adodc1.Re

⌨️ 快捷键说明

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