📄 frmdd.frm
字号:
ImageList = "ImageList1"
Appearance = 1
End
Begin MSComctlLib.ImageList ImageList1
Left = 360
Top = 720
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 16777215
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmDD.frx":046C
Key = ""
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 1680
Top = 960
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
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 VB.CommandButton Command2
Caption = "刷新"
Height = 375
Left = 6600
TabIndex = 9
Top = 960
Width = 975
End
Begin VB.CommandButton Command1
Caption = "出单"
Height = 375
Left = 6600
TabIndex = 8
Top = 360
Width = 975
End
Begin MSDataGridLib.DataGrid DataGrid2
Bindings = "FrmDD.frx":10BE
Height = 2175
Left = 3000
TabIndex = 7
Top = 240
Width = 3255
_ExtentX = 5741
_ExtentY = 3836
_Version = 393216
BackColor = 12640511
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
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 Column01
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
ScrollBars = 2
BeginProperty Column00
ColumnWidth = 1395.213
EndProperty
BeginProperty Column01
ColumnWidth = 1005.165
EndProperty
EndProperty
End
End
Begin VB.Label Label18
Caption = "可用鼠标右键弹出菜单编辑上面的表列,或是直接选定表项后按'Del'键执行删除!"
ForeColor = &H000040C0&
Height = 255
Left = 4680
TabIndex = 64
Top = 6045
Width = 7815
End
Begin VB.Image Image1
Height = 300
Left = 1920
Picture = "FrmDD.frx":10D3
Top = 6000
Width = 300
End
Begin VB.Menu edit
Caption = "edit"
Visible = 0 'False
WindowList = -1 'True
Begin VB.Menu 删除
Caption = "删除"
End
End
Begin VB.Menu 返回
Caption = "返回主界面"
End
End
Attribute VB_Name = "FrmDD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public zh As String
Public paihao As String
Public fwy As String
Public sqll As String
Private Sub listV(listN As String)
On Error Resume Next
If listN = 1 Then
Adodc1.RecordSource = "select distinct 牌号 from 点单 " & sqll
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
paihao = Adodc1.Recordset.Fields("牌号")
If Left(paihao, 1) = "1" Then
List2.AddItem "包厢号 |" & paihao
ElseIf Left(paihao, 1) = "0" Then
List2.AddItem "桌 号 |" & paihao
End If
Adodc1.Recordset.MoveNext
Next
Adodc3.RecordSource = "select * from 点单 " & sqll
Adodc3.Refresh
Label1.Caption = "客户名称: " & List1.Text
Adodc1.RecordSource = "select * from 点单 " & sqll
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
Label3.Caption = "入店时间: " & Adodc1.Recordset.Fields("消费开始日期") & " " & Adodc1.Recordset.Fields("消费开始时间")
Label4.Caption = "付款方式: " & Adodc1.Recordset.Fields("付款方式")
End If
ElseIf listN = 2 Then
Adodc3.RecordSource = "select * from 点单 " & sqll
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
fwy = Adodc3.Recordset.Fields("服务员")
Label1.Caption = "客户名称: " & List2.Text
Label3.Caption = "入店时间: " & Adodc3.Recordset.Fields("消费开始日期") & " " & Adodc3.Recordset.Fields("消费开始时间")
Label4.Caption = "付款方式: " & Adodc3.Recordset.Fields("付款方式")
Else
End If
End If
'公共执行部分
Adodc1.RecordSource = "select sum(总价) as 消费总额 from 点单 " & sqll
Adodc1.Refresh
Label6.Caption = Adodc1.Recordset.Fields("消费总额")
Adodc1.RecordSource = "select sum(预付押金) as 预付总额 from 点单 " & sqll
Adodc1.Refresh
Label17.Caption = Adodc1.Recordset.Fields("预付总额")
Text4.Text = Label6.Caption
Text6.Text = Label17.Caption
Text2.Text = Label1.Caption
Text9.Text = Label6.Caption
Text10.Text = Label3.Caption
Text17.Text = 0
Text18.Text = 0
Text19.Text = Text9.Text
End Sub
Private Sub Combo1_Click()
Text12.Text = 0
Text13.Text = 0
Select Case Combo1.Text
Case "附加费率"
Text12.Locked = False
Text13.Locked = True
Text12.SetFocus
Case "指定金额"
Text13.Locked = False
Text12.Locked = True
Text13.SetFocus
Case Else
End Select
End Sub
Private Sub Combo2_Click()
Text14.Text = 0
Text15.Text = 0
Select Case Combo2.Text
Case "折扣率"
Text14.Locked = False
Text15.Locked = True
Text14.SetFocus
Case "指定金额"
Text15.Locked = False
Text14.Locked = True
Text15.SetFocus
Case Else
End Select
End Sub
Private Sub Combo3_Click()
Text16.Locked = True
Select Case Combo3.Text
Case "5元优惠券"
Text16.Text = 5
Text18.Text = Val(Text15.Text) + Val(Text16.Text)
Text19.Text = Val(Text9.Text) + Val(Text17.Text) - Val(Text18.Text)
Case "10元优惠券"
Text16.Text = 10
Text18.Text = Val(Text15.Text) + Val(Text16.Text)
Text19.Text = Val(Text9.Text) + Val(Text17.Text) - Val(Text18.Text)
Case "指定金额"
Text16.Locked = False
Text16.Text = 0
Case Else
End Select
End Sub
Private Sub Command1_Click()
Me.Caption = "结帐"
Frame4.Visible = True
Frame3.Visible = False
Text8.SetFocus
Text8.SelStart = 0
Text8.SelLength = 1
'Command2_Click
End Sub
Private Sub Command10_Click()
On Error Resume Next
Dim fl As String
Dim zhuohao As String
Dim BZ As String
zhuohao = ""
Set Adodc1.Recordset = Adodc3.Recordset
For i = 1 To Adodc1.Recordset.RecordCount
zhuohao = zhuohao & Adodc1.Recordset.Fields("牌号") & "."
Adodc1.Recordset.MoveNext
Next
Me.Caption = "结帐"
If paihao <> "" Then
If Left(paihao, 1) = 1 Then fl = "包厢号"
If Left(paihao, 1) = 0 Then fl = "桌号"
End If
Adodc3.Recordset.MoveFirst
For i = 1 To Adodc3.Recordset.RecordCount
If Adodc3.Recordset.EOF <> True Then
'设回包厢状态
Adodc1.RecordSource = "select * from " & fl & " where " & fl & " ='" & paihao & "'"
Adodc1.Refresh
If Option2.Value = True Then
Adodc1.Recordset.Fields("状态") = "空"
ElseIf Option1.Value = True Then
Adodc1.Recordset.Fields("状态") = "清洁"
End If
'判断在些帐单里的'服务员'是否还为其它包厢服务,如果再没有服务包厢,则设置其状态为'空闲'
Adodc1.RecordSource = "select * from 服务员 where 编号='" & Adodc3.Recordset.Fields("服务员") & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Fields("状态") = "空闲"
Adodc1.Recordset.Update
End If
'把此数据写入'已结帐单'里
Adodc1.RecordSource = "select * from 已结帐单"
Adodc1.Refresh
With Adodc1.Recordset
.AddNew
.Fields("牌号") = paihao
.Fields("项目") = Adodc3.Recordset.Fields("项目")
.Fields("数量") = Adodc3.Recordset.Fields("数量")
.Fields("单价") = Adodc3.Recordset.Fields("单价")
.Fields("总价") = Adodc3.Recordset.Fields("总价")
.Fields("付款方式") = Adodc3.Recordset.Fields("付款方式")
.Fields("消费开始日期") = Adodc3.Recordset.Fields("消费开始日期")
.Fields("消费开始时间") = Adodc3.Recordset.Fields("消费开始时间")
.Fields("消费结束日期") = Date
.Fields("消费结束时间") = Format(Time, "hh:ss:mm")
.Fields("帐单号") = Adodc3.Recordset.Fields("帐单号")
.Fields("服务员结帐") = "否"
.Fields("服务员") = Adodc3.Recordset.Fields("服务员")
.Fields("姓名") = Text3.Text
.Fields("卡号") = Text5.Text
.Update
End With
Adodc3.Recordset.MoveNext
Else
End If
Next
'是否需要打印票据
If MsgBox("是否需要打印票据?", vbYesNo, "提示") = vbYes Then
BZ = InputBox("请输入一些备注内容:", "备注说明")
Load printJZD
With printJZD
.Label11.Caption = zh
.Label12.Caption = Label4.Caption
.Label13.Caption = Label3.Caption
.Label14.Caption = Date & " " & Time
.Label15.Caption = Label6.Caption
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -