📄 fangtai.frm
字号:
Index = 11
Left = 960
Picture = "fangtai.frx":248B2
Style = 1 'Graphical
TabIndex = 19
Top = 1080
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":252F4
Height = 735
Index = 10
Left = 240
Picture = "fangtai.frx":25D36
Style = 1 'Graphical
TabIndex = 18
Top = 1080
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":26778
Height = 735
Index = 9
Left = 6720
Picture = "fangtai.frx":271BA
Style = 1 'Graphical
TabIndex = 17
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":27BFC
Height = 735
Index = 8
Left = 6000
Picture = "fangtai.frx":2863E
Style = 1 'Graphical
TabIndex = 16
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":29080
Height = 735
Index = 7
Left = 5280
Picture = "fangtai.frx":29AC2
Style = 1 'Graphical
TabIndex = 15
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":2A504
Height = 735
Index = 6
Left = 4560
Picture = "fangtai.frx":2AF46
Style = 1 'Graphical
TabIndex = 14
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":2B988
Height = 735
Index = 5
Left = 3840
Picture = "fangtai.frx":2C3CA
Style = 1 'Graphical
TabIndex = 13
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":2CE0C
Height = 735
Index = 4
Left = 3120
Picture = "fangtai.frx":2D84E
Style = 1 'Graphical
TabIndex = 12
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":2E290
Height = 735
Index = 3
Left = 2400
Picture = "fangtai.frx":2ECD2
Style = 1 'Graphical
TabIndex = 11
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":2F714
Height = 735
Index = 2
Left = 1680
Picture = "fangtai.frx":30156
Style = 1 'Graphical
TabIndex = 10
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":30B98
Height = 735
Index = 1
Left = 960
Picture = "fangtai.frx":315DA
Style = 1 'Graphical
TabIndex = 9
Top = 120
Visible = 0 'False
Width = 495
End
Begin VB.CommandButton Command4
BackColor = &H00FFFFFF&
DisabledPicture = "fangtai.frx":3201C
Height = 735
Index = 0
Left = 240
Picture = "fangtai.frx":32A5E
Style = 1 'Graphical
TabIndex = 8
Top = 120
Visible = 0 'False
Width = 495
End
End
Begin VB.Frame Frame3
Height = 615
Left = 6840
TabIndex = 5
Top = 120
Width = 855
Begin VB.CommandButton Command1
Height = 375
Left = 240
Picture = "fangtai.frx":334A0
Style = 1 'Graphical
TabIndex = 6
Top = 170
Width = 375
End
End
Begin VB.Frame Frame2
Height = 615
Left = 3120
TabIndex = 4
Top = 120
Width = 3615
End
Begin VB.Frame Frame1
Height = 615
Left = 120
TabIndex = 1
Top = 120
Width = 2895
Begin VB.ComboBox Combo1
Height = 300
Left = 1080
TabIndex = 3
Text = "Combo1"
Top = 200
Width = 1575
End
Begin VB.Label Label1
Caption = "房间类型:"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Width = 855
End
End
End
Begin VB.Menu mnu_showit
Caption = "显示房间信息"
Visible = 0 'False
Begin VB.Menu mnu_info
Caption = "共有床"
End
End
End
Attribute VB_Name = "fangtai"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public m_kind As String
Public m_name As String
'加载房间信息
Private Sub LoadHouse()
Dim m As Integer '循环变量
For m = 0 To 39
Command4(m).Visible = False
Command4(m).Caption = ""
Command4(m).Picture = LoadPicture()
Next
Dim str As String
If m_kind = "全部" Then
str = "select * from house order by nam"
Else
str = "select * from house where kind='" & m_kind & "' order by nam"
End If
Dim myrs As ADODB.Recordset
Set myrs = New ADODB.Recordset
myrs.CursorLocation = adUseClient
myrs.LockType = adLockOptimistic
myrs.CursorType = adOpenDynamic
myrs.Open str, myCon
Dim sum As Integer '对应房间总数
sum = myrs.RecordCount
Dim n As Integer '循环变量
Dim m_xingbie As String '保存性别
Dim m_man As String
Dim m_xiu As String
Dim m_sao As String
Dim m_ding As String
For n = 0 To sum - 1 Step 1
m_xingbie = myrs("xingbie")
m_man = myrs("man")
m_xiu = myrs("weixiu")
m_sao = myrs("qingsao")
m_ding = myrs("ding")
If m_ding = 1 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\ding.bmp")
ElseIf m_xiu = 1 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\weixiu.bmp")
ElseIf m_sao = 1 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\qingsao.bmp")
ElseIf m_man = 1 And m_xingbie = 0 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\nanman.bmp")
ElseIf m_man = 1 And m_xingbie = 1 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\nvman.bmp")
ElseIf m_man = 2 And m_xingbie = 0 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\nanweiman.bmp")
ElseIf m_man = 2 And m_xingbie = 1 Then
Command4(n).Picture = LoadPicture(App.Path + "\bmp\nvweiman.bmp")
Else
Command4(n).Picture = LoadPicture(App.Path + "\bmp\kong.bmp")
End If
Command4(n).Visible = True
Command4(n).Caption = myrs("nam")
myrs.MoveNext
Next
End Sub
'加载酒店房间类型信息
Private Sub LoadsHouseKind()
Dim str As String
str = "select * from housekind order by kind"
Dim myrs As ADODB.Recordset
Set myrs = New ADODB.Recordset
myrs.CursorLocation = adUseClient
myrs.LockType = adLockOptimistic
myrs.CursorType = adOpenDynamic
myrs.Open str, myCon
myrs.MoveFirst
Combo1.AddItem ("全部")
While Not myrs.EOF
Combo1.AddItem (myrs("kind"))
myrs.MoveNext
Wend
Combo1.ListIndex = 0
End Sub
Private Sub Combo1_Click()
m_kind = Combo1.Text
Call LoadHouse
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command4_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
m_name = Command4(Index).Caption
mnu_info.Caption = LoadChuang()
PopupMenu mnu_showit
End If
End Sub
Private Sub Form_Load()
'窗口居中
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2 - 550
Call LoadsHouseKind
Call LoadHouse
End Sub
'加载房间床位,入住人数信息
Private Function LoadChuang() As String
Dim str As String
str = "select * from house where nam='" & m_name & "'"
Dim myrs As ADODB.Recordset
Set myrs = New ADODB.Recordset
myrs.CursorLocation = adUseClient
myrs.LockType = adLockOptimistic
myrs.CursorType = adOpenDynamic
myrs.Open str, myCon
myrs.MoveFirst
Dim m_renshu As String
m_renshu = myrs("zhu")
If myrs("ding") = 1 Then
LoadChuang = "预订"
m_renshu = 0
ElseIf myrs("kong") = 0 Then
LoadChuang = "空闲"
ElseIf myrs("man") = 1 Then
LoadChuang = "已满"
Else
LoadChuang = "未满"
End If
LoadChuang = LoadChuang + " 床位 " + myrs("chuang") + " 已住人数 " + m_renshu
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -