📄 main_qtgl_ktgl_btfw.frm
字号:
EndProperty
BeginProperty Column05
ColumnWidth = 915.024
EndProperty
BeginProperty Column06
ColumnWidth = 585.071
EndProperty
BeginProperty Column07
ColumnWidth = 884.976
EndProperty
EndProperty
End
Begin VB.CommandButton ComExit
BackColor = &H00C0C0C0&
Caption = "放弃退出(&Exit)"
Height = 360
Left = 5835
Style = 1 'Graphical
TabIndex = 19
Top = 4740
Width = 1590
End
Begin VB.CommandButton Combc
BackColor = &H00C0C0C0&
Caption = "确定(&O)"
Height = 360
Left = 5835
Style = 1 'Graphical
TabIndex = 18
Top = 1410
Width = 1590
End
Begin VB.Frame Frame2
Caption = "当前房台信息栏"
Height = 930
Left = 30
TabIndex = 0
Top = 30
Width = 7545
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "编号:"
Height = 255
Index = 0
Left = 180
TabIndex = 12
Top = 300
Width = 555
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "房台名称:"
Height = 255
Index = 1
Left = 2040
TabIndex = 11
Top = 300
Width = 930
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "类型说明:"
Height = 255
Index = 2
Left = 4695
TabIndex = 10
Top = 300
Width = 900
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "部门:"
Height = 255
Index = 3
Left = 180
TabIndex = 9
Top = 600
Width = 555
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "服务费:"
Height = 255
Index = 4
Left = 2025
TabIndex = 8
Top = 600
Width = 750
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "简要说明:"
Height = 255
Index = 6
Left = 4695
TabIndex = 7
Top = 600
Width = 930
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 0
Left = 735
TabIndex = 6
Top = 270
Width = 870
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 1
Left = 2985
TabIndex = 5
Top = 285
Width = 1485
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 2
Left = 5625
TabIndex = 4
Top = 270
Width = 1575
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 3
Left = 720
TabIndex = 3
Top = 585
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 4
Left = 2805
TabIndex = 2
Top = 585
Width = 1230
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 225
Index = 5
Left = 5625
TabIndex = 1
Top = 585
Width = 1800
End
End
Begin VB.Frame Frame1
Height = 450
Left = 30
TabIndex = 13
Top = 840
Width = 7545
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "容纳人数:"
Height = 255
Index = 7
Left = 4695
TabIndex = 17
Top = 180
Width = 915
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 225
Index = 7
Left = 5640
TabIndex = 16
Top = 165
Width = 990
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "状态:"
Height = 255
Index = 5
Left = 180
TabIndex = 15
Top = 180
Width = 555
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 225
Index = 6
Left = 720
TabIndex = 14
Top = 165
Width = 780
End
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "请选择或输入目标房台编号:"
Height = 195
Left = 315
TabIndex = 20
Top = 1500
Width = 2430
End
End
Attribute VB_Name = "main_qtgl_ktgl_btfw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim newcnn As New Connection '定义数据库连接
Dim rs1 As New ADODB.Recordset '定义数据集变量
Dim myval, SQL1 As String '定义字符串变量
Dim i As Integer '定义整型变量
Private Sub Form_Activate() '初始化房台信息
For i = 0 To 7
Label4(i).Caption = main_qtgl_ktgl.Label4(i).Caption
Next i
Sql = "select * from 房间台号信息表 where 状态='营业'and 编号<> '" + Label4(0).Caption + "'order by 编号"
Call FunAdo(Adodc1, Sql)
Adodc1.Refresh
Me.Caption = Me.Caption & " " & frm_main.St1.Panels(3).text
End Sub
Private Sub Combc_Click() '确定并台
myval = MsgBox("确认将[" & Label4(0).Caption & "]同[" & Trim(Text1.text) & "]合并吗?", vbYesNo)
If myval = vbYes Then
newcnn.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=CYGLXT"
sqlStr = "select * from 点单临时表 where 房台编号='" & Text1.text & "' and 是否结账 ='否'"
Call FunAdo(Adodc2, sqlStr)
Adodc2.Refresh
SQL1 = "update 点单临时表 set 房台编号='" + Trim(Text1.text) + "',单据号='" & _
Adodc2.Recordset.Fields("单据号").Value & "',房台类别='" & Adodc2.Recordset.Fields("房台类别").Value & "',服务员编号='" & Adodc2.Recordset.Fields("服务员编号").Value & "',服务员姓名='" & Adodc2.Recordset.Fields("服务员姓名").Value & "' where 房台编号='" + Label4(0).Caption + "'"
newcnn.Execute SQL1 'Connection 对象的 Execute 方法,执行指定的查询、SQL 语句、存储过程或特定提供者的文本等内容。
newcnn.Close '关闭连接
rs1.Open "select * from 房间台号信息表 where 编号='" + Label4(0).Caption + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount > 0 Then
rs1.Fields("状态") = "空闲"
rs1.Update
End If
rs1.Close
Unload Me
End If
Call main_qtgl_ktgl.list_change '调用函数
End Sub
Private Sub ComExit_Click()
main_qtgl_ktgl.Enabled = True
Unload Me
End Sub
Private Sub Form_Load()
Sql = "select * from 房间台号信息表"
sqlStr = "select * from 点单临时表"
Call FunAdo(Adodc1, Sql)
Call FunAdo(Adodc2, sqlStr)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -