📄 房态图.frm
字号:
Q_Name = InputBox("请输入客人姓名:", "快速入住", "")
If Q_Name <> "" Then
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 参数"
Adodc1.Refresh
Adodc1.Recordset.Fields("帐号") = Adodc1.Recordset.Fields("帐号") + 1
Account_ID = Format(Adodc1.Recordset.Fields("帐号"), "000000")
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况 where 姓名 like '" & Q_Name & "' order by 帐号 desc"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If MsgBox("系统记录有同名客人档案" & CStr(Adodc1.Recordset.RecordCount) & "人,是否直接调用?", 65, "提示") = vbOK Then
Set Me.DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
Me.Picture3.Visible = True
End If
Else
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("当前状态") = "售出"
Adodc9.Recordset.Fields("出售方式") = "包房"
Adodc9.Recordset.Fields("帐号") = Account_ID
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("帐号") = Account_ID
Adodc1.Recordset.Fields("姓名") = Q_Name
Adodc1.Recordset.Fields("房号") = RoomNO
Adodc1.Recordset.Fields("房价") = Room_Rate
Adodc1.Recordset.Fields("房类") = Room_Type
Adodc1.Recordset.Fields("操作员") = CzyName
Adodc1.Recordset.Fields("当前状态") = "入住"
Adodc1.Recordset.Fields("日期") = System_Date
Adodc1.Recordset.Fields("到店日期") = System_Date
Adodc1.Recordset.Fields("到店时间") = Left(Time, 5)
Adodc1.Recordset.Fields("时间") = Left(Time, 5)
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Call ReLoadStatu
MsgBox "新客人 {" & Q_Name & "} 入住" & RoomNO & "房间成功!", 64, "提示"
End If
Else
MsgBox "没有客人姓名,不能入住!", 16, "提示"
End If
'不是空房
Else
If Room_Statu = "预订" Then
If Account_ID = QAccount_ID Then
Room_Use_Type = "包房"
Room_Update = True
Adodc9.Recordset.Close
Unload Me
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
Room_Update = False
Else
MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],不能" & Registration_Type & "!", 48, "提示"
End If
End If
End If
End If
Exit Sub
err15:
MsgBox "操作错误,错误代码1015", 48, "提示"
End Sub
Private Sub Command6_Click()
On Error GoTo err16
Dim Q_Name As String
If Registration_Type <> "快速入住" Then
If Room_Statu = "空房" Then
If Load_Statu = "使用" Then
Room_Use_Type = "共享"
Room_Update = True
Adodc9.Recordset.Close
Unload Me
End If
Else
If Room_Statu = "预订" Then
If Account_ID = QAccount_ID Then
Room_Use_Type = "共享"
Room_Update = True
Adodc9.Recordset.Close
Unload Me
Else
MsgBox "请注意:1." & 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 "请注意:2." & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Room_Use_Type = "共享"
Room_Update = True
Room_Rate = 0
'MsgBox RoomNO
Adodc9.Recordset.Close
Unload Me
Case "包房"
MsgBox "请注意:3." & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Room_Update = False
Case Else
MsgBox "房间状态错误,请核查!", 64, "提示"
Room_Update = False
End Select
End If
End If
End If
Else
'快速入住
If Room_Statu = "空房" Then
Room_Use_Type = "共享"
Q_Name = ""
Q_Name = InputBox("请输入客人姓名:", "快速入住", "")
If Q_Name <> "" Then
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 参数"
Adodc1.Refresh
Adodc1.Recordset.Fields("帐号") = Adodc1.Recordset.Fields("帐号") + 1
Account_ID = Format(Adodc1.Recordset.Fields("帐号"), "000000")
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况 where 姓名 like '" & Q_Name & "' order by 帐号 desc"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If MsgBox("系统记录有同名客人档案" & CStr(Adodc1.Recordset.RecordCount) & "人,是否直接调用?", 65, "提示") = vbOK Then
Set Me.DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
Me.Picture3.Visible = True
End If
Else
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("当前状态") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
'adodc9.Recordset.Fields("帐号") = Account_ID
Adodc9.Recordset.Fields("住客") = Adodc9.Recordset.Fields("住客") + 1
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("帐号") = Account_ID
Adodc1.Recordset.Fields("姓名") = Q_Name
Adodc1.Recordset.Fields("房号") = RoomNO
Adodc1.Recordset.Fields("房价") = Room_Rate
Adodc1.Recordset.Fields("房类") = Room_Type
Adodc1.Recordset.Fields("操作员") = CzyName
Adodc1.Recordset.Fields("当前状态") = "入住"
Adodc1.Recordset.Fields("日期") = System_Date
Adodc1.Recordset.Fields("到店日期") = System_Date
Adodc1.Recordset.Fields("到店时间") = Left(Time, 5)
Adodc1.Recordset.Fields("时间") = Left(Time, 5)
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Call ReLoadStatu
MsgBox "新客人 {" & Q_Name & "} 入住" & RoomNO & "房间成功!", 64, "提示"
End If
Else
MsgBox "没有客人姓名,不能入住!", 16, "提示"
End If
'不是空房
Else
If Room_Statu = "预订" Then
If Account_ID = QAccount_ID Then
Room_Use_Type = "包房"
Room_Update = True
Adodc9.Recordset.Close
Unload Me
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 "共享"
Q_Name = ""
Q_Name = InputBox("请输入客人姓名:", "快速入住", "")
If Q_Name <> "" Then
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 参数"
Adodc1.Refresh
Adodc1.Recordset.Fields("帐号") = Adodc1.Recordset.Fields("帐号") + 1
Account_ID = Format(Adodc1.Recordset.Fields("帐号"), "000000")
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况 where 姓名 like '" & Q_Name & "' order by 帐号 desc"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If MsgBox("系统记录有同名客人档案" & CStr(Adodc1.Recordset.RecordCount) & "人,是否直接调用?", 65, "提示") = vbOK Then
Set Me.DataGrid1.DataSource = Adodc1
DataGrid1.ReBind
DataGrid1.Refresh
Me.Picture3.Visible = True
Room_Rate = 0
End If
Else
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("当前状态") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
Adodc9.Recordset.Fields("住客") = Adodc9.Recordset.Fields("住客") + 1
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 住宿情况"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("帐号") = Account_ID
Adodc1.Recordset.Fields("姓名") = Q_Name
Adodc1.Recordset.Fields("房号") = RoomNO
Adodc1.Recordset.Fields("房价") = 0
Adodc1.Recordset.Fields("房类") = Room_Type
Adodc1.Recordset.Fields("操作员") = CzyName
Adodc1.Recordset.Fields("当前状态") = "入住"
Adodc1.Recordset.Fields("日期") = System_Date
Adodc1.Recordset.Fields("到店日期") = System_Date
Adodc1.Recordset.Fields("到店时间") = Left(Time, 5)
Adodc1.Recordset.Fields("时间") = Left(Time, 5)
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Call ReLoadStatu
MsgBox "新客人 {" & Q_Name & "} 入住" & RoomNO & "房间成功!", 64, "提示"
End If
Else
MsgBox "没有客人姓名,不能入住!", 16, "提示"
End If
Case "包房"
MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Case Else
MsgBox "房间状态错误,请核查!", 64, "提示"
End Select
Room_Update = False
Else
MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],不能" & Registration_Type & "!", 48, "提示"
End If
End If
End If
End If
Exit Sub
err16:
MsgBox "操作错误,错误代码1016", 48, "提示"
End Sub
Private Sub Command7_Click()
On Error GoTo err17
Dim DATA(80)
Dim i As Long
Q_Name = Adodc1.Recordset.Fields("姓名")
For i = 0 To Adodc1.Recordset.Fields.Count - 1
DATA(i) = Adodc1.Recordset.Fields(i)
Next
If Room_Statu = "预订" Then
If Account_ID = QAccount_ID Then
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("当前状态") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
Adodc9.Recordset.Fields("帐号") = Account_ID
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Call ReLoadStatu
Else
MsgBox "请注意:" & RoomNO & "房间当前状态是:[" & Room_Statu & "],被[" & QAccount_ID & "]帐号" & Room_Share_Type & ",不能" & Registration_Type & "!", 48, "提示"
Room_Update = False
Exit Sub
End If
Else
Select Case Room_Statu
Case "售出"
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
Exit Sub
Case "空房"
Adodc9.ConnectionString = My_PROVIDER
Adodc9.CommandType = adCmdText
Adodc9.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc9.Refresh
Adodc9.Recordset.Fields("当前状态") = "售出"
Adodc9.Recordset.Fields("出售方式") = Room_Use_Type
Adodc9.Recordset.Fields("帐号") = Account_ID
Adodc9.Recordset.Update
Adodc9.Recordset.Close
Call ReLoadStatu
End Select
End If
Adodc1.Recordset.AddNew
For i = 1 To Adodc1.Recordset.Fields.Count - 1
Adodc1.Recordset.Fields(i) = DATA(i)
Next
Adodc1.Recordset.Fields("帐号") = Account_ID
Adodc1.Recordset.Fields("房号") = RoomNO
Adodc1.Recordset.Fields("房价") = Room_Rate
Adodc1.Recordset.Fields("到店日期") = System_Date
Adodc1.Recordset.Fields("到店时间") = Left(Time, 5)
Adodc1.Recordset.Fields("离店日期") = System_Date
Adodc1.Recordset.Fields("天数") = 1
Adodc1.Recordset.Fields("平衡金额") = 0
Adodc1.Recordset.Fields("金额") = 0
Adodc1.Recordset.Fields("预付款") = 0
Adodc1.Recordset.Fields("费用类") = 0
Adodc1.Recordset.Fields("房租") = 0
Adodc1.Recordset.Fields("全日房") = 0
Adodc1.Recordset.Fields("半日房") = 0
Adodc1.Recordset.Fields("钟点房") = 0
Adodc1.Recordset.Fields("电话费") = 0
Adodc1.Recordset.Fields("餐费") = 0
Adodc1.Recordset.Fields("其他") = 0
Adodc1.Recordset.Fields("操作员") = CzyName
Adodc1.Recordset.Fields("日期") = System_Date
Adodc1.Recordset.Fields("时间") = Left(Time, 5)
Adodc1.Recordset.Fields("当前状态") = "入住"
Adodc1.Recordset.Fields("标志") = ""
Adodc1.Recordset.Fields("帐务笔数") = 0
Adodc1.Recordset.Update
Me.Picture3.Visible = False
MsgBox "客人已入住:" & RoomNO & "客房,资料已保存!", 64, "提示"
Exit Sub
err17:
MsgBox "操作错误,错误代码1017", 48, "提示"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -