📄 frmaddexpand.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmAddExpand
BorderStyle = 1 'Fixed Single
Caption = "添加外卖信息"
ClientHeight = 5850
ClientLeft = 45
ClientTop = 330
ClientWidth = 7365
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5850
ScaleWidth = 7365
Begin VB.TextBox txtComment
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 5280
ScrollBars = 2 'Vertical
TabIndex = 14
Top = 1440
Width = 1665
End
Begin VB.TextBox txtDeskNO
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 2010
TabIndex = 13
Top = 240
Width = 1692
End
Begin VB.TextBox txtDiscount
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 2040
TabIndex = 12
Text = "1"
Top = 840
Width = 1692
End
Begin VB.CommandButton updateCommand
Caption = "保存记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 1320
TabIndex = 11
Top = 5160
Width = 1095
End
Begin VB.CommandButton cancelCommand
Caption = "关闭退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 4920
TabIndex = 10
Top = 5160
Width = 1215
End
Begin VB.OptionButton OpA
Caption = "中餐"
Height = 255
Left = 1920
TabIndex = 9
Top = 1440
Value = -1 'True
Width = 735
End
Begin VB.OptionButton OpP
Caption = "晚餐"
Height = 255
Left = 2760
TabIndex = 8
Top = 1440
Width = 1095
End
Begin VB.TextBox txtPayment
Enabled = 0 'False
Height = 375
Left = 5280
TabIndex = 7
Top = 840
Width = 1695
End
Begin VB.Frame Frame1
Caption = "制订你的菜单"
Height = 2655
Left = 360
TabIndex = 0
Top = 2160
Width = 6735
Begin VB.ListBox ListAll
Height = 1680
Left = 600
TabIndex = 4
Top = 720
Width = 1815
End
Begin VB.ListBox ListYou
Height = 1680
Left = 4080
TabIndex = 3
Top = 720
Width = 2415
End
Begin VB.CommandButton cmdSelect
Caption = ">>"
Height = 375
Left = 2640
TabIndex = 2
Top = 840
Width = 1095
End
Begin VB.CommandButton cmdDrop
Caption = "<<"
Height = 375
Left = 2640
TabIndex = 1
Top = 1680
Width = 1095
End
Begin VB.Label Label6
Caption = "菜单目录:"
Height = 255
Left = 720
TabIndex = 6
Top = 360
Width = 1215
End
Begin VB.Label Label7
Caption = "你的菜单:"
Height = 255
Left = 4080
TabIndex = 5
Top = 360
Width = 975
End
End
Begin MSComCtl2.DTPicker DTReserve
Height = 375
Left = 5280
TabIndex = 15
Top = 240
Width = 1695
_ExtentX = 2990
_ExtentY = 661
_Version = 393216
Format = 72482817
CurrentDate = 37903
End
Begin VB.Label Label3
Caption = "时间:"
Height = 375
Left = 4320
TabIndex = 21
Top = 240
Width = 615
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "备注:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 20
Top = 1440
Width = 1095
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "负责员工编号:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 225
TabIndex = 19
Top = 240
Width = 1575
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "中晚餐:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 18
Top = 1440
Width = 1410
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "折扣:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 17
Top = 840
Width = 1095
End
Begin VB.Label 应付款
Caption = "应付款:"
Height = 375
Left = 4200
TabIndex = 16
Top = 840
Width = 855
End
End
Attribute VB_Name = "frmAddExpand"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cancelCommand_Click()
Unload Me
End Sub
Private Sub cmdDrop_Click()
ListYou.RemoveItem (ListYou.ListIndex)
End Sub
Private Sub cmdSelect_Click()
Dim strtemp As String
strtemp = Me.ListAll.List(ListAll.ListIndex)
' If strtemp = "" Then Exit Sub
Me.ListYou.AddItem strtemp
End Sub
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
txtSQL = "select * from 菜肴信息"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Dim i As Integer
For i = 0 To mrc.RecordCount - 1
ListAll.AddItem mrc.Fields(0)
mrc.MoveNext
Next
mrc.Close
End Sub
Private Sub updateCommand_Click()
Dim txtSQL As String
Dim txtSQL1 As String
Dim MsgText As String
Dim mrcc As ADODB.Recordset
Dim mrc As ADODB.Recordset
If Not Testtxt(txtDeskNO.Text) Then
MsgBox "请输入员工编号!", vbOKOnly + vbExclamation, "警告"
txtDeskNO.SetFocus
Exit Sub
End If
If OpA.Value = True Then
txtSQL1 = "select * from 外卖服务 where 员工编号 = '" & Trim(txtDeskNO.Text) & "' and 时间 = '" & DTReserve.Value & "' and 中晚餐 <> 0"
Else
txtSQL1 = "select * from 外卖服务 where 员工编号 = '" & Trim(txtDeskNO.Text) & "' and 时间 = '" & DTReserve.Value & "' and 中晚餐 = 0"
End If
Set mrcc = ExecuteSQL(txtSQL1, MsgText)
If mrcc.EOF = False Then
MsgBox "该员工已经派遣,请重新输入!", vbOKOnly + vbExclamation, "警告"
mrcc.Close
mrc.Close
txtDeskNO.SetFocus
Else
mrcc.AddNew
mrcc.Fields(1) = Trim(txtDeskNO.Text)
mrcc.Fields(2) = DTReserve.Value
If OpA.Value = True Then
mrcc.Fields(3) = 1
Else
mrcc.Fields(3) = 0
End If
mrcc.Fields(4) = Val(txtDiscount.Text)
mrcc.Fields(5) = Val(txtPayment.Text)
mrcc.Fields(6) = Val(txtComment.Text)
mrcc.Fields(7) = UserName
mrcc.Fields(8) = Date
mrcc.Update
SaveMenu
MsgBox "外卖服务信息添加成功!", vbOKOnly + vbExclamation, "添加外卖服务信息"
mrcc.Close
End If
End Sub
Sub SaveMenu()
Dim MsgText As String
Dim mrc As ADODB.Recordset
Dim i As Integer
Dim txtSQL As String
txtSQL = "select * from 菜单"
Set mrc = ExecuteSQL(txtSQL, MsgText)
For i = 0 To ListYou.ListCount - 1
mrc.AddNew
mrc.Fields(1) = Trim(txtDeskNO.Text)
mrc.Fields(2) = DTReserve.Value
If OpA.Value = True Then
mrc.Fields(3) = 1
Else
mrc.Fields(3) = 0
End If
mrc.Fields(4) = ListYou.List(i)
mrc.Fields(5) = 0
mrc.Update
Next
mrc.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -