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

📄 main_tf.frm

📁 宾馆客房管理系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   270
         Left            =   5670
         TabIndex        =   39
         Top             =   2865
         Visible         =   0   'False
         Width           =   945
      End
      Begin VB.Label Lab9 
         BackStyle       =   0  'Transparent
         Caption         =   "附 加 费"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   31
         Top             =   2835
         Width           =   1170
      End
      Begin VB.Label Lab12 
         BackStyle       =   0  'Transparent
         Caption         =   "备    注"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   27
         Top             =   3765
         Width           =   1335
      End
      Begin VB.Label Lab7 
         BackStyle       =   0  'Transparent
         Caption         =   "实住天数             宿费"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   26
         Top             =   2415
         Width           =   4545
      End
      Begin VB.Label Lab5 
         BackStyle       =   0  'Transparent
         Caption         =   "联系地址"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   25
         Top             =   1530
         Width           =   1065
      End
      Begin VB.Label Lab4 
         BackStyle       =   0  'Transparent
         Caption         =   "姓    名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   24
         Top             =   1095
         Width           =   1110
      End
      Begin VB.Label Lab8 
         BackStyle       =   0  'Transparent
         Caption         =   "%"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   18
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   315
         Left            =   9240
         TabIndex        =   23
         Top             =   2340
         Width           =   300
      End
      Begin VB.Label Lab1 
         BackStyle       =   0  'Transparent
         Caption         =   "凭证号码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   22
         Top             =   615
         Width           =   1065
      End
      Begin VB.Label Lab6 
         BackStyle       =   0  'Transparent
         Caption         =   "房 间 号             客房类型            客房价格"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   28
         Top             =   1965
         Width           =   7725
      End
      Begin VB.Label Lab11 
         BackStyle       =   0  'Transparent
         Caption         =   "实收金额                 押金               退还金额"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   210
         TabIndex        =   29
         Top             =   3315
         Width           =   7620
      End
   End
   Begin VB.TextBox czy 
      BackColor       =   &H80000004&
      BorderStyle     =   0  'None
      Height          =   225
      Left            =   795
      TabIndex        =   7
      Top             =   4935
      Width           =   1290
   End
   Begin VB.CommandButton Comdj 
      BackColor       =   &H00C0C0C0&
      Caption         =   "登记"
      Height          =   300
      Left            =   3435
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   4950
      Width           =   1155
   End
   Begin VB.CommandButton Comprint 
      BackColor       =   &H00C0C0C0&
      Caption         =   "打印"
      Enabled         =   0   'False
      Height          =   300
      Left            =   7320
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   4950
      Width           =   1155
   End
   Begin VB.CommandButton Comend 
      BackColor       =   &H00C0C0C0&
      Caption         =   "退出"
      Height          =   300
      Left            =   8610
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   4950
      Width           =   1155
   End
   Begin VB.CommandButton Comok 
      BackColor       =   &H00C0C0C0&
      Caption         =   "确定"
      Enabled         =   0   'False
      Height          =   300
      Left            =   4725
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   4950
      Width           =   1155
   End
   Begin VB.CommandButton Comcancel 
      BackColor       =   &H00C0C0C0&
      Caption         =   "取消"
      Height          =   300
      Left            =   6030
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   4950
      Width           =   1155
   End
   Begin VB.Label Lab14 
      BackStyle       =   0  'Transparent
      Caption         =   "操作员:"
      Height          =   315
      Left            =   75
      TabIndex        =   6
      Top             =   4950
      Width           =   735
   End
End
Attribute VB_Name = "main_tf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DBcnn As New ADODB.Connection
Dim DBrs1 As New ADODB.Recordset
Dim DBrs2 As New ADODB.Recordset
Dim DBrs3 As New ADODB.Recordset
Dim DBrs4 As New ADODB.Recordset
Dim DBrs5 As New ADODB.Recordset
Dim sqlstr As String

'定义计算住宿天数的函数
Public Sub JS()
 '判断退宿时间是否大于住宿时间
 If DTP2.Value > DTP1.Value Then
    '退宿时间大于住宿时间,接着判断住宿时间是否超过中午
   If tim2.Value > #11:59:00 PM# Then
     If tim2.Value > #12:00:00 PM# Then
       If tim2.Value > #6:00:00 PM# Then
         Texts.Text = DTP2.Value - DTP1.Value + 1
       Else
         Texts.Text = DTP2.Value - DTP1.Value + 0.5
       End If
     Else
       Texts.Text = DTP2.Value - DTP1.Value
     End If
   Else
     Texts.Text = DTP2.Value - DTP1.Value
   End If
 Else
 If tim1.Value < #2:00:00 AM# Then
   If tim2.Value > #2:00:00 AM# Then
     If tim2.Value > #12:00:00 PM# Then
       If tim2.Value > #6:00:00 PM# Then
         Texts.Text = 1 + 1
       Else
         Texts.Text = 1 + 0.5
       End If
     Else
       Texts.Text = 1
     End If
   Else
     Texts.Text = 1
   End If
  Else
   Texts.Text = 1
  End If
 End If
End Sub
Public Sub ssje()     '定义计算实收金额和退还金额的函数
 Texssje.Text = Val(Texzhje.Text) + Val(Texzf.Text) + Val(Texdhf.Text) + Val(Texpcf.Text) + Val(Texhyf.Text) + Val(Textcf.Text)
 Texthje.Text = Val(Texyj.Text) - Val(Texssje.Text)
End Sub
Private Sub Form_Load()
If DBcnn.State = 0 Then
    Dim connectstr As String
    connectstr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
               App.Path & "\KFGL.mdb;Persist Security Info=False"
    DBcnn.CursorLocation = adUseClient
    DBcnn.Open connectstr
 End If

 If DBrs1.State = 1 Then
    DBrs1.Close
 End If
 sqlstr = "select * from djb"
 DBrs1.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
 
 If DBrs1.State = 1 Then
    DBrs1.Close
 End If
 sqlstr = "select * from djb"
 DBrs1.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic

If DBrs2.State = 1 Then
    DBrs2.Close
 End If
 sqlstr = "select * from kf"
 DBrs2.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic

If DBrs3.State = 1 Then
    DBrs3.Close
 End If
 sqlstr = "select * from gzmx order by 日期,时间"
 DBrs3.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic

If DBrs4.State = 1 Then
    DBrs4.Close
 End If
 sqlstr = "select * from djys"
 DBrs4.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
 
 If DBrs5.State = 1 Then
    DBrs5.Close
 End If
 sqlstr = "select * from djb order by 凭证号码"
 DBrs5.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
End Sub
Private Sub Form_Activate()
 czy.Text = main.StatusBar1.Panels(4).Text     '赋值给czy
 DTP2.Value = Date: tim2.Value = Time
 '查询住宿登记信息
 sqlstr = "标志='1'"
 DBrs5.Filter = sqlstr
 'Data5.RecordSource = "select 凭证号码 from djb where 标志='1'order by 凭证号码"
 'Data5.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
 main.Enabled = True     '设置主窗体有效
End Sub
Private Sub Dcomkflx_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then Dcomkfjg.SetFocus      '按回车键Dcomkfjg获得焦点
End Sub
Private Sub Dcomkfjg_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then DTP1.SetFocus     '按回车键DTP1获得焦点
End Sub
Private Sub Combo2_Click()
If Combo2.Text = "折扣" Then
  Texzk.Text = 100     '赋值给Texzk.text
 Else
  Texzk.Text = 0
End If
If Combo2.Text = "挂帐" Then
  Lab10.Visible = True
  Texgzdw.Visible = True
  Texgzdw.Text = Texxm.Text     '赋值给Texxm.text
Else
  Lab10.Visible = False
  Texgzdw.Visible = False     '设置Texgzdw不可见
  Texgzdw.Text = ""
End If
End Sub
Private Sub Combo3_Click()
 Texfjf.SetFocus     'Texfjf获得焦点
 Texfjf.Text = "0"     '赋值给Texfjf.text
End Sub
Private Sub Dcompzhm_Change()
 '判断输入的凭证号码是否为空
 If Dcompzhm.Text <> "" Then
 '输入的凭证号码不为空

⌨️ 快捷键说明

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