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

📄 dt_zckcx.frm

📁 一个简单的酒店管理系统 用VB.net+SQL2000实现
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Left            =   5895
      TabIndex        =   10
      Top             =   180
      Visible         =   0   'False
      Width           =   5685
   End
   Begin VB.Label Label1 
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   180
      TabIndex        =   9
      Top             =   120
      Width           =   11475
   End
End
Attribute VB_Name = "dt_zckcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim CS_caption As String
Dim t_opNo As Integer   '记录 Option(i) 中值为 True 的 i 的值

'明细显示
Dim t_tbname As String
Dim zckcx_rec As Recordset
Dim t_bt As String          '存储列表显示的表头
Dim t_fields As Variant     '存储列表显示的字段名
Dim t_fdxs As Variant       '表示显示列是否由代码转换成文字
Dim t_fdcounts As Integer   '表示列表所显示的字段的个数
 
'按月合计
Dim t_tbnamehj As String
Dim zckhj_rec As Recordset
Dim t_bthj As String        '存储列表显示的表头
Dim t_fieldshj As Variant   '存储列表显示的字段名
Dim t_fdxshj As Variant     '表示显示列是否由代码转换成文字
Dim t_fdcountshj As Integer '表示列表所显示的字段的个数



'**************************************************************************************************
'*  功    能 : 明细列表的显示
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub tPxs_GDMX(temp_i As Integer)
    Dim temp_sl As Recordset
    
    Dim temp_tj As String
    
    t_tbname = "ZC" & Trim(m_year.Text)
    
    temp_tj = ""
    If Trim(m_month.Text) <> "" Then
        temp_tj = " YEAR(FSRQ)=" & Trim(m_year.Text) & " AND MONTH(FSRQ)=" & Trim(m_month.Text)
    Else
        temp_tj = " YEAR(FSRQ)=" & Trim(m_year.Text)
    End If
    
    Select Case temp_i
    Case 0   '全部显示
        Set zckcx_rec = PUB_data.OpenRecordset("SELECT * FROM " & t_tbname & " WHERE " & temp_tj & " ORDER BY FSRQ, ZH, ZCK_BZ", 4, 0, 2)
        If Not zckcx_rec.BOF Then
            zckcx_rec.MoveLast
            zckcx_rec.MoveFirst
        End If
        
        Set temp_sl = PUB_data.OpenRecordset("SELECT SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbname & " WHERE " & temp_tj, 4, 0, 2)
        If Not temp_sl.BOF Then
            temp_sl.MoveLast
            temp_sl.MoveFirst
        End If
        
    Case 1   '领用
        Set zckcx_rec = PUB_data.OpenRecordset("SELECT * FROM " & t_tbname & " WHERE LYSL<>0 AND " & temp_tj & " ORDER BY FSRQ, ZH, ZCK_BZ", 4, 0, 2)
        If Not zckcx_rec.BOF Then
            zckcx_rec.MoveLast
            zckcx_rec.MoveFirst
        End If
        
        Set temp_sl = PUB_data.OpenRecordset("SELECT SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbname & " WHERE LYSL<>0 AND " & temp_tj, 4, 0, 2)
        If Not temp_sl.BOF Then
            temp_sl.MoveLast
            temp_sl.MoveFirst
        End If
    
    Case 2   '发放
        Set zckcx_rec = PUB_data.OpenRecordset("SELECT * FROM " & t_tbname & " WHERE FFSL<>0 AND " & temp_tj & " ORDER BY FSRQ, ZH, ZCK_BZ", 4, 0, 2)
        If Not zckcx_rec.BOF Then
            zckcx_rec.MoveLast
            zckcx_rec.MoveFirst
        End If
        
        Set temp_sl = PUB_data.OpenRecordset("SELECT SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbname & " WHERE FFSL<>0 AND " & temp_tj, 4, 0, 2)
        If Not temp_sl.BOF Then
            temp_sl.MoveLast
            temp_sl.MoveFirst
        End If
    
    Case 3   '回收
        Set zckcx_rec = PUB_data.OpenRecordset("SELECT * FROM " & t_tbname & " WHERE HSSL<>0 AND " & temp_tj & " ORDER BY FSRQ, ZH, ZCK_BZ", 4, 0, 2)
        If Not zckcx_rec.BOF Then
            zckcx_rec.MoveLast
            zckcx_rec.MoveFirst
        End If
        
        Set temp_sl = PUB_data.OpenRecordset("SELECT SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbname & " WHERE HSSL<>0 AND " & temp_tj, 4, 0, 2)
        If Not temp_sl.BOF Then
            temp_sl.MoveLast
            temp_sl.MoveFirst
        End If
    End Select
    
    lb_mx_ly.Caption = IIf(IsNull(temp_sl.Fields("HJ_LYSL")), 0, temp_sl.Fields("HJ_LYSL"))
    lb_mx_ff.Caption = IIf(IsNull(temp_sl.Fields("HJ_FFSL")), 0, temp_sl.Fields("HJ_FFSL"))
    lb_mx_hs.Caption = IIf(IsNull(temp_sl.Fields("HJ_HSSL")), 0, temp_sl.Fields("HJ_HSSL"))
    temp_sl.Close
    
    Call flex_refresh(gd_mx, t_bt, zckcx_rec, t_fields, t_fdcounts, t_fdxs)
    
    lb_mx_jls.Caption = gd_mx.Rows - 1
    
End Sub

'**************************************************************************************************
'*  功    能 : 合计列表的显示
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub tPxs_GDHJ()
    Dim temp_sl As Recordset
    
    t_tbnamehj = "ZC" & Trim(m_year.Text)
    
    lb_hj.Caption = Trim(m_year.Text) & "年按月合计"

    Set zckhj_rec = PUB_data.OpenRecordset("SELECT YEAR(FSRQ) AS YER, MONTH(FSRQ) AS MON, ZCK_BZ, SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbnamehj & " WHERE YEAR(FSRQ) = " & m_year.Text & " GROUP BY YEAR(FSRQ), MONTH(FSRQ), ZCK_BZ", 4, 0, 2)
    If Not zckhj_rec.BOF Then
        zckhj_rec.MoveLast
        zckhj_rec.MoveFirst
    End If

    Call flex_refresh(gd_hj, t_bthj, zckhj_rec, t_fieldshj, t_fdcountshj, t_fdxshj)

    Set temp_sl = PUB_data.OpenRecordset("SELECT SUM(LYSL) AS HJ_LYSL, SUM(FFSL) AS HJ_FFSL, SUM(HSSL) AS HJ_HSSL FROM " & t_tbnamehj, 4, 0, 2)
    If Not temp_sl.BOF Then
        temp_sl.MoveLast
        temp_sl.MoveFirst
    End If
    
    lb_hj_ly.Caption = IIf(IsNull(temp_sl.Fields("HJ_LYSL")), 0, temp_sl.Fields("HJ_LYSL"))
    lb_hj_ff.Caption = IIf(IsNull(temp_sl.Fields("HJ_FFSL")), 0, temp_sl.Fields("HJ_FFSL"))
    lb_hj_hs.Caption = IIf(IsNull(temp_sl.Fields("HJ_HSSL")), 0, temp_sl.Fields("HJ_HSSL"))
    temp_sl.Close
End Sub


'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub flex_refresh(temp_gd As MSFlexGrid, temp_bt As String, temp_rec As Recordset, temp_fields As Variant, temp_fdcounts As Integer, temp_fdxs As Variant)
    
    Call Flex_full(temp_gd, temp_bt, temp_rec, temp_fields, temp_fdcounts - 1, temp_fdxs)
    temp_gd.Refresh
    
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Sub MAIN(t_gnmc As String)

   CS_caption = t_gnmc
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub CMD_EXIT_Click()
    zckcx_rec.Close
    zckhj_rec.Close

    Unload Me
End Sub






Private Sub Form_Activate()
    m_year.SetFocus
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    frm_msg.Caption = ""
    frm_msg.Visible = False
    If KeyCode = vbKeyEscape Then
        Call CMD_EXIT_Click
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_Load()

    dt_zckcx.KeyPreview = True

    Label1.Caption = CS_caption
    
    m_year.Text = year(Date)
    m_month.Text = month(Date)

    '明细显示字段设置
    t_fields = Array("FSRQ", "ZH", "ZCK_BZ", "LYSL", "FFSL", "HSSL", "CZY", "BZ") '设置显示字段
    t_fdxs = Array(0, 0, 0, 0, 0, 0, 0, 0)  '设置显示字段
    t_bt = "^日  期    |<房号 |>标  准 |>领用数量 |>发放数量 |>回收数量 |^操作员|<备注              "   '设置显示表头格式
    t_fdcounts = 8
    
    '合计显示字段设置
    t_fieldshj = Array("MON", "ZCK_BZ", "HJ_LYSL", "HJ_FFSL", "HJ_HSSL") '设置显示字段
    t_fdxshj = Array(0, 0, 0, 0, 0, 0)   '设置显示字段
    t_bthj = ">月份|>标  准 |>领用数量 |>发放数量 |>回收数量       "   '设置显示表头格式
    t_fdcountshj = 5
    
    t_opNo = 0
    
    tPxs_GDMX t_opNo  '明细列表显示
    
    tPxs_GDHJ   '合计列表显示

    Opfunc(0).Value = True

End Sub




'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub gd_mx_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        gd_hj.SetFocus
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub gd_hj_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        m_year.SetFocus
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim temp_i As Integer
    Select Case KeyCode
    Case vbKeyUp
        m_year.SetFocus
    Case vbKeyDown, vbKeyReturn
        temp_i = 0
        Do While Not Opfunc(temp_i).Value
            temp_i = temp_i + 1
        Loop
        Opfunc(temp_i).SetFocus
    End Select
        
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_LostFocus()
    Dim temp_ft As Boolean
    
    frm_msg.Visible = False
    frm_msg.Caption = ""
    
    If Trim(m_month.Text) = "" Then
    Else
        temp_ft = PUB_SZJY(m_month, frm_msg)
        If temp_ft Then
            If m_year.Text <> year(Date) Then
                If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= 12 Then
                Else
                    frm_msg.Visible = True
                    frm_msg.Caption = "月份范围应在 1 至 12 之间"
                    m_month.Text = month(Date)
                End If
            Else
                If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= month(Date) Then
                Else
                    frm_msg.Visible = True
                    frm_msg.Caption = "月份范围应在 1 至 " & month(Date) & " 之间"
                    m_month.Text = month(Date)
                End If
            End If
        End If
    End If
    
    tPxs_GDMX t_opNo  '明细列表显示

End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim temp_i As Integer
    Select Case KeyCode
    Case vbKeyUp
        temp_i = 0
        Do While Not Opfunc(temp_i).Value
            temp_i = temp_i + 1
        Loop
        Opfunc(temp_i).SetFocus
    Case vbKeyReturn, vbKeyDown
        m_month.SetFocus
    End Select
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_LostFocus()
    Dim temp_ft As Boolean
    
    frm_msg.Visible = False
    frm_msg.Caption = ""
    
    temp_ft = PUB_SZJY(m_year, frm_msg)
    If temp_ft Then
        If CInt(m_year.Text) >= year(LoadResString(SYS_START)) And CInt(m_year.Text) <= year(Date) Then
        Else
            frm_msg.Visible = True
            frm_msg.Caption = "年份范围应在 " & year(LoadResString(SYS_START)) & " 至 " & year(Date) & " 之间"
            m_year.Text = year(Date)
        End If
    End If
    
    tPxs_GDMX t_opNo   '明细列表显示
    tPxs_GDHJ   '合计列表显示
    
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Opfunc_Click(Index As Integer)
    t_opNo = Index
    tPxs_GDMX Index
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Opfunc_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        gd_mx.SetFocus
    End If
End Sub

⌨️ 快捷键说明

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