?? frmeat.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmEat
Caption = "點菜"
ClientHeight = 5685
ClientLeft = 60
ClientTop = 450
ClientWidth = 9210
LinkTopic = "Form1"
ScaleHeight = 5685
ScaleWidth = 9210
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command4
Caption = "退出"
Height = 495
Left = 6240
TabIndex = 17
Top = 4800
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "落單"
Height = 495
Left = 4560
TabIndex = 16
Top = 4800
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "刪除"
Height = 495
Left = 3120
TabIndex = 15
Top = 4800
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 1680
TabIndex = 14
Top = 4800
Width = 1215
End
Begin VB.Frame Frame1
Height = 4815
Left = 0
TabIndex = 0
Top = 0
Width = 8775
Begin VB.TextBox Text1
Height = 390
Left = 4440
TabIndex = 23
Text = "Text1"
Top = 240
Width = 1695
End
Begin VB.TextBox Text4
Height = 375
Left = 7200
TabIndex = 21
Top = 240
Width = 1335
End
Begin MSComctlLib.ImageList ImageList1
Left = 7800
Top = 1200
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "FrmEat.frx":0000
Key = ""
EndProperty
EndProperty
End
Begin VB.ListBox List1
Height = 3660
Left = 1080
TabIndex = 18
Top = 960
Width = 2055
End
Begin MSAdodcLib.Adodc AdoFoodList
Height = 495
Left = 6960
Top = 3360
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 873
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 = "Adodc1"
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.Frame Frame2
Caption = "食品基本信息"
Height = 1215
Left = 3480
TabIndex = 6
Top = 3480
Width = 5055
Begin VB.TextBox Text5
Height = 375
Left = 3840
TabIndex = 22
Text = "0"
Top = 120
Visible = 0 'False
Width = 975
End
Begin VB.TextBox Text3
Height = 270
Left = 2400
TabIndex = 19
Top = 600
Width = 855
End
Begin VB.TextBox Text2
Height = 270
Left = 840
TabIndex = 12
Text = "1"
Top = 600
Width = 735
End
Begin VB.Label Label9
Caption = "價格:"
Height = 255
Left = 1920
TabIndex = 13
Top = 600
Width = 495
End
Begin VB.Label Label8
Caption = "數量:"
Height = 255
Left = 240
TabIndex = 11
Top = 600
Width = 495
End
Begin VB.Label Label7
Caption = "FoodName"
Height = 375
Left = 2400
TabIndex = 10
Top = 240
Width = 855
End
Begin VB.Label Label6
Caption = "名稱:"
Height = 255
Left = 1920
TabIndex = 9
Top = 240
Width = 615
End
Begin VB.Label Label5
Caption = "FoodNo"
Height = 255
Left = 840
TabIndex = 8
Top = 240
Width = 855
End
Begin VB.Label Label4
Caption = "編號:"
Height = 255
Left = 240
TabIndex = 7
Top = 240
Width = 855
End
End
Begin MSComctlLib.ListView ListView1
Height = 2295
Left = 3600
TabIndex = 5
Top = 960
Width = 5055
_ExtentX = 8916
_ExtentY = 4048
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
FlatScrollBar = -1 'True
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 0
NumItems = 0
End
Begin VB.ComboBox ComboClass
Height = 300
Left = 1200
TabIndex = 2
Text = "Combo1"
Top = 360
Width = 1215
End
Begin VB.Label Label10
Caption = "桌號:"
Height = 255
Left = 6480
TabIndex = 20
Top = 360
Width = 735
End
Begin VB.Label Label3
Caption = "菜單編號:"
Height = 375
Left = 3600
TabIndex = 4
Top = 360
Width = 975
End
Begin VB.Label Label2
Caption = "食品列表:"
Height = 255
Left = 240
TabIndex = 3
Top = 720
Width = 855
End
Begin VB.Label Label1
Caption = "食品類別:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "FrmEat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim jcdl(10, 2) As String
Dim jcxl(10, 2) As String
Dim OriClass As String
Private Sub ComboClass_Click()
Refresh_Food
End Sub
Private Sub ComboClass_DblClick()
Command1_Click
End Sub
Private Sub Command1_Click()
If Text2.Text = 0 Then
MsgBox "請輸入整數!"
Exit Sub
End If
On Error GoTo Err1
ListView1.ListItems.Add , , Label7.Caption, 1, 1 '顯示酒菜名稱
ListView1.ListItems(ListView1.ListItems.Count).SubItems(1) = Text2.Text '顯示數量
ListView1.ListItems(ListView1.ListItems.Count).SubItems(2) = Text3.Text '顯示價格
ListView1.ListItems(ListView1.ListItems.Count).SubItems(3) = Label5.Caption '顯示編號
Exit Sub
Err1:
MsgBox "請輸入整數!", vbCritical
End Sub
Private Sub Command2_Click()
On Error Resume Next
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
End Sub
Private Sub Command3_Click()
Dim tempSql As String
Dim tempIndex As Integer
tempSql = "insert into Eat_Cost (CostID,CustomerDesk,status) values"
tempSql = tempSql & "('" & Text1.Text & "','"
tempSql = tempSql & Text4.Text & "','"
tempSql = tempSql & Text5.Text & "')"
SQLExt (tempSql)
For tempIndex = 1 To ListView1.ListItems.Count
tempSql = "insert into Eat_Food (FoodName,FoodNum,FoodNo,CostID) values"
tempSql = tempSql & "('" & ListView1.ListItems(tempIndex).Text & "',"
tempSql = tempSql & ListView1.ListItems(tempIndex).SubItems(1) & ",'"
tempSql = tempSql & ListView1.ListItems(tempIndex).SubItems(3) & "','"
tempSql = tempSql & Text1.Text & "')"
SQLExt (tempSql)
tempSql = ""
Next
Unload Me
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = Date + Time
Loadtype
Refresh_Food
End Sub
Private Sub Loadtype()
Dim i As Integer
i = 0
MyFood.Loadtype
ComboClass.Clear
i = 0
Do While Arr_FoodClass(i) <> ""
ComboClass.AddItem Arr_FoodClass(i)
i = i + 1
Loop
If OriClass = "" Then
If ComboClass.ListCount > 0 Then
ComboClass.ListIndex = 0
End If
Else
If InCombo(OriClass, ComboClass) = True Then
ComboClass.Text = OriClass
Else
If ComboClass.ListCount > 0 Then
ComboClass.ListIndex = 0
End If
End If
End If
ListView1.ColumnHeaders.Add , "" '"酒菜名稱"
ListView1.ColumnHeaders.Add , "" '"酒菜數量"
ListView1.ColumnHeaders.Add , "" '"酒菜單價"
ListView1.ColumnHeaders.Add , "" '"酒菜編號"
End Sub
Private Sub Refresh_Food()
'設置ADO控件的數據源
AdoFoodList.ConnectionString = Conn
AdoFoodList.RecordSource = "select * From Food WHERE FoodClass='" + Trim(ComboClass.Text) + "'"
AdoFoodList.Refresh
Set List1.DataSource = AdoFoodList
List1.Clear
Do While Not AdoFoodList.Recordset.EOF
List1.AddItem AdoFoodList.Recordset("FoodName").Value
AdoFoodList.Recordset.MoveNext
Loop
AdoFoodList.Recordset.Close
End Sub
Private Sub Label11_Click()
End Sub
Private Sub List1_Click()
AdoFoodList.ConnectionString = Conn
AdoFoodList.RecordSource = "select * From Food WHERE FoodName='" & List1.List(List1.ListIndex) & "'"
AdoFoodList.Refresh
Label7.Caption = AdoFoodList.Recordset.Fields("FoodName").Value
Label5.Caption = AdoFoodList.Recordset.Fields("FoodNo").Value
Text3.Text = AdoFoodList.Recordset.Fields("price").Value
Text2.Text = 1
AdoFoodList.Recordset.Close
End Sub
Private Sub Text2_Change()
If Len(Text2.Text) > 0 Then
Command1.Enabled = True
Else
Command1.Enabled = False
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -