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

📄 main_qtgl_jzgl.frm

📁 一个比较完整的数据库编程技巧”洗浴管理系统“
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "免单结账"
            Key             =   "md"
            ImageIndex      =   8
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            ImageIndex      =   8
            Style           =   3
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "禁止使用"
            Key             =   "jy"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "恢复使用"
            Key             =   "hf"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "关    闭"
            Key             =   "close"
            ImageIndex      =   11
         EndProperty
         BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   3615
      Left            =   30
      TabIndex        =   2
      Top             =   1635
      Width           =   8850
      _ExtentX        =   15610
      _ExtentY        =   6376
      MultiSelect     =   -1  'True
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      HotTracking     =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      ForeColor       =   255
      BackColor       =   16510956
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
   Begin VB.Label Labsy 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Left            =   870
      TabIndex        =   11
      Top             =   5370
      Width           =   1020
   End
   Begin VB.Label Labkx 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H0000C000&
      Height          =   225
      Left            =   2895
      TabIndex        =   10
      Top             =   5370
      Width           =   1020
   End
   Begin VB.Label Labsh 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H000000FF&
      Height          =   225
      Left            =   5445
      TabIndex        =   9
      Top             =   5370
      Width           =   1020
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "使用箱号:            空闲箱号:                  损坏箱号:"
      Height          =   195
      Left            =   -15
      TabIndex        =   8
      Top             =   5340
      Width           =   7035
   End
End
Attribute VB_Name = "main_qtgl_jzgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer '定义整数变量
Dim rs1 As New ADODB.Recordset '定义数据集对象
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim rs4 As New ADODB.Recordset
Dim txtSQL, itmX, list As String
Public Sub View_List()       '定义显示箱号状态及信息的函数
 Adodc1.RecordSource = "select * from 箱号信息表 where (箱号信息表.所在大厅 ='" + Trim(Combo1.Text) + "'and 箱号信息表.箱号 like + '" + Trim(Text1.Text) + "'+'%') order by 记录号"
 Adodc1.Refresh
 If Adodc1.Recordset.RecordCount > 0 Then
   Adodc1.Recordset.MoveFirst
   Do While Adodc1.Recordset.EOF = False
    If Adodc1.Recordset.Fields("状态") = "空闲" Then itmX = ListView1.ListItems.Add(, , Adodc1.Recordset.Fields("箱号"), 1)
    If Adodc1.Recordset.Fields("状态") = "使用" Then itmX = ListView1.ListItems.Add(, , Adodc1.Recordset.Fields("箱号"), 2)
    If Adodc1.Recordset.Fields("状态") = "损坏" Then itmX = ListView1.ListItems.Add(, , Adodc1.Recordset.Fields("箱号"), 3)
    Adodc1.Recordset.MoveNext
   Loop
  '分别统计空闲、使用、损坏的箱号信息
  txtSQL = "select 状态 as 状态1,count(*)as 数量1 from 箱号信息表 where 状态='空闲'and 所在大厅 ='" + Trim(Combo1.Text) + "'and 箱号信息表.箱号 like + '" + Trim(Text1.Text) + "'+'%'group by 状态 "
  Set rs1 = ESQL(txtSQL)
  If rs1.RecordCount > 0 Then Labkx.Caption = rs1.Fields(1) Else Labkx.Caption = "0"
  txtSQL = "select 状态 as 状态1,count(*)as 数量1 from 箱号信息表 where 状态='使用'and 所在大厅 ='" + Trim(Combo1.Text) + "'and 箱号信息表.箱号 like + '" + Trim(Text1.Text) + "'+'%'group by 状态 "
  Set rs1 = ESQL(txtSQL)
  If rs1.RecordCount > 0 Then Labsy.Caption = rs1.Fields(1) Else Labsy.Caption = "0"
  txtSQL = "select 状态 as 状态1,count(*)as 数量1 from 箱号信息表 where 状态='损坏'and 所在大厅 ='" + Trim(Combo1.Text) + "'and 箱号信息表.箱号 like + '" + Trim(Text1.Text) + "'+'%'group by 状态 "
  Set rs1 = ESQL(txtSQL)
  If rs1.RecordCount > 0 Then Labsh.Caption = rs1.Fields(1) Else Labsh.Caption = "0"
 Else
  MsgBox ("无此箱号信息!")
  Labkx.Caption = "0"
  Labsy.Caption = "0"
  Labsh.Caption = "0"
 End If
End Sub
Private Sub Form_Load()
 '添加大厅列表
  Combo1.AddItem ("中央大厅")
  Combo1.AddItem ("男大厅")
  Combo1.AddItem ("女大厅")
  Combo1.ListIndex = 0
  ListView1.ListItems.Clear
  Call View_List                  '调用函数
 Me.Caption = Me.Caption & "     操作员: " & frm_main.St1.Panels(3).Text
End Sub
Private Sub Form_Unload(Cancel As Integer)
  frm_main.Enabled = True
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then CmdFind.SetFocus
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
 '查询箱号信息
 Adodc1.RecordSource = "select * from 箱号信息表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
 Adodc1.Refresh
 Select Case Button.key
  '普通结帐
  Case Is = "ptjz"
   '按箱号和大厅查询包房消费临时信息
   txtSQL = "select * from 包房消费临时表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
   Set rs2 = ESQL(txtSQL)
   If rs2.RecordCount > 0 Then     '当记录大于零时
    MsgBox ("请先结束包房消费!")
   Else
    '按箱号和大厅查询临时消费信息
    txtSQL = "select * from 临时消费信息表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
    Set rs1 = ESQL(txtSQL)
    If rs1.RecordCount > 0 Then     '当记录大于零时
     '调入main_qtgl_jzgl_ptjz窗体
     main_qtgl_jzgl.Enabled = False
     Load main_qtgl_jzgl_ptjz
     main_qtgl_jzgl_ptjz.Show
    Else
     MsgBox ("此箱号没有进行消费!")
    End If
   End If
  '打折结帐
  Case Is = "dzjz"
   '按箱号和大厅查询包房消费临时信息
   txtSQL = "select * from 包房消费临时表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
   Set rs2 = ESQL(txtSQL)
   If rs2.RecordCount > 0 Then     '当记录大于零时
    MsgBox ("请先结束包房消费!")
   Else
    '按箱号和大厅查询临时消费信息
    txtSQL = "select * from 临时消费信息表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
    Set rs1 = ESQL(txtSQL)
    If rs1.RecordCount > 0 Then     '当记录大于零时
    '调入main_qtgl_jzgl_dzjz窗体
     main_qtgl_jzgl.Enabled = False
     Load main_qtgl_jzgl_dzjz
     main_qtgl_jzgl_dzjz.Show
    Else
     MsgBox ("此箱号没有进行消费!")
    End If
   End If
  '免单
  Case Is = "md"
   '按箱号和大厅查询包房消费临时信息
   txtSQL = "select * from 包房消费临时表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
   Set rs2 = ESQL(txtSQL)
   If rs2.RecordCount > 0 Then
    MsgBox ("请先结束包房消费!")
   Else
    txtSQL = "select * from 临时消费信息表 where 箱号='" + Trim(ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(Combo1.Text) + "'"
    Set rs1 = ESQL(txtSQL)
    If rs1.RecordCount > 0 Then     '假如记录大于零
     '调入main_qtgl_jzgl_md窗体
     main_qtgl_jzgl.Enabled = False
     Load main_qtgl_jzgl_md
     main_qtgl_jzgl_md.Show
    Else
     MsgBox ("此箱号没有进行消费!")
    End If
   End If
  '设置箱号禁用
  Case Is = "jy"
   If Adodc1.Recordset.RecordCount > 0 And Adodc1.Recordset.Fields("状态") = "空闲" Then
    Adodc1.Recordset.Fields("状态") = "损坏"     '设置箱号损坏
    Adodc1.Recordset.Update     '更新记录
    ListView1.ListItems.Clear
    Call View_List     '调用函数
   ElseIf Adodc1.Recordset.Fields("状态") = "使用" Then MsgBox "您选的箱号正在使用,请重新选择!"
   ElseIf Adodc1.Recordset.Fields("状态") = "损坏" Then MsgBox "您选的箱号已损坏,请重新选择!"
   End If
  '恢复禁用箱号
  Case Is = "hf"
   If Adodc1.Recordset.RecordCount > 0 And Adodc1.Recordset.Fields("状态") = "损坏" Then
    Adodc1.Recordset.Fields("状态") = "空闲"     '设置箱号空闲
    Adodc1.Recordset.Update     '更新记录
    ListView1.ListItems.Clear
    Call View_List     '调用函数
   ElseIf Adodc1.Recordset.Fields("状态") = "使用" Then MsgBox "您选的箱号正在使用,请重新选择!"
   ElseIf Adodc1.Recordset.Fields("状态") = "空闲" Then MsgBox "您选的箱号没有损坏,请重新选择!"
   End If
  '关闭
  Case Is = "close"
   Unload Me
   frm_main.Enabled = True
 End Select
End Sub
Private Sub cmdFind_Click()     '查询
  ListView1.ListItems.Clear
  Call View_List
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -