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

📄 ct_lyq.frm

📁 vb不酒店管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim CS_zy As String
Dim CS_sl As Integer
 
Sub MAIN(t_zy As String, t_sl As Integer)
    CS_zy = t_zy
    CS_sl = t_sl
End Sub


'**************************************************************************************************
'*  功    能 : 明细列表的显示
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub tPxs_SRFCX()

    Dim temp_srf As Recordset
    Dim temp_srfHJ As Recordset
    Dim temp_rq_s As Date
    Dim temp_rq_e As Date
    Dim temp_day As Integer
    
    If Trim(m_month.Text) = "" Then
        temp_rq_s = Format(DateSerial(CInt(m_year.Text), 1, 1), "yyyy-mm-dd")
        temp_rq_e = Format(DateSerial(CInt(m_year.Text), 12, 31), "yyyy-mm-dd")
    Else
        temp_rq_s = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1), "yyyy-mm-dd")
        temp_day = DateSerial(CInt(m_year.Text), CInt(m_month.Text) + 1, 1) - DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1)
        temp_rq_e = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), temp_day), "yyyy-mm-dd")
    End If
    
    lb_name.Caption = Trim(m_year.Text) & "年" & IIf(Trim(m_month.Text) = "", "", Trim(m_month.Text) & "月") & "双人间住单人客房一览表"
    
    Set temp_srfHJ = PUB_data.OpenRecordset("SELECT SUM(SF_FYS) AS FYS, SUM(SF_ZZS) AS ZZS, SUM(SF_DRS) AS DRS FROM DT_SRFTJ WHERE RQ BETWEEN #" & temp_rq_s & "# AND #" & temp_rq_e & "#", 4, 0, 2)
    If Not temp_srfHJ.BOF Then
        temp_srfHJ.MoveLast
        lb_fys.Caption = IIf(IsNull(temp_srfHJ.Fields("FYS")), 0, temp_srfHJ.Fields("FYS"))
        lb_zzs.Caption = IIf(IsNull(temp_srfHJ.Fields("ZZS")), 0, temp_srfHJ.Fields("ZZS"))
        lb_drs.Caption = IIf(IsNull(temp_srfHJ.Fields("DRS")), 0, temp_srfHJ.Fields("DRS"))
    Else
        lb_fys.Caption = 0
        lb_zzs.Caption = 0
        lb_drs.Caption = 0
    End If
    temp_srfHJ.Close
    
    Set temp_srf = PUB_data.OpenRecordset("SELECT * FROM DT_SRFTJ WHERE RQ BETWEEN #" & temp_rq_s & "# AND #" & temp_rq_e & "# ORDER BY RQ", 4, 0, 2)
    If Not temp_srf.BOF Then
        temp_srf.MoveLast
    End If
    
    Call flex_refresh(gd1, t_bt, temp_srf, t_fields, t_fdcounts, t_fdxs)
    lb_jls.Caption = gd1.Rows - 1
    temp_srf.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
'**************************************************************************************************
Private Sub CMD_EXIT_Click()
    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()
    Dim t_gwdm As String
    Dim t_gwmc As String
    Dim t_czy As String
    Dim t_bz As String
    Dim t_fsrq As Date
    Dim t_hssl As Integer
    Dim t_lysl As Integer
    Dim t_ffsl As Integer
    
    ct_yhq.KeyPreview = True
    
    If Not (CS_sl = 0 And CS_zy = "收回") Then
        t_hssl = 0
        t_lysl = 0
        t_ffsl = 0
        t_gwdm = SYS_GWDM
        t_gwmc = SYS_GWMC
        t_czy = SYS_USER
        t_bz = CS_zy
        t_fsrq = Date
    End If

    Select Case CS_zy
    Case "收回"
    Case "领用"
    Case "发放"
    End Select
    
    frm_msg.Visible = True
    frm_msg.Caption = ""
    
    m_year.Text = year(Date)
    m_month.Text = month(Date)

    '明细显示字段设置
    t_fields = Array("RQ", "SF_FYS", "SF_ZZS", "SF_DRS") '设置显示字段
    t_fdxs = Array(0, 0, 0, 0) '设置显示字段
    t_bt = "^日  期        |>房 源 数    |>在 住 数    |>单 人 数    "   '设置显示表头格式
    t_fdcounts = 4
    
    Call tPxs_SRFCX
    
End Sub


Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        CMD_print.SetFocus
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        m_month.SetFocus
    End If
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
    
    Call tPxs_SRFCX
End Sub
'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        gd1.SetFocus
    End If
        
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
    
    Call tPxs_SRFCX
End Sub

⌨️ 快捷键说明

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