📄 main_qtgl_mdgl_md.frm
字号:
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column10
DataField = "服务员编号"
Caption = "服务员编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column11
DataField = "服务员姓名"
Caption = "服务员姓名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column12
DataField = "状态"
Caption = "状态"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column13
DataField = "单据号"
Caption = "单据号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column14
DataField = "是否结帐"
Caption = "是否结帐"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column15
DataField = "备注"
Caption = "备注"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 14.74
EndProperty
BeginProperty Column01
ColumnWidth = 14.74
EndProperty
BeginProperty Column02
ColumnWidth = 1005.165
EndProperty
BeginProperty Column03
ColumnWidth = 2085.166
EndProperty
BeginProperty Column04
ColumnWidth = 824.882
EndProperty
BeginProperty Column05
ColumnWidth = 884.976
EndProperty
BeginProperty Column06
ColumnWidth = 824.882
EndProperty
BeginProperty Column07
ColumnWidth = 1094.74
EndProperty
BeginProperty Column08
ColumnWidth = 14.74
EndProperty
BeginProperty Column09
ColumnWidth = 14.74
EndProperty
BeginProperty Column10
ColumnWidth = 14.74
EndProperty
BeginProperty Column11
ColumnWidth = 14.74
EndProperty
BeginProperty Column12
ColumnWidth = 764.787
EndProperty
BeginProperty Column13
ColumnWidth = 14.74
EndProperty
BeginProperty Column14
ColumnWidth = 14.74
EndProperty
BeginProperty Column15
ColumnWidth = 14.74
EndProperty
EndProperty
End
End
Begin VB.Frame Frame3
Height = 660
Left = 8145
TabIndex = 1
Top = 2460
Width = 2790
Begin VB.Label Labyfje
BackStyle = 0 'Transparent
Height = 210
Left = 1170
TabIndex = 46
Top = 285
Width = 1620
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "应付金额:"
ForeColor = &H00000000&
Height = 195
Index = 6
Left = 165
TabIndex = 39
Top = 285
Width = 945
End
End
Begin VB.Frame Frame4
Height = 1290
Left = 8145
TabIndex = 2
Top = 3090
Width = 2790
Begin VB.CommandButton Comagio
Caption = "打折结账"
Height = 375
Left = 150
TabIndex = 5
Top = 765
Width = 2430
End
Begin VB.CommandButton Comnoagio
Caption = "不打折结账"
Height = 375
Left = 150
TabIndex = 4
Top = 240
Width = 2430
End
End
Begin VB.Frame Frame5
Height = 660
Left = 8145
TabIndex = 3
Top = 4260
Width = 2790
Begin VB.CommandButton Comend
Caption = "退出结账管理"
Height = 375
Left = 165
TabIndex = 6
Top = 180
Width = 2430
End
End
End
Attribute VB_Name = "main_qtgl_mdgl_md"
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 i As Integer '定义整型变量
Dim mystr, SQL1, SQL2, SQL3, SQL4 As String '定义字符串变量
Public Sub JZ() '定义结账函数
newcnn.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=CYGLXT"
SQL1 = "update 点单临时表 set 结账日期='" + Trim(rq.text) + "',是否结账='是' where 单据号='" + Trim(labdjh.Caption) + "'"
newcnn.Execute SQL1
SQL2 = "insert 日点单信息表(房台编号,房台类别,商品编号,商品名称,单位,数量,单价,金额,点单日期,结账日期,服务员编号,服务员姓名,状态,单据号,是否结账,备注) select 房台编号,房台类别,商品编号,商品名称,单位,数量,单价,金额,点单日期,结账日期,服务员编号,服务员姓名,状态,单据号,是否结账,备注 from 点单临时表 where 单据号='" + Trim(labdjh.Caption) + "'"
newcnn.Execute SQL2
SQL3 = "delete 点单临时表 where 是否结账='是'and 单据号='" + Trim(labdjh.Caption) + "'"
newcnn.Execute SQL3 'Connection 对象的 Execute 方法,执行指定的查询、SQL 语句、存储过程或特定提供者的文本等内容。'详细说明或实例参见《Visual Basic编程词典》基础知识部分,该部分有详细说明。
'吉林省明日科技有限公司愿为您提供最实用、最全面、最完整和最方便的编程技术和开发资源,同时为您提供最周到的技术支持和服务。
'技术支持及升级请访问www.cccxy.com www.mingrisoft.com 价值无限,服务无限
SQL4 = "update 房间台号信息表 set 状态='空闲' where 编号='" + Label4(0).Caption + "'"
newcnn.Execute SQL4
newcnn.Close '关闭连接
End Sub
Private Sub Form_Activate()
For i = 1 To 9
List1.AddItem (i) & "折"
Next i
rq.text = Now '设置时间
For i = 0 To 6
Label4(i).Caption = main_qtgl_mdgl.Label4(i).Caption '赋值给label4(i).caption
Next i
Sql = "select * from 点单临时表 where 房台编号='" + Trim(Label4(0).Caption) + "'"
Call FunAdo(Adodc1, Sql)
Adodc1.Refresh '查询点单信息
If Adodc1.Recordset.RecordCount > 0 Then
Labbh.Caption = Trim(Adodc1.Recordset.Fields("服务员编号"))
Labxm.Caption = Trim(Adodc1.Recordset.Fields("服务员姓名"))
labdjh.Caption = Trim(Adodc1.Recordset.Fields("单据号"))
labrq.Caption = Trim(Adodc1.Recordset.Fields("点单日期"))
sqlStr = "select 状态 as 状态1,sum(数量)as 数量1,sum(金额)as 金额合计 from 点单临时表 where 点单临时表.房台编号='" + Trim(Label4(0).Caption) + "'group by 状态"
Call FunAdo(Adodc2, sqlStr)
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 1 Then
Label2(0).Caption = Adodc2.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
If Adodc2.Recordset.EOF = False Then Adodc2.Recordset.MoveNext
Label2(2).Caption = Adodc2.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
Else
If Trim(Adodc2.Recordset.Fields("状态1")) = "点单" Then
Label2(0).Caption = Adodc2.Recordset.Fields(1)
Label2(1).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
Label2(2).Caption = "0"
Label2(3).Caption = "0.00"
Else
Label2(0).Caption = "0"
Label2(1).Caption = "0.00"
Label2(2).Caption = Adodc2.Recordset.Fields(1)
Label2(3).Caption = Format(Adodc2.Recordset.Fields(2), "0.00")
End If
End If
Label2(4).Caption = Val(Label2(0).Caption) + Val(Label2(2).Caption)
Label2(5).Caption = Format(Val(Label2(1).Caption) + Val(Label2(3).Caption), "0.00")
Labyfje.Caption = Format(Val(Label4(4).Caption) + Val(Label2(1).Caption), "0.00")
Else
MsgBox ("对不起,此客人未消费,请重新选择!")
main_qtgl_mdgl.Enabled = True
Unload Me
End If
Me.Caption = Me.Caption & " " & frm_main.St1.Panels(3).text
End Sub
Private Sub Comok_Click() '打折结账
If Frame10.Visible = True Then
mystr = MsgBox("确认打折结账吗?", vbYesNo)
If mystr = vbYes Then
rs1.Open "select * from 日结账表 order by 结账单据号", cnn, adOpenKeyset, adLockOptimistic
rs1.AddNew
rs1.Fields("结账单据号") = labdjh.Caption
rs1.Fields("房台编号") = Label4(0).Caption
rs1.Fields("日期") = Now
rs1.Fields("结款金额") = Val(Labyfje.Caption) * (Left(List1.text, 1) / 10)
rs1.Fields("结款人") = Trim(Labxm.Caption)
rs1.Fields("结款方式") = "现金"
rs1.Fields("结款说明") = "打[" & List1.text & "]现金结款"
rs1.Update
rs1.Close
Call JZ '调用函数
MsgBox "您的结账金额为" & Format(Val(Labyfje.Caption) * (Left(List1.text, 1) / 10), "0.00") & "元人民币"
MsgBox ("结账完毕!")
Call main_qtgl_mdgl.list_change '调用函数
main_qtgl_mdgl.Enabled = True
Unload Me
End If
End If
End Sub
Private Sub Comnoagio_Click() '不打折结账
If Frame10.Visible = False Then
mystr = MsgBox("确认不打折结账吗?", vbYesNo)
If mystr = vbYes Then
rs1.Open "select * from 日结账表 order by 结账单据号", cnn, adOpenKeyset, adLockOptimistic
rs1.AddNew
rs1.Fields("结账单据号") = labdjh.Caption
rs1.Fields("房台编号") = Label4(0).Caption
rs1.Fields("日期") = Now
rs1.Fields("结款金额") = Val(Labyfje.Caption)
rs1.Fields("结款人") = Trim(Labxm.Caption)
rs1.Fields("结款方式") = "现金"
rs1.Fields("结款说明") = "现金结款" & Val(Labyfje.Caption) & "元"
rs1.Update
rs1.Close
Call JZ '调用函数
MsgBox ("结账完毕!")
Call main_qtgl_mdgl.list_change '调用函数
main_qtgl_mdgl.Enabled = True
Unload Me
End If
End If
End Sub
Private Sub Comagio_Click() '打折结账
Frame10.Visible = True
End Sub
Private Sub Comcancel_Click() '取消
Frame10.Visible = False
End Sub
Private Sub comend_Click()
main_qtgl_mdgl.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
Private Sub Form_Unload(Cancel As Integer)
main_qtgl_mdgl.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -