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

📄 main_htgl_yjgl.frm

📁 一个比较完整的数据库编程技巧”洗浴管理系统“
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form main_htgl_yjgl 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "后台信息管理--【月结算管理】"
   ClientHeight    =   2610
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5415
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2610
   ScaleWidth      =   5415
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton ComEnd 
      Caption         =   "退出月结算管理"
      Height          =   375
      Left            =   3675
      TabIndex        =   5
      Top             =   1470
      Width           =   1560
   End
   Begin VB.TextBox Text1 
      Enabled         =   0   'False
      Height          =   285
      Left            =   3390
      TabIndex        =   8
      Top             =   960
      Width           =   1605
   End
   Begin VB.CommandButton Comyj 
      Caption         =   "开始月结算"
      Height          =   375
      Left            =   2130
      TabIndex        =   6
      Top             =   1470
      Width           =   1560
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   345
      Left            =   4785
      Top             =   2130
      Visible         =   0   'False
      Width           =   1845
      _ExtentX        =   3254
      _ExtentY        =   609
      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         =   "Adodc2"
      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 MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   4785
      Top             =   2130
      Visible         =   0   'False
      Width           =   1830
      _ExtentX        =   3228
      _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.Frame Frame2 
      Height          =   60
      Left            =   345
      TabIndex        =   1
      Top             =   2010
      Width           =   4485
   End
   Begin VB.Frame Frame1 
      Height          =   675
      Left            =   615
      TabIndex        =   0
      Top             =   45
      Width           =   4275
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "腾龙洗浴月结管理"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   330
         Left            =   480
         TabIndex        =   3
         Top             =   225
         Width           =   2865
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "腾龙洗浴月结管理"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   495
         TabIndex        =   2
         Top             =   240
         Width           =   2865
      End
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "本月营业额:"
      Height          =   180
      Left            =   2235
      TabIndex        =   7
      Top             =   990
      Width           =   1080
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "注意:月结算主要完成对当月数据的结算,系统只          允许每月结算一次。"
      ForeColor       =   &H00FF0000&
      Height          =   435
      Left            =   390
      TabIndex        =   4
      Top             =   2160
      Width           =   4305
   End
   Begin VB.Image Image1 
      Height          =   930
      Left            =   165
      Picture         =   "main_htgl_yjgl.frx":0000
      Stretch         =   -1  'True
      Top             =   870
      Width           =   1920
   End
End
Attribute VB_Name = "main_htgl_yjgl"
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 rs5 As New ADODB.Recordset
Dim txtSQL, myval, txttime As String    '定义字符串变量
Private Sub Form_Load()
 txtSQL = "select * from 月消费信息表 order by 消费单据号"
 Set rs1 = ESQL(txtSQL)     '执行SQL语句
 '当记录大于零时,Comyj按钮有效,否则Comyj按钮无效
 If rs1.RecordCount > 0 Then Comyj.Enabled = True Else Comyj.Enabled = False
 Me.Caption = Me.Caption & " 操作员: " & frm_main.St1.Panels(3).Text
     Adodc2.RecordSource = "select sum(消费实收) from 月消费单据表"
     Adodc2.Refresh
     On Error Resume Next
     Text1.Text = Adodc2.Recordset.Fields(0).Value
End Sub
Private Sub Comyj_Click()     '确定月结算
  Adodc1.RecordSource = "select * from 月消费单据表"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
     Comyj.Enabled = True
  Else
     Comyj.Enabled = False
  End If
  myval = MsgBox("确认结算当月数据吗?", vbYesNo)
  If myval = vbYes Then
     Adodc2.RecordSource = "select sum(消费实收) from 月消费单据表"
     Adodc2.Refresh
     If Adodc2.Recordset.RecordCount > 0 Then
        txtSQL = "select * from 月营业分析表"
        Set rs5 = ESQL(txtSQL)
        rs5.AddNew
        On Error Resume Next
        Adodc1.Recordset.AddNew
        rs5.Fields(0) = Format(Date, "yyyy - mm")
        rs5.Fields(1).Value = Adodc2.Recordset.Fields(0).Value
        rs5.Update
        Adodc1.Refresh
     End If
  
  
  
     '插入记录到历史消费信息表中
     txtSQL = "insert 历史消费信息表(箱号,所在大厅,项目编号,名称,单位,单价,数量,简称,消费状态,隐藏状态,登记时间,折扣,金额小计,消费单据号) select 箱号,所在大厅,项目编号,名称,单位,单价,数量,简称,消费状态,隐藏状态,登记时间,折扣,金额小计,消费单据号 from 月消费信息表 order by 消费单据号"
     Set rs1 = ESQL(txtSQL)
'     ESQL.Close
     '插入记录到历史消费单据表中
     txtSQL = "insert  历史消费单据表(消费单据号,主客箱号,主客姓名,主客性别,登记时间,结帐日期,结帐方式,主客消费金额,总计消费,打折,消费应收,实交金额,找零,消费实收,减免金额,减免原因,单据描述,人数) select 消费单据号,主客箱号,主客姓名,主客性别,登记时间,结帐日期,结帐方式,主客消费金额,总计消费,打折,消费应收,实交金额,找零,消费实收,减免金额,减免原因,单据描述,人数 from 月消费单据表 order by 消费单据号"
     Set rs2 = ESQL(txtSQL)
     '删除月消费信息表中的数据
     txtSQL = "delete 月消费信息表 select * from 月消费信息表"
     Set rs3 = ESQL(txtSQL)
     '删除月消费单据表中的数据
     txtSQL = "delete 月消费单据表 select * from 月消费单据表"
     Set rs4 = ESQL(txtSQL)
     Comyj.Enabled = False     '设置Comyj按钮无效
     MsgBox "月结算完毕!"
     frm_main.Enabled = True     '设置frm_main窗体有效
     Unload Me
  End If
End Sub
Private Sub comend_Click()
 frm_main.Enabled = True     '设置frm_main窗体有效
 Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True     '设置frm_main窗体有效
End Sub

⌨️ 快捷键说明

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