📄 frmbxzt.frm
字号:
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComctlLib.ImageList ImageList1
Left = 3000
Top = 720
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 4
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmBXZT.frx":0D02
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmBXZT.frx":1954
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmBXZT.frx":25A6
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmBXZT.frx":31F8
Key = ""
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Height = 735
Left = 120
TabIndex = 2
Top = 7920
Width = 10095
Begin VB.ComboBox Combo9
Height = 300
Left = 2880
TabIndex = 11
Top = 360
Width = 1095
End
Begin VB.Label Label15
Height = 255
Left = 9120
TabIndex = 12
Top = 360
Width = 615
End
Begin VB.Label Label3
Height = 255
Left = 840
TabIndex = 6
Top = 360
Width = 735
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Height = 255
Left = 5280
TabIndex = 5
Top = 360
Width = 735
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Height = 255
Left = 7680
TabIndex = 3
Top = 360
Width = 735
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "包厢总数: 在用: 空余: 使用率: %"
Height = 180
Left = 4440
TabIndex = 7
Top = 360
Width = 5400
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "包厢号: 其中客人:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 180
Left = 120
TabIndex = 8
Top = 360
Width = 2625
End
Begin VB.Label Label5
Height = 255
Left = 6480
TabIndex = 4
Top = 360
Width = 615
End
End
Begin MSComctlLib.ListView ListView1
Height = 7695
Left = 120
TabIndex = 1
Top = 120
Width = 10095
_ExtentX = 17806
_ExtentY = 13573
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
Icons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Begin VB.Menu 点歌
Caption = "点歌"
Visible = 0 'False
Begin VB.Menu songList
Caption = ".点..歌."
End
End
End
Attribute VB_Name = "FrmBXZT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub TABset()
Label3.Caption = ""
Label4.Caption = ""
ListView1.ListItems.Clear
j = 0
Call XandZ
Select Case SSTab1.Caption
Case "包厢"
Adodc1.RecordSource = "select * from 包厢号"
Adodc1.Refresh
'添加列表
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
Key = Trim(Adodc1.Recordset.Fields("包厢号"))
If Adodc1.Recordset.Fields("状态") = "有客" Then ii = 1
If Adodc1.Recordset.Fields("状态") = "空" Then ii = 2
If Adodc1.Recordset.Fields("状态") = "清洁" Then ii = 3
If Adodc1.Recordset.Fields("状态") = "修理" Then ii = 4
Set itmX = ListView1.ListItems.Add(, , Key, ii)
Adodc1.Recordset.MoveNext
Loop
Label4.Caption = Adodc1.Recordset.RecordCount
Label8.Caption = Label4.Caption
Adodc1.RecordSource = "select * from 包厢号 where 状态='有客'"
Adodc1.Refresh
Label5.Caption = Adodc1.Recordset.RecordCount
Adodc1.RecordSource = "select * from 包厢号 where 状态='空'"
Adodc1.Refresh
Label6.Caption = Adodc1.Recordset.RecordCount
Label15 = Format((Label5 / Label4) * 100, "00.00")
Label16.Caption = Label6.Caption
Label17.Caption = Label5.Caption
Adodc1.RecordSource = "select * from 包厢号 where 状态='清理'"
Adodc1.Refresh
Label18.Caption = Adodc1.Recordset.RecordCount
Adodc1.RecordSource = "select * from 包厢号 where 状态='修理'"
Adodc1.Refresh
Label19.Caption = Adodc1.Recordset.RecordCount
Case "散座"
Adodc1.RecordSource = "select * from 桌号"
Adodc1.Refresh
'添加列表
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
Key = Trim(Adodc1.Recordset.Fields("桌号"))
If Adodc1.Recordset.Fields("状态") = "有客" Then ii = 1
If Adodc1.Recordset.Fields("状态") = "空" Then ii = 2
If Adodc1.Recordset.Fields("状态") = "清洁" Then ii = 3
If Adodc1.Recordset.Fields("状态") = "修理" Then ii = 4
Set itmX = ListView1.ListItems.Add(, , Key, ii)
Adodc1.Recordset.MoveNext
Loop
Label4.Caption = Adodc1.Recordset.RecordCount
Label8.Caption = Label4.Caption
Adodc1.RecordSource = "select * from 桌号 where 状态='有客'"
Adodc1.Refresh
Label5.Caption = Adodc1.Recordset.RecordCount
Adodc1.RecordSource = "select * from 桌号 where 状态='空'"
Adodc1.Refresh
Label6.Caption = Adodc1.Recordset.RecordCount
Label15 = Format((Label5 / Label4) * 100, "00.00")
Label16.Caption = Label6.Caption
Label17.Caption = Label5.Caption
Adodc1.RecordSource = "select * from 包厢号 where 状态='清理'"
Adodc1.Refresh
Label18.Caption = Adodc1.Recordset.RecordCount
Adodc1.RecordSource = "select * from 包厢号 where 状态='修理'"
Adodc1.Refresh
Label19.Caption = Adodc1.Recordset.RecordCount
End Select
'初始化控件数据
Text1.Text = ""
Label24.Caption = ""
Label25.Caption = ""
Label26.Caption = ""
Label27.Caption = ""
End Sub
Private Sub XandZ()
Combo1.Text = ""
Select Case SSTab1.Caption
Case "包厢"
Label9.Caption = "包厢号"
Label1.Caption = "包厢号: 其中客人:"
Label2.Caption = "包厢总数: 在用: 空余: 使用率: %"
Case "散座"
Label9.Caption = " 桌号"
Label1.Caption = " 桌号: 其中客人:"
Label2.Caption = " 桌总数: 在用: 空余: 使用率: %"
End Select
End Sub
Private Sub Command1_Click()
Dim sql As String
Dim strText As String
strText = Trim(Text1.Text)
If MsgBox("真的设置 {" & strText & "} 为 [" & Combo1.Text & "] 状态吗?", vbYesNo, "警告") = vbYes Then
If Left(strText, 1) = "1" Then
sql = "select * from 包厢号 where 包厢号='" & strText & "'"
ElseIf Left(strText, 1) = "0" Then
sql = "select * from 桌号 where 桌号='" & strText & "'"
End If
Adodc1.RecordSource = sql
Adodc1.Refresh
Adodc1.Recordset.Fields("状态") = Combo1.Text
Adodc1.Recordset.Update
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Call TABset
End Sub
Private Sub command4_Click()
If MsgBox("真的执行此操作吗?", vbOKCancel, "重要提示") = vbOK Then
If SSTab1.Caption = "包厢" Then
Adodc1.RecordSource = "select * from 包厢号 where 状态='清洁' or 状态='修理'"
ElseIf SSTab1.Caption = "散座" Then
Adodc1.RecordSource = "select * from 桌号 where 状态='清洁' or 状态='修理'"
End If
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
Adodc1.Recordset.Fields("状态") = "空"
Adodc1.Recordset.MoveNext
'Adodc1.Recordset.Update
Next
Else
End If
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Command5_Click()
Dim sql As String
Select Case SSTab1.Caption
Case "包厢"
sql = "select * from 包厢号 order by 包厢号"
rtpTitle = "包厢状态一览表"
Case "散座"
sql = "select * from 桌号 order by 桌号"
rtpTitle = "散桌状态一览表"
End Select
Adodc2.RecordSource = sql
Adodc2.Refresh
Set rtpRS = Adodc2.Recordset
Call rtpExcel
End Sub
Private Sub Form_Activate()
Call MDIhide
Adodc1.RecordSource = "select * from 类别设置 where 标识='FT'"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
If Adodc1.Recordset.RecordCount <> 0 Then
If Not Adodc1.Recordset.EOF Then
Combo1.AddItem Adodc1.Recordset.Fields("名称")
Adodc1.Recordset.MoveNext
End If
End If
Next
Combo1.ListIndex = 0
End Sub
Private Sub Form_Load()
Dim ii As Integer
Adodc1.ConnectionString = conn1
Adodc2.ConnectionString = conn1
Call TABset
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call MDIview
End Sub
Private Sub ListView1_DblClick()
Call 点歌_Click
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Dim countM As Integer
Dim countD As Integer
Dim countT As Integer
countM = 0
countT = 0
countD = 0
'初始数据
Label24.Caption = ""
Label25.Caption = ""
Label26.Caption = ""
Label27.Caption = ""
Combo9.Clear
On Error Resume Next
If ListView1.ListItems.Count > 0 Then
list = ListView1.SelectedItem
Label3.Caption = list
Text1.Text = list
Label24.Caption = list
'查询信息
Select Case SSTab1.Caption
Case "包厢"
Adodc1.RecordSource = "select * from 包厢号 where 包厢号='" + list + "'"
Case "散座"
Adodc1.RecordSource = "select * from 桌号 where 桌号='" + list + "'"
End Select
Adodc1.Refresh
Combo1.Text = Adodc1.Recordset.Fields("状态")
Select Case Combo1.Text
Case "有客"
Adodc1.RecordSource = "select sum(总价) as 消费总额 from 点单 where 牌号='" + list + "'"
Adodc1.Refresh
countM = Adodc1.Recordset.Fields("消费总额")
Adodc1.RecordSource = "select * from 点单 where 牌号='" + list + "'"
Adodc1.Refresh
countD = Date - Adodc1.Recordset.Fields("消费开始日期")
countT = (Time - Adodc1.Recordset.Fields("消费开始时间")) * 24
If countT < 0 Then
countD = countD - 1
countT = 24 + countT
End If
Label24.Caption = Label3.Caption
Label25.Caption = Adodc1.Recordset.Fields("消费开始日期") & " " & Adodc1.Recordset.Fields("消费开始时间")
Label26.Caption = countD & " 天 " & countT & " 小时"
Label27.Caption = countM
Combo9.AddItem Label3.Caption
Combo9.ListIndex = 0
Case "空"
Case "清洁"
Case "修理"
Case Else
End Select
End If
End Sub
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
'If Button = 2 Then PopupMenu 点歌
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Call TABset
End Sub
Private Sub 点歌_Click()
songManger.Label6.Caption = ListView1.SelectedItem.Text
songManger.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -