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

📄 dt_zkfdc.frm

📁 一个简单的酒店管理系统 用VB.net+SQL2000实现
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form dt_zkfdc 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   8115
   ClientLeft      =   -15
   ClientTop       =   -15
   ClientWidth     =   8385
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8115
   ScaleWidth      =   8385
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton CMD_print 
      Caption         =   "打 印(F5)"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   510
      Left            =   1560
      TabIndex        =   3
      Top             =   7470
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Height          =   7035
      Left            =   90
      TabIndex        =   6
      Top             =   300
      Width           =   8190
      Begin VB.Frame Frame2 
         Caption         =   "查询日期"
         Height          =   705
         Left            =   270
         TabIndex        =   10
         Top             =   630
         Width           =   3675
         Begin VB.TextBox m_year 
            Height          =   270
            Left            =   990
            MaxLength       =   4
            TabIndex        =   0
            Text            =   "1999"
            Top             =   300
            Width           =   555
         End
         Begin VB.TextBox m_month 
            Height          =   270
            Left            =   2700
            MaxLength       =   2
            TabIndex        =   1
            Text            =   "12"
            Top             =   300
            Width           =   375
         End
         Begin VB.Label Label5 
            Caption         =   "年 份"
            Height          =   165
            Left            =   480
            TabIndex        =   13
            Top             =   330
            Width           =   465
         End
         Begin VB.Label Label6 
            Caption         =   "月 份"
            Height          =   195
            Left            =   2160
            TabIndex        =   12
            Top             =   330
            Width           =   495
         End
      End
      Begin MSFlexGridLib.MSFlexGrid gd1 
         Height          =   5100
         Left            =   210
         TabIndex        =   2
         Top             =   1740
         Width           =   7740
         _ExtentX        =   13653
         _ExtentY        =   8996
         _Version        =   327680
         Rows            =   25
         Cols            =   6
         FixedCols       =   0
         BackColor       =   12648447
         FocusRect       =   0
         ScrollBars      =   2
         SelectionMode   =   1
      End
      Begin VB.Label lb_name 
         Alignment       =   2  'Center
         Caption         =   "一览表"
         ForeColor       =   &H00000000&
         Height          =   240
         Left            =   2010
         TabIndex        =   11
         Top             =   1500
         Width           =   4155
      End
      Begin VB.Label lb_jls 
         Alignment       =   1  'Right Justify
         Caption         =   "0"
         Height          =   195
         Left            =   7200
         TabIndex        =   9
         Top             =   1500
         Width           =   555
      End
      Begin VB.Label Label4 
         Alignment       =   1  'Right Justify
         Caption         =   "记录数 :"
         Height          =   255
         Left            =   6420
         TabIndex        =   8
         Top             =   1500
         Width           =   795
      End
      Begin VB.Label lb_title 
         Alignment       =   2  'Center
         Caption         =   "分 段 折 扣 客 房 查 询"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   240
         TabIndex        =   7
         Top             =   210
         Width           =   7665
      End
   End
   Begin VB.Timer XT_Timer 
      Interval        =   1000
      Left            =   0
      Top             =   7200
   End
   Begin VB.CommandButton CMD_EXIT 
      Caption         =   "退 出(Esc)"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   510
      Left            =   4770
      TabIndex        =   4
      Top             =   7470
      Width           =   1575
   End
   Begin VB.Label frm_msg 
      Alignment       =   1  'Right Justify
      ForeColor       =   &H00C00000&
      Height          =   240
      Left            =   5610
      TabIndex        =   5
      Top             =   60
      Visible         =   0   'False
      Width           =   2595
   End
End
Attribute VB_Name = "dt_zkfdc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim t_tbname As String
Dim t_bt As String          '存储列表显示的表头
Dim t_fields As Variant     '存储列表显示的字段名
Dim t_fdxs As Variant       '表示显示列是否由代码转换成文字
Dim t_fdcounts As Integer   '表示列表所显示的字段的个数
 

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

    Dim temp_zkf 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_zkf = PUB_data.OpenRecordset("SELECT * FROM DT_ZKFDK WHERE RQ>=#" & temp_rq_s & "# AND RQ<=#" & temp_rq_e & "# ORDER BY RQ", 4, 0, 2)
    If Not temp_zkf.BOF Then
        temp_zkf.MoveLast
    End If
    
    Call flex_refresh(gd1, t_bt, temp_zkf, t_fields, t_fdcounts, t_fdxs)
    
    lb_jls.Caption = gd1.Rows - 1
    
    temp_zkf.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()

    dt_zkfdc.KeyPreview = True

    frm_msg.Visible = True
    frm_msg.Caption = ""
    
    m_year.Text = year(Date)
    m_month.Text = month(Date)

    '明细显示字段设置
    t_fields = Array("RQ", "ZK01_50", "ZK50_60", "ZK60_70", "ZK70_80", "ZK80_90", "ZK90_100") '设置显示字段
    t_fdxs = Array(0, 2, 2, 2, 2, 2, 2) '设置显示字段
    t_bt = "^日  期        |>50%以下   |>50%-60%   |>60%-70%   |>70%-80%   |>80%-90%   |>90%以上   "   '设置显示表头格式
    t_fdcounts = 7
    
    Call tPxs_ZKCX
    
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_ZKCX
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_ZKCX

End Sub

⌨️ 快捷键说明

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