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

📄 main_qtgl_jzgl_ptjz

📁 一个比较完整的数据库编程技巧”洗浴管理系统“
💻
📖 第 1 页 / 共 2 页
字号:
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07 
         DataField       =   "数量"
         Caption         =   "数量"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column08 
         DataField       =   "简称"
         Caption         =   "简称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column09 
         DataField       =   "货物名称"
         Caption         =   "货物名称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column10 
         DataField       =   "消费状态"
         Caption         =   "消费状态"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column11 
         DataField       =   "隐藏状态"
         Caption         =   "隐藏状态"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column12 
         DataField       =   "登记时间"
         Caption         =   "登记时间"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column13 
         DataField       =   "折扣"
         Caption         =   "折扣"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column14 
         DataField       =   "金额小计"
         Caption         =   "金额小计"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   629.858
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   900.284
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   929.764
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   945.071
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   1635.024
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   555.024
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   599.811
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   569.764
         EndProperty
         BeginProperty Column08 
            ColumnWidth     =   555.024
         EndProperty
         BeginProperty Column09 
            ColumnWidth     =   1019.906
         EndProperty
         BeginProperty Column10 
            ColumnWidth     =   840.189
         EndProperty
         BeginProperty Column11 
            ColumnWidth     =   824.882
         EndProperty
         BeginProperty Column12 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column13 
            ColumnWidth     =   480.189
         EndProperty
         BeginProperty Column14 
            ColumnWidth     =   1440
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   -15
      Top             =   4200
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XYGLXT"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from 日消费信息表"
      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.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "人数:           单据描述:"
      Height          =   345
      Left            =   120
      TabIndex        =   11
      Top             =   570
      Width           =   5955
   End
   Begin VB.Label Labdjh 
      BackStyle       =   0  'Transparent
      Height          =   270
      Left            =   9675
      TabIndex        =   10
      Top             =   105
      Width           =   1590
   End
   Begin VB.Label Labzl 
      BackStyle       =   0  'Transparent
      Height          =   270
      Left            =   7395
      TabIndex        =   9
      Top             =   105
      Width           =   945
   End
   Begin VB.Label Labdd 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   240
      Left            =   960
      TabIndex        =   4
      Top             =   4950
      Width           =   1395
   End
   Begin VB.Label Labzd 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H000000FF&
      Height          =   240
      Left            =   3315
      TabIndex        =   3
      Top             =   4950
      Width           =   1395
   End
   Begin VB.Label Labzj 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   240
      Left            =   5685
      TabIndex        =   2
      Top             =   4950
      Width           =   2145
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "点单金额:                赠单金额:                金额总计:"
      Height          =   225
      Left            =   105
      TabIndex        =   5
      Top             =   4980
      Width           =   8040
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "主客姓名:                    主客性别:            实交金额:             找零:             结帐单据号:"
      Height          =   285
      Left            =   120
      TabIndex        =   0
      Top             =   150
      Width           =   11595
   End
End
Attribute VB_Name = "main_qtgl_jzgl_ptjz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
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, lsph, myval As String
Private Sub Form_Activate()
 Combo1.AddItem ("男")
 Combo1.AddItem ("女")
 Combo1.ListIndex = 0
 txtSQL = "select * from 单据号表"
 Set rs1 = ESQL(txtSQL)
 If rs1.RecordCount = 0 Then
    Labdjh.Caption = Date & "No." & "0001"
  Else
    lsph = Right(Trim(rs1.Fields("单据号")), 4) + 1
    Labdjh.Caption = Date & "No." & Format(lsph, "0000")
 End If
 Adodc1.RecordSource = "select * from 临时消费信息表 where 临时消费信息表.箱号='" + Trim(main_qtgl_jzgl.ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(main_qtgl_jzgl.Combo1.Text) + "'"
 Adodc1.Refresh
 Adodc2.RecordSource = "select 消费状态 as 状态1,sum(金额小计)as 金额合计 from 临时消费信息表 where 箱号='" + Trim(main_qtgl_jzgl.ListView1.SelectedItem.Text) + "'and 所在大厅 ='" + Trim(main_qtgl_jzgl.Combo1.Text) + "'group by 消费状态 order by 消费状态"
 Adodc2.Refresh
 If Adodc2.Recordset.RecordCount > 1 Then
  Labdd.Caption = Format(Val(Adodc2.Recordset.Fields(1)), "0.00")
  If Adodc2.Recordset.EOF = False Then Adodc2.Recordset.MoveNext
  Labzd.Caption = Format(Val(Adodc2.Recordset.Fields(1)), "0.00")
 ElseIf Adodc2.Recordset.RecordCount = 1 Then
 If Adodc2.Recordset.Fields(0) = "赠单" Then
  Labzd.Caption = Format(Val(Adodc2.Recordset.Fields(1)), "0.00")
  Labdd.Caption = "0.00"
 Else
  Labdd.Caption = Format(Val(Adodc2.Recordset.Fields(1)), "0.00")
  Labzd.Caption = "0.00"
 End If
 End If
 Labzj.Caption = Format(Val(Labdd.Caption) + Val(Labzd.Caption), "0.00")
End Sub
Private Sub Texsj_Change()
 Labzl.Caption = Val(Texsj.Text) - Val(Labzj.Caption)
End Sub
Private Sub cmdOK_Click()
 myval = MsgBox("是否确定普通结帐?", vbYesNo)
 If myval = vbYes Then
  txtSQL = "insert 日消费信息表(箱号,所在大厅,项目编号,名称,单位,单价,数量,简称,货物名称,消费状态,隐藏状态,登记时间,折扣,金额小计) select 箱号,所在大厅,项目编号,名称,单位,单价,数量,简称,货物名称,消费状态,隐藏状态,登记时间,折扣,金额小计 from 临时消费信息表 where 箱号='" + Trim(Adodc1.Recordset.Fields("箱号")) + "'"
  Set rs1 = ESQL(txtSQL)
  txtSQL = "update 日消费信息表 set 隐藏状态='已结帐',消费单据号='" + Trim(Labdjh.Caption) + "'from 日消费信息表 where 箱号='" + Trim(Adodc1.Recordset.Fields("箱号")) + "'"
  Set rs2 = ESQL(txtSQL)
'  txtSQL = "delete 临时消费信息表 where 箱号='" + Trim(Adodc1.Recordset.Fields("箱号")) + "'"
'  Set rs2 = ESQL(txtSQL)
  Adodc3.Refresh
  Adodc1.Refresh
 End If

End Sub
Private Sub CmdEnd_Click()
 main_qtgl_jzgl.Enabled = True
 Unload Me
End Sub

⌨️ 快捷键说明

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