⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmeat.frm

📁 一个小型管理系统.~!!不同的用户拥有不同的权限
💻 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 + -