📄 frmcustomerorder.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmCustomerOrder
Caption = "营业单据表"
ClientHeight = 6315
ClientLeft = 60
ClientTop = 345
ClientWidth = 10395
Icon = "frmCustomerOrder.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MDIChild = -1 'True
ScaleHeight = 6315
ScaleWidth = 10395
WindowState = 2 'Maximized
Begin VB.PictureBox Picture1
Height = 540
Left = 30
ScaleHeight = 480
ScaleWidth = 11505
TabIndex = 6
Top = 2925
Width = 11565
Begin VB.CommandButton cmdPrinter
Caption = "打印(&P)"
Height = 435
Left = 8385
TabIndex = 3
Top = -15
Width = 1110
End
Begin VB.CommandButton cmdSearch
Caption = "搜索(&S)"
Height = 435
Left = 9300
TabIndex = 4
Top = -60
Width = 1110
End
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "关闭(&C)"
Height = 435
Left = 10215
TabIndex = 5
Top = 15
Width = 1110
End
Begin VB.Frame Frame1
Height = 495
Left = 75
TabIndex = 7
Top = -45
Width = 8160
Begin VB.OptionButton optStyle
Caption = "按时间归类"
Height = 240
Left = 6300
TabIndex = 2
Top = 195
Width = 1695
End
Begin VB.OptionButton optBranch
Caption = "按日期归类"
Height = 210
Left = 4695
TabIndex = 1
Top = 210
Value = -1 'True
Width = 1455
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 0
X1 = 4365
X2 = 4365
Y1 = 135
Y2 = 450
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
Index = 1
X1 = 4380
X2 = 4380
Y1 = 135
Y2 = 450
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 2
X1 = 4305
X2 = 4305
Y1 = 135
Y2 = 450
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
Index = 3
X1 = 4320
X2 = 4320
Y1 = 135
Y2 = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请 选 择 您 所 喜 欢 的 归 类 方 法"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 210
Left = 270
TabIndex = 8
Top = 195
Width = 3675
End
End
End
Begin MSFlexGridLib.MSFlexGrid Grid1
Height = 2430
Left = 0
TabIndex = 0
Top = 0
Width = 3885
_ExtentX = 6853
_ExtentY = 4286
_Version = 393216
Rows = 3
RowHeightMin = 50
BackColorSel = 14737632
ForeColorSel = 12582912
BackColorBkg = 12632256
WordWrap = -1 'True
AllowBigSelection= 0 'False
FocusRect = 0
SelectionMode = 1
AllowUserResizing= 1
End
Begin VB.Menu MnuStoreDisplay
Caption = "事务(&T)"
Begin VB.Menu mnuDetail
Caption = "显示单据详细信息(&D)"
Shortcut = {F9}
End
Begin VB.Menu Line01
Caption = "-"
End
Begin VB.Menu MnuStoreSearch
Caption = "搜索(&S) ..."
Shortcut = ^F
End
Begin VB.Menu MnuStorePrint
Caption = "打印(&P) ..."
Shortcut = ^P
End
Begin VB.Menu Line02
Caption = "-"
End
Begin VB.Menu MnuStoreNameSort
Caption = "按日期归类"
Checked = -1 'True
End
Begin VB.Menu MnuProductNameSort
Caption = "按时间归类"
Checked = -1 'True
End
Begin VB.Menu Line04
Caption = "-"
End
Begin VB.Menu MnuDisplayAllStore
Caption = "显示所有营业单据(&A) ..."
Shortcut = ^A
End
Begin VB.Menu Line03
Caption = "-"
End
Begin VB.Menu MnuDisplayStoreMerge
Caption = "合并归类的相同列(&M)"
Checked = -1 'True
Shortcut = ^M
End
End
Begin VB.Menu MnuReturn
Caption = "返回首页(&R)"
End
End
Attribute VB_Name = "frmCustomerOrder"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdPrinter_Click()
Me.MousePointer = 11
frmOrderPrint.Show 1
Me.MousePointer = 0
End Sub
Private Sub cmdSearch_Click()
Screen.MousePointer = 11
Load frmMainSearchOrder
Screen.MousePointer = 0
frmMainSearchOrder.Show 1
'继续工作
Call QuerySell(optBranch.Value, optStyle.Value, MnuDisplayStoreMerge.Checked)
End Sub
Private Sub Form_Load()
Screen.MousePointer = 11
'排列表格
Dim Ltp As Boolean
Ltp = GetSetting(App.EXEName, "MainOption", "库存合并归类的列", False)
If Ltp = False Then
MnuDisplayStoreMerge.Checked = False
Else
MnuDisplayStoreMerge.Checked = True
End If
MnuStoreNameSort.Checked = True
MnuProductNameSort.Checked = False
DCondStr = ""
SCondStr = ""
QueryStr = "Select * From SellCount"
Call QuerySell(True, False, MnuDisplayStoreMerge.Checked)
Screen.MousePointer = 0
End Sub
Private Sub Form_Resize()
Dim sngButtonTop As Single
Dim sngScaleWidth As Single
Dim sngScaleHeight As Single
'On Error GoTo Form_Resize_Error
With Me
sngScaleWidth = .ScaleWidth
sngScaleHeight = .ScaleHeight
' 移动“关闭”按钮到右下角
With .Picture1
sngButtonTop = sngScaleHeight - (.Height + MARGIN_SIZE)
.Move MARGIN_SIZE, sngButtonTop, sngScaleWidth - (2 * MARGIN_SIZE), .Height
End With
With .cmdClose
.Move Picture1.ScaleWidth - 10 - .Width, 30
End With
With .cmdSearch
.Move Me.cmdClose.Left - .Width - 20, 30
End With
With .cmdPrinter
.Move Me.cmdSearch.Left - .Width - 20, 30
End With
.Grid1.Move MARGIN_SIZE, _
MARGIN_SIZE, _
sngScaleWidth - (2 * MARGIN_SIZE), _
sngButtonTop - (2 * MARGIN_SIZE)
End With
Exit Sub
Form_Resize_Error:
' 避免负值错误
Resume Next
End Sub
Private Sub QuerySell(CBranch As Boolean, CStyle As Boolean, CMerge As Boolean)
Me.MousePointer = 11
Dim DB As Database, EF As Recordset, HH As Integer
Dim MargeRowBN As String, x As Integer, tmpBNX As String, ZF As String
Dim MargeRow As String, tmpBN As String
'配置网格
Dim StoreQueryString As String
Select Case SCondStr
Case ""
StoreQueryString = QueryStr
Case Is <> ""
StoreQueryString = QueryStr + " Where " & SCondStr
End Select
If CBranch = True Then
StoreQueryString = StoreQueryString + " Order by 时间"
Else
StoreQueryString = StoreQueryString + " Order by 日期"
End If
Grid1.Visible = False
Grid1.Clear
Grid1.Cols = 10
Grid1.FormatString = "^ .. |^ 消费日期 |^ 时 间 |^ 座 位 |^ 卡 号 |^ 实付金额 |^ 消费总额 |^ 付款方式 |^ 上台时间 |^ 下台时间"
Grid1.ColWidth(0) = 800
Grid1.ColWidth(1) = 1200
Grid1.ColWidth(2) = 600
Grid1.ColWidth(3) = 860
Grid1.ColWidth(4) = 1700
Grid1.ColWidth(5) = 1400
Grid1.ColWidth(6) = 1400
Grid1.ColWidth(7) = 1200
Grid1.ColWidth(8) = 1200
Grid1.ColWidth(9) = 1200
'On Error Resume Next
Set DB = OpenDatabase(ConData, False, False, Constr)
Set EF = DB.OpenRecordset("SellCount", dbOpenTable)
'增加一个合计
Grid1.Rows = EF.RecordCount + 3
If Grid1.Rows < 29 Then
Grid1.Rows = 29
End If
Set EF = DB.OpenRecordset(StoreQueryString, dbOpenDynaset)
HH = 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -