📄 frmjzgl.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmjzgl
BorderStyle = 3 'Fixed Dialog
Caption = "结账管理"
ClientHeight = 5325
ClientLeft = 45
ClientTop = 330
ClientWidth = 8580
Icon = "frmjzgl.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5325
ScaleWidth = 8580
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "退出结帐管理"
Height = 375
Left = 5760
TabIndex = 12
Top = 4440
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "消费查询"
Height = 375
Left = 5760
TabIndex = 11
Top = 3720
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "客人结账"
Height = 375
Left = 5760
TabIndex = 10
Top = 3000
Width = 2295
End
Begin VB.Frame Frame2
Caption = "当前房间信息栏"
Height = 2295
Left = 5400
TabIndex = 3
Top = 240
Width = 3015
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "餐台号:"
Height = 180
Left = 360
TabIndex = 9
Top = 480
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "餐台名称:"
Height = 180
Left = 240
TabIndex = 8
Top = 1080
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "餐台状态:"
Height = 180
Left = 240
TabIndex = 7
Top = 1680
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Height = 180
Index = 0
Left = 1200
TabIndex = 6
Top = 480
Width = 90
End
Begin VB.Label Label5
AutoSize = -1 'True
Height = 180
Index = 1
Left = 1200
TabIndex = 5
Top = 1080
Width = 90
End
Begin VB.Label Label5
AutoSize = -1 'True
Height = 180
Index = 2
Left = 1200
TabIndex = 4
Top = 1680
Width = 90
End
End
Begin MSComctlLib.ImageList ImageList1
Left = 4440
Top = 4680
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmjzgl.frx":7D42
Key = ""
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Caption = "营业中餐台"
Height = 4935
Left = 120
TabIndex = 0
Top = 120
Width = 5055
Begin MSComctlLib.ListView ListView1
Height = 4215
Left = 120
TabIndex = 1
Top = 240
Width = 4695
_ExtentX = 8281
_ExtentY = 7435
LabelWrap = -1 'True
HideSelection = -1 'True
OLEDragMode = 1
_Version = 393217
Icons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
OLEDragMode = 1
NumItems = 0
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Label1"
Height = 180
Left = 120
TabIndex = 2
Top = 4560
Width = 540
End
End
End
Attribute VB_Name = "frmjzgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Public Sub change() '给listview添加值
If rs.State Then rs.Close
rs.Open "select * from 餐台 where 餐台状态='营业'", conn, adOpenStatic
rs.Requery
ListView1.ListItems.Clear
If Not rs.EOF And Not rs.BOF Then
ListView1.ListItems.Clear
rs.MoveFirst
Do While rs.EOF = False
Key = "(" & Trim(rs.Fields(0)) & ")" & Trim(rs.Fields(1))
Set itmx = ListView1.ListItems.Add(, , Key, 1)
rs.MoveNext
Loop
End If
Label1.Caption = "营业" & "总数: " & rs.RecordCount & "个"
End Sub
Private Sub Command1_Click()
If Label5(0).Caption <> "" Or Label5(1).Caption <> "" Then
If rs1.State Then rs1.Close
rs1.Open "select * from 登记ls where 房台号='" & cth & "'", conn, adOpenStatic
rs1.Requery
Set frmjzgl_krmd.DataGrid1.DataSource = rs1
If rs2.State Then rs2.Close
rs2.Open "select sum(金额) as je from 登记ls where 房台号='" & cth & "'", conn, adOpenStatic
rs2.Requery
Set frmjzgl_krmd.Text1.DataSource = rs2
If rs3.State Then rs3.Close
rs3.Open "select * from 餐台 where 餐台号='" & cth & "'", conn, adOpenStatic
rs.Requery
frmjzgl_krmd.Label4.Caption = Trim(rs3.Fields(0))
frmjzgl_krmd.Label5.Caption = Trim(rs3.Fields(1))
frmjzgl_krmd.Label6.Caption = Trim(rs3.Fields(2))
frmjzgl_krmd.Show 1
Else
MsgBox "请选择餐台!", vbOKOnly + 48, "提示"
End If
End Sub
Private Sub Command2_Click()
If Label5(0).Caption <> "" Or Label5(1).Caption <> "" Then
If rs1.State Then rs1.Close
rs1.Open "select * from 登记ls where 房台号='" & cth & "'", conn, adOpenStatic
rs1.Requery
Set frmjzgl_xfcx.DataGrid1.DataSource = rs1
If rs2.State Then rs2.Close
rs2.Open "select sum(金额) as je from 登记ls where 房台号='" & cth & "'", conn, adOpenStatic
rs2.Requery
Set frmjzgl_xfcx.Text1.DataSource = rs2
If rs3.State Then rs3.Close
rs3.Open "select * from 餐台 where 餐台号='" & cth & "'", conn, adOpenStatic
rs.Requery
frmjzgl_xfcx.Label4.Caption = Trim(rs3.Fields(0))
frmjzgl_xfcx.Label5.Caption = Trim(rs3.Fields(1))
frmjzgl_xfcx.Label6.Caption = Trim(rs3.Fields(2))
frmjzgl_xfcx.Show 1
Else
MsgBox "请选择餐台!", vbOKOnly + 48, "提示"
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub form_Load()
Call change
End Sub
Private Sub ListView1_Click()
If ListView1.ListItems.Count > 0 Then
List = ListView1.SelectedItem
If rs.State Then rs.Close
rs.Open "select * from 餐台 where 餐台号='" + Right(Left(List, 4), 3) + "'", conn
rs.Requery
cth = Right(Left(List, 4), 3)
If Not rs.EOF And Not rs.BOF Then
For a = 0 To 2
Label5(a).Caption = Trim(rs.Fields(a)) '赋值给label5(a).caption
Next a
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -