?? frmintegration.frm
字號:
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 5
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "酒席編號"
Object.Width = 2469
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "酒席名稱"
Object.Width = 3528
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 1
SubItemIndex = 2
Text = "價 格"
Object.Width = 1411
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "類型"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "描述"
Object.Width = 5292
EndProperty
End
Begin 給出焦點文本框.FocusText ftMenuID
Height = 300
Left = 1020
TabIndex = 0
Top = 360
Width = 1425
_ExtentX = 2514
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
PreControl = "cmdAddCat"
NextControl = "ftMenuName"
End
Begin 給出焦點文本框.FocusText ftMenuName
Height = 300
Left = 1020
TabIndex = 1
Top = 750
Width = 1425
_ExtentX = 2514
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
PreControl = "ftMenuID"
NextControl = "ftPrice"
End
Begin 給出焦點文本框.FocusText ftMenuTyp
Height = 300
Left = 3150
TabIndex = 3
Top = 750
Width = 1185
_ExtentX = 2090
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
PreControl = "ftPrice"
NextControl = "ftDescription"
End
Begin 給出焦點文本框.FocusText ftPrice
Height = 300
Left = 3150
TabIndex = 2
Top = 360
Width = 1185
_ExtentX = 2090
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
PreControl = "ftMenuName"
NextControl = "ftMenuTyp"
TextType = 2
Text = "0"
End
Begin 給出焦點文本框.FocusText ftDescription
Height = 300
Left = 4980
TabIndex = 4
Top = 750
Width = 3645
_ExtentX = 6429
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BorderStyle = 0
PreControl = "ftMenuTyp"
NextControl = "cmdAddCat"
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "描述:"
BeginProperty Font
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 8
Left = 4455
TabIndex = 27
Top = 780
Width = 585
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "類型:"
BeginProperty Font
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 7
Left = 2625
TabIndex = 26
Top = 780
Width = 585
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "價格:"
BeginProperty Font
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 6
Left = 2625
TabIndex = 25
Top = 390
Width = 585
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "編 號:"
BeginProperty Font
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 5
Left = 300
TabIndex = 24
Top = 390
Width = 795
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "酒席名:"
BeginProperty Font
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 4
Left = 300
TabIndex = 23
Top = 780
Width = 780
End
End
End
Attribute VB_Name = "frmIntegration"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmbType_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdAdd.SetFocus
End If
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddERR
'如果酒席為空時不能繼續
If lstPro.ListItems.Count = 0 Then
MsgBox "酒席編號為空,不能繼續, " & vbCrLf _
& "請首先添加酒席名稱后,再添加菜明細。 ", vbExclamation
ftMenuName.SetFocus
Exit Sub
End If
If lstPro.SelectedItem.Text = 0 Then
MsgBox "請在上面選擇一種酒席后, " & vbCrLf _
& "再添加菜明細,否則不能添加菜明細。 ", vbExclamation
lstPro.SetFocus
Exit Sub
End If
'校對不能為空
If Trim(ftID.Text) = "" Then
MsgBox "對不起,菜單編碼不能為空? ", vbExclamation
ftID.SetFocus
Exit Sub
End If
If Trim(ftName.Text) = "" Then
MsgBox "菜名不能為空,只能輸入菜名編號 " & vbCrLf _
& "或點擊右邊按鈕,選擇菜編號后,將給出菜名? ", vbExclamation
ftName.SetFocus
Exit Sub
End If
If Not IsNumeric(ftNum.Text) Then
MsgBox "數量必須為數字,禁止非數字輸入? ", vbExclamation
ftNum.SetFocus
Exit Sub
End If
Dim stmpID As String, sParentID As String
stmpID = Trim(ftID.Text)
sParentID = lstPro.SelectedItem.Text
'檢查是否重復
Dim aDB As Connection
Dim aRs As Recordset
Set aDB = CreateObject("ADODB.Connection")
Set aRs = CreateObject("ADODB.Recordset")
aDB.Open Constr
aRs.Open "Select * from tbdMenuCatDetail Where MenuID='" & sParentID & "' And MenuName='" & stmpID & "'", aDB, adOpenStatic, adLockOptimistic, adCmdText
If aRs.EOF And aRs.BOF Then
'添加入內
aRs.AddNew
aRs("MenuID") = sParentID
aRs("MenuName") = stmpID
aRs("MenuNum") = ftNum.Text
If cmbType.Text <> "" Then
aRs("MenuType") = cmbType.Text
End If
aRs.Update
'添加到列表中
InsertToIntegrationDetail lstDetail, stmpID, Trim(ftName.Text), ftNum.Text, cmbType.Text
Else
aRs.Close
Set aRs = Nothing
aDB.Close
Set aDB = Nothing
MsgBox "酒席:" & sParentID & " 中編號為【" & stmpID & "】的菜已經存在, " & vbCrLf _
& "系統將自動更新編號或手工修改后繼續? ", vbExclamation
ftMenuID.Text = ""
ftMenuID.SetFocus
Exit Sub
End If
aRs.Close
Set aRs = Nothing
aDB.Close
Set aDB = Nothing
'重新添加新的酒席
ftID.Text = ""
ftNum.Text = "1"
ftName.Text = ""
'cmbType.Text = ""
ftID.SetFocus
Exit Sub
AddERR:
MsgBox "添加錯誤:" & Err.Description, vbCritical
End Sub
Private Sub cmdAddCat_Click()
On Error GoTo AddERR
'校對不能為空
If Trim(ftMenuID.Text) = "" Then
MsgBox "對不起,酒席編碼不能為空? ", vbExclamation
ftMenuID.SetFocus
Exit Sub
End If
If Trim(ftMenuName.Text) = "" Then
MsgBox "酒席名必須輸入? ", vbExclamation
ftMenuName.SetFocus
Exit Sub
End If
If Not IsNumeric(ftPrice.Text) Then
MsgBox "價格必須為數字,禁止非數字輸入? ", vbExclamation
ftPrice.SetFocus
Exit Sub
End If
Dim stmpID As String
stmpID = Trim(ftMenuID.Text)
'檢查是否重復
Dim aDB As Connection
Dim aRs As Recordset
Set aDB = CreateObject("ADODB.Connection")
Set aRs = CreateObject("ADODB.Recordset")
aDB.Open Constr
aRs.Open "Select * from tbdMenuCat Where MenuID='" & stmpID & "'", aDB, adOpenStatic, adLockOptimistic, adCmdText
If aRs.EOF And aRs.BOF Then
'添加入內
aRs.AddNew
aRs("MenuID") = stmpID
aRs("MenuName") = Trim(ftMenuName.Text)
aRs("MenuPrice") = ftPrice.Text
If Trim(ftMenuTyp.Text) <> "" Then
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -