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

📄 frmintegration.frm

📁 星级酒店管理系统(附带系统自写控件源码)
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         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 + -