📄 kefangchakan.frm
字号:
VERSION 5.00
Begin VB.Form kefangchakan
Caption = "客房查看"
ClientHeight = 4320
ClientLeft = 60
ClientTop = 345
ClientWidth = 6915
Icon = "kefangchakan.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4320
ScaleWidth = 6915
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
Height = 975
Left = 0
TabIndex = 19
Top = 3240
Width = 6855
Begin VB.CommandButton Command4
Caption = "返回"
Height = 375
Left = 6240
TabIndex = 23
Top = -120
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 3720
TabIndex = 22
Top = 360
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "修改"
Height = 375
Left = 2040
TabIndex = 21
Top = 360
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 360
TabIndex = 20
Top = 360
Width = 1095
End
End
Begin VB.Frame Frame1
Caption = "客房标准"
Height = 3135
Left = 0
TabIndex = 0
Top = 0
Width = 6855
Begin VB.TextBox Text2
Height = 300
Left = 1200
TabIndex = 28
Top = 2640
Width = 2000
End
Begin VB.ComboBox Combo6
Height = 300
Left = 4560
TabIndex = 26
Top = 2160
Width = 2000
End
Begin VB.ComboBox Combo5
Height = 300
Left = 1200
TabIndex = 24
Top = 720
Width = 2055
End
Begin VB.ComboBox Combo4
Height = 300
Left = 4560
TabIndex = 18
Top = 1680
Width = 2000
End
Begin VB.ComboBox Combo3
Height = 300
Left = 4560
TabIndex = 16
Top = 1200
Width = 2000
End
Begin VB.ComboBox Combo2
Height = 300
Left = 4560
TabIndex = 14
Top = 720
Width = 2000
End
Begin VB.ComboBox Combo1
Height = 300
Left = 4560
TabIndex = 12
Top = 240
Width = 2000
End
Begin VB.TextBox Text5
Height = 300
Left = 1200
TabIndex = 9
Top = 2160
Width = 1755
End
Begin VB.TextBox Text4
Height = 300
Left = 1200
TabIndex = 7
Top = 1680
Width = 2000
End
Begin VB.TextBox Text3
Height = 300
Left = 1200
TabIndex = 5
Top = 1200
Width = 2000
End
Begin VB.TextBox Text1
Height = 300
Left = 1200
TabIndex = 2
Top = 240
Width = 2000
End
Begin VB.Label Label12
Caption = "剩余床位:"
Height = 255
Left = 240
TabIndex = 27
Top = 2640
Width = 855
End
Begin VB.Label Label11
Caption = "性别:"
Height = 255
Left = 3840
TabIndex = 25
Top = 2160
Width = 495
End
Begin VB.Label Label10
Caption = "是否有卫生间:"
Height = 255
Left = 3360
TabIndex = 17
Top = 1680
Width = 1215
End
Begin VB.Label Label9
Caption = "是否有电视:"
Height = 255
Left = 3480
TabIndex = 15
Top = 1200
Width = 1095
End
Begin VB.Label Label8
Caption = "是否有电话:"
Height = 255
Left = 3480
TabIndex = 13
Top = 720
Width = 1095
End
Begin VB.Label Label7
Caption = "是否有空调:"
Height = 255
Left = 3480
TabIndex = 11
Top = 240
Width = 1455
End
Begin VB.Label Label6
Caption = "/每天"
Height = 255
Left = 3000
TabIndex = 10
Top = 2160
Width = 615
End
Begin VB.Label Label5
Caption = "住房单价:"
Height = 255
Left = 240
TabIndex = 8
Top = 2160
Width = 855
End
Begin VB.Label Label4
Caption = "床位数量:"
Height = 255
Left = 240
TabIndex = 6
Top = 1680
Width = 855
End
Begin VB.Label Label3
Caption = "房间面积:"
Height = 255
Left = 240
TabIndex = 4
Top = 1200
Width = 855
End
Begin VB.Label Label2
Caption = "标准名称:"
Height = 255
Left = 240
TabIndex = 3
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "客房号码:"
Height = 255
Left = 240
TabIndex = 1
Top = 240
Width = 855
End
End
End
Attribute VB_Name = "kefangchakan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() 'OK
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path & "\客房情况.mdb")
Set rs = db.OpenRecordset("客房情况")
While (rs.EOF = False) 'EOF=End Of File
If Text1.Text = "" Then
MsgBox "客房号码不能为空!"
Exit Sub
End If
If rs.Fields(1) = Text1.Text Then
MsgBox "房间号码重复!", vbOKOnly + vbExclamation, "警告!"
Exit Sub
Else
rs.MoveNext
End If
If Combo5.Text = "" Then
MsgBox "客房类型不能空!"
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "房间面积不能空!"
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "床位数不能空!"
Exit Sub
End If
If Text5.Text = "" Then
MsgBox "单价不能空!"
Exit Sub
End If
If Combo4.Text = "" Then
MsgBox "是否有卫生间不能空!"
Exit Sub
End If
If Combo3.Text = "" Then
MsgBox "是否有电视不能空!"
Exit Sub
End If
If Combo2.Text = "" Then
MsgBox "是否有电话不能空!"
Exit Sub
End If
If Combo1.Text = "" Then
MsgBox "是否有空调不能空!"
Exit Sub
End If
If Combo6.Text = "" Then
MsgBox "性别不能空!"
Exit Sub
End If
Wend
rs.AddNew
rs.Fields(0) = Combo5.Text
rs.Fields(1) = Text1.Text
rs.Fields(2) = Combo6.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text2.Text
rs.Fields(5) = Text3.Text
rs.Fields(6) = Combo1.Text
rs.Fields(7) = Combo2.Text
rs.Fields(8) = Combo3.Text
rs.Fields(9) = Combo4.Text
rs.Fields(10) = Text5.Text
rs.Update
MsgBox "添加成功!", vbOKOnly + vbExclamation, "添加客房!"
rs.Close
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
Combo6.Text = ""
End Sub
Private Sub Command2_Click() 'ok
Dim db As Database
Dim rs As Recordset
Dim a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, X, Y, z As String * 50
On Error Resume Next
Set db = OpenDatabase(App.Path & "\客房情况")
Set rs = db.OpenRecordset("客房情况")
If Text1.Text = "" Then
MsgBox "请输入要查找的房间号码!"
Exit Sub
End If
Set rs = db.OpenRecordset("select 客房号码 set 客房情况 where 客房号码='" & Text1.Text & "'")
If rs.EOF = True Then 'EOF=End Of File
MsgBox "房间信息错误,请检验房间号码是否正确!"
Exit Sub
Else
If Text3.Text <> "" Then
b = "update 客房情况 set 面积='" & Text3.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute b
If Text4.Text <> "" Then
c = "update 客房情况 set 床位数='" & Text4.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute c
If Text5.Text <> "" Then
d = "update 客房情况 set 单价='" & Text5.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute d
If Combo1.Text <> "" Then
e = "update 客房情况 set 是否有空调='" & Combo1.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute e
If Combo2.Text <> "" Then
f = "update 客房情况 set 是否有电话='" & Combo2.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute f
If Combo3.Text <> "" Then
g = "update 客房情况 set 是否有电视='" & Combo3.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute g
If Combo4.Text <> "" Then
h = "update 客房情况 set 是否有卫生间='" & Combo4.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute h
If Combo5.Text <> "" Then
i = "update 客房情况 set 客房类型='" & Combo5.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute i
If Combo6.Text <> "" Then
j = "update 客房情况 set 性别='" & Combo6.Text & "'where 客房号码='" & Text1.Text & "'"
db.Execute j
MsgBox "修改成功!!剩余床位不能改!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
Combo6.Text = ""
rs.Close
Else
MsgBox "此屋的住房人性别没选!"
End If
Else
MsgBox "房间类型没选!"
End If
Else
MsgBox "是否有卫生间没选!"
End If
Else
MsgBox "是否有电视没选!"
End If
Else
MsgBox "是否有电话没选!"
End If
Else
MsgBox "是否有空调没选!"
End If
Else
MsgBox "住房单价/每天没写!"
End If
Else
MsgBox "床位数没写!"
End If
Else
MsgBox "房间面积没写!"
End If
End If
End Sub
Private Sub Command3_Click()
shanchu.Show
End Sub
Private Sub Command4_Click() 'ok
kefangchakan.Hide
caidan.Show
End Sub
Private Sub Form_Load() 'ok
Combo1.AddItem "无"
Combo1.AddItem "有"
Combo2.AddItem "无"
Combo2.AddItem "有"
Combo3.AddItem "无"
Combo3.AddItem "有"
Combo4.AddItem "无"
Combo4.AddItem "有"
Combo5.AddItem "豪华"
Combo5.AddItem "普通"
Combo5.AddItem "简单"
Combo6.AddItem "女"
Combo6.AddItem "男"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -