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

📄 frmbkjz.frm

📁 宾馆管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{74848F95-A02A-4286-AF0C-A3C755E4A5B3}#1.0#0"; "actskn43.ocx"
Begin VB.Form frmBKJZ 
   Caption         =   "宾客结帐"
   ClientHeight    =   6630
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6840
   LinkTopic       =   "Form1"
   ScaleHeight     =   6630
   ScaleWidth      =   6840
   StartUpPosition =   1  '所有者中心
   Begin ACTIVESKINLibCtl.Skin sknBKJZ 
      Left            =   120
      OleObjectBlob   =   "frmBKJZ.frx":0000
      Top             =   840
   End
   Begin VB.Frame Frame2 
      Height          =   5175
      Left            =   480
      TabIndex        =   3
      Top             =   1080
      Width           =   5895
      Begin VB.CommandButton Command4 
         Caption         =   "刷新"
         Height          =   495
         Left            =   2520
         TabIndex        =   16
         Top             =   4440
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Caption         =   "退出"
         Height          =   495
         Left            =   4200
         TabIndex        =   15
         Top             =   4440
         Width           =   1575
      End
      Begin VB.CommandButton Command2 
         Caption         =   "付账"
         Height          =   495
         Left            =   480
         TabIndex        =   14
         Top             =   4440
         Width           =   1575
      End
      Begin VB.TextBox Text6 
         Enabled         =   0   'False
         Height          =   375
         Left            =   2520
         TabIndex        =   13
         Top             =   2160
         Width           =   1695
      End
      Begin VB.TextBox Text5 
         Enabled         =   0   'False
         Height          =   375
         Left            =   2520
         TabIndex        =   11
         Top             =   1440
         Width           =   1695
      End
      Begin VB.TextBox Text4 
         Enabled         =   0   'False
         Height          =   375
         Left            =   2520
         TabIndex        =   9
         Top             =   600
         Width           =   1695
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   2520
         TabIndex        =   7
         Top             =   3600
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   2520
         TabIndex        =   5
         Top             =   2880
         Width           =   1695
      End
      Begin ACTIVESKINLibCtl.SkinLabel lbl1 
         Height          =   375
         Left            =   1080
         OleObjectBlob   =   "frmBKJZ.frx":0234
         TabIndex        =   4
         Top             =   2880
         Width           =   1215
      End
      Begin ACTIVESKINLibCtl.SkinLabel lbl3 
         Height          =   375
         Left            =   1560
         OleObjectBlob   =   "frmBKJZ.frx":029C
         TabIndex        =   6
         Top             =   3600
         Width           =   735
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel1 
         Height          =   375
         Left            =   1080
         OleObjectBlob   =   "frmBKJZ.frx":0300
         TabIndex        =   8
         Top             =   600
         Width           =   1215
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel2 
         Height          =   495
         Left            =   1080
         OleObjectBlob   =   "frmBKJZ.frx":0368
         TabIndex        =   10
         Top             =   1320
         Width           =   1335
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel3 
         Height          =   375
         Left            =   1320
         OleObjectBlob   =   "frmBKJZ.frx":03D0
         TabIndex        =   12
         Top             =   2160
         Width           =   975
      End
   End
   Begin VB.Frame Frame1 
      Height          =   735
      Left            =   480
      TabIndex        =   0
      Top             =   0
      Width           =   5895
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel4 
         Height          =   375
         Left            =   1320
         OleObjectBlob   =   "frmBKJZ.frx":0436
         TabIndex        =   17
         Top             =   240
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   4560
         TabIndex        =   2
         Top             =   240
         Width           =   1215
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   2520
         TabIndex        =   1
         Top             =   240
         Width           =   1695
      End
   End
End
Attribute VB_Name = "frmBKJZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '显示餐饮消费,住宿费,总消费
If Text3.Text = "" Then
    MsgBox "请认真填完所有的表格!"
    Exit Sub
Else
' 根据房间号搜索该房客的餐饮食品消费
Dim rstl As ADODB.Recordset
txtsql = "select * from tbEat where cRoomNo='" & Text3.Text & "'"
Set rstl = ExecuteSQL(txtsql)
If Not rstl.EOF Then
    Dim rs As New ADODB.Recordset
    txtsql = "select sum(mFoodPrice) from tbEat where cRoomNo='" & Text3.Text & "'"
    Set rs = ExecuteSQL(txtsql)
    Text4.Text = rs.GetString
    rs.Close
End If
    
'计算房客的入住天数
Dim a, b, c As Integer
txtsql = "select * from tbSK_Book where cRoomNo='" & Text3.Text & "'"
Set rs = ExecuteSQL(txtsql)
If Not rs.EOF Then
    a = Format(Now, "mm") - Format(rs.Fields(7), "mm")
    b = Format(Now, "dd") - Format(rs.Fields(7), "dd")
    c = a * 30 + b + 1
    rs.Close

'每层楼的房价不同,房价*天数是客户的住宿费
Dim rst As New ADODB.Recordset
If Text3.Text <= 8 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第一层'"
    Set rst = ExecuteSQL(txtsql)
    Text5.Text = rst!mRoomPrice * c
    rst.Close
ElseIf Text3.Text <= 16 And Text3.Text > 8 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第二层'"
    Set rst = ExecuteSQL(txtsql)
    Text5.Text = rst!mRoomPrice * c
    rst.Close
ElseIf Text3.Text > 16 And Text3.Text <= 24 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第三层'"
    Set rst = ExecuteSQL(txtsql)
    Text5.Text = rst!mRoomPrice * c
    rst.Close
ElseIf Text3.Text > 24 And Text3.Text <= 32 Then
    txtsql = "select mRoomPrice from tbRoomPrice where cRoomStory='第四层'"
    Set rst = ExecuteSQL(txtsql)
    Text5.Text = rst!mRoomPrice * c
    rst.Close
End If
Else
    MsgBox "此房间没有人居住!"
    Unload Me
End If
rstl.Close
End If

'房客的总消费
Dim e, d As Integer
e = Text5.Text
d = Text4.Text
Text6.Text = e + d
End Sub

Private Sub Command2_Click()
If Text1.Text = "" Then
MsgBox "请认真填完所有的表格!"
Else
Text2.Text = Text1.Text - Text6.Text  '找零


Dim rstg As New ADODB.Recordset
    txtsql = "delete tbEat where cRoomNo='" & Text3.Text & "'" '栓出该客户的餐饮消费记录
    Set rstg = ExecuteSQL(txtsql)
    
Dim rst As New ADODB.Recordset
    txtsql = "delete tbSK_Book where  cRoomNo='" & Text3.Text & "'"  '以示该客户离店,空出房间
    Set rst = ExecuteSQL(txtsql)
            
End If
End Sub


Private Sub Command3_Click() '刷新窗体
Unload mdiHotelmain
Load mdiHotelmain
mdiHotelmain.Show
Unload Me
End Sub

Private Sub Command4_Click()
Unload Me
frmBKJZ.Show
End Sub

Private Sub Form_Load()

Call changeskin(Me, sknBKJZ, strSkin)
Text4.Text = 0
Text5.Text = 0
End Sub

⌨️ 快捷键说明

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