📄 frmttgl.frm
字号:
Height = 1935
Left = 240
TabIndex = 4
Top = 3840
Width = 8175
_ExtentX = 14420
_ExtentY = 3413
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 1
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "追加房间"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmJDGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
Unload mdiHotelmain
Load mdiHotelmain
mdiHotelmain.Show
Unload Me
End Sub
Private Sub cmdok_Click() '填写入住客户信息
If txtid.Text = "" Or Combono.Text = "" Or txtname = "" Or Combotype.Text = "" Or txtzjno.Text = "" Or DTPicker2.Value = "" Then
MsgBox "请认真填完所有的表格!"
Exit Sub
Else
Dim i As Integer
Dim rst As New ADODB.Recordset
txtsql = "select * from tbSK_Book"
Set rst = ExecuteSQL(txtsql)
i = 1
While i <= List2.ListCount
rst.AddNew
rst!cAccountId = txtid.Text
rst!cRoomStory = Combocs.Text
rst!croomno = List2.list(i - 1)
rst!cClientName = txtname.Text
If Option1.Value = True Then
rst!cSex = "男"
Else
rst!cSex = "女"
End If
rst!cZJ = Combotype.Text
rst!cZJ_No = txtzjno.Text
rst!dRoom_In = Date
rst!dRoom_Out = DTPicker2.Value
rst!cRoomType = "占用"
rst!vMessage = txtmessage.Text
'End If
rst.Update
i = i + 1
Wend
End If
cmdok.Enabled = False
cmdquding.Enabled = True
Combono.Enabled = True
Combocs.Text = "第一层"
txtid.Text = ""
Combono.Clear
Combono.Text = ""
txtname.Text = ""
Option1.Value = False
Option2.Value = False
Combotype.Text = "身份证"
txtzjno.Text = ""
txtmessage.Text = ""
DTPicker2.Value = Date
Unload Me
frmJDGL.Show
End Sub
Private Sub cmdquding_Click() '选择楼层数,选择某层,则加载该层的房间号
cmdok.Enabled = True
Dim i As Integer
Dim rs As New ADODB.Recordset
If Combocs.Text = "第一层" Then
i = 1
While i <= 8
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combono.AddItem i
End If
i = i + 1
Wend
ElseIf Combocs.Text = "第二层" Then
i = 9
While i <= 16
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combono.AddItem i
End If
i = i + 1
Wend
ElseIf Combocs.Text = "第三层" Then
i = 17
While i <= 24
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combono.AddItem i
End If
i = i + 1
Wend
ElseIf Combocs.Text = "第四层" Then
i = 25
While i <= 32
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & i & "'"
Set rs = ExecuteSQL(txtsql)
If rs.EOF Then
Combono.AddItem i
End If
i = i + 1
Wend
End If
rs.Close
List1.Clear
List2.Clear
Dim h As Integer
Dim rst As New ADODB.Recordset
If Combocs.Text = "第一层" Then
h = 1
While h <= 8
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combocs.Text = "第二层" Then
h = 9
While h <= 16
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combocs.Text = "第三层" Then
h = 17
While h <= 24
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
ElseIf Combocs.Text = "第四层" Then
h = 25
While h <= 32
txtsql = "select * from tbNewRoomStatus where cRoomNo='" & h & "'"
Set rst = ExecuteSQL(txtsql)
If rst.EOF Then
List1.AddItem h
End If
h = h + 1
Wend
End If
rst.Close
End Sub
Private Sub Combono_Click()
List2.AddItem Combono.Text
List1.ListIndex = Combono.ListIndex
List1.RemoveItem List1.ListIndex
Combono.Enabled = False
End Sub
Private Sub Command1_Click()
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
If List1.ListCount = 0 Then
Command1.Enabled = False
Command2.Enabled = True
Else
Command1.Enabled = True
Command2.Enabled = True
End If
End Sub
Private Sub Command2_Click()
List1.AddItem List2.Text
List2.RemoveItem List2.ListIndex
If List2.ListCount = 0 Then
Command2.Enabled = False
Command1.Enabled = True
Else
Command2.Enabled = True
Command1.Enabled = True
End If
End Sub
Private Sub Form_Load()
Call changeskin(Me, sknJDGL, strSkin)
DTPicker2.Value = Date
cmdok.Enabled = False
cmdquding.Enabled = True
Dim h As Integer
Combocs.AddItem "第一层"
Combocs.AddItem "第二层"
Combocs.AddItem "第三层"
Combocs.AddItem "第四层"
Combotype.AddItem "身份证"
Combotype.AddItem "机关证"
Combotype.AddItem "学生证"
Combocs.Text = "第一层"
Option3.Value = True
End Sub
Private Sub Option3_Click() '散客单选按钮。如选择散客,那么只能选择一个房间。
If Option3.Value = True Then
TabStrip2.Enabled = False
List1.Enabled = False
List2.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Else
TabStrip2.Enabled = True
List1.Enabled = True
List2.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
End If
End Sub
Private Sub Option4_Click() '团体按钮。如是团体,则可追加房间
If Option4.Value = True Then
TabStrip2.Enabled = True
List1.Enabled = True
List2.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
Else
TabStrip2.Enabled = False
List1.Enabled = False
List2.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -