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

📄 jiezhang.frm

📁 一部酒店管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form jiezhang 
   Caption         =   "退房结帐"
   ClientHeight    =   3780
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8205
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3780
   ScaleWidth      =   8205
   StartUpPosition =   3  '窗口缺省
   Begin VB.PictureBox Picture1 
      Height          =   3735
      Left            =   0
      ScaleHeight     =   3675
      ScaleWidth      =   8115
      TabIndex        =   0
      Top             =   0
      Width           =   8175
      Begin VB.Frame Frame2 
         Caption         =   "操作"
         Height          =   1455
         Left            =   5400
         TabIndex        =   19
         Top             =   2040
         Width           =   2535
         Begin VB.CommandButton Command2 
            Height          =   375
            Left            =   1440
            Picture         =   "jiezhang.frx":0000
            Style           =   1  'Graphical
            TabIndex        =   21
            Top             =   600
            Width           =   375
         End
         Begin VB.CommandButton Command1 
            Height          =   375
            Left            =   600
            Picture         =   "jiezhang.frx":065E
            Style           =   1  'Graphical
            TabIndex        =   20
            Top             =   600
            Width           =   375
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "费用总计"
         Height          =   1815
         Left            =   5400
         TabIndex        =   12
         Top             =   0
         Width           =   2535
         Begin VB.TextBox txt_yu 
            ForeColor       =   &H000000FF&
            Height          =   285
            Left            =   1080
            Locked          =   -1  'True
            TabIndex        =   18
            Top             =   1280
            Width           =   1215
         End
         Begin VB.TextBox txt_fangfei 
            Height          =   285
            Left            =   1080
            Locked          =   -1  'True
            TabIndex        =   16
            Top             =   800
            Width           =   1215
         End
         Begin VB.TextBox txt_yajin 
            Height          =   285
            Left            =   1080
            Locked          =   -1  'True
            TabIndex        =   14
            Top             =   320
            Width           =   1215
         End
         Begin VB.Label Label17 
            Caption         =   "押金余额:"
            Height          =   255
            Left            =   120
            TabIndex        =   17
            Top             =   1320
            Width           =   855
         End
         Begin VB.Label Label15 
            Caption         =   "房费总额:"
            Height          =   195
            Left            =   120
            TabIndex        =   15
            Top             =   840
            Width           =   855
         End
         Begin VB.Label Label14 
            Caption         =   "押金总额:"
            Height          =   200
            Left            =   120
            TabIndex        =   13
            Top             =   360
            Width           =   855
         End
      End
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   1455
         Left            =   120
         TabIndex        =   11
         Top             =   2040
         Width           =   5055
         _ExtentX        =   8916
         _ExtentY        =   2566
         _Version        =   393216
         Cols            =   3
         BackColorBkg    =   16777215
      End
      Begin VB.PictureBox Picture2 
         BackColor       =   &H00FFFFFF&
         Height          =   1695
         Left            =   120
         ScaleHeight     =   1635
         ScaleWidth      =   4995
         TabIndex        =   1
         Top             =   120
         Width           =   5055
         Begin VB.Label Label4 
            BackColor       =   &H00FFFFFF&
            Caption         =   "天"
            ForeColor       =   &H00FF0000&
            Height          =   200
            Left            =   3480
            TabIndex        =   22
            Top             =   1080
            Width           =   495
         End
         Begin VB.Line Line3 
            X1              =   120
            X2              =   4920
            Y1              =   1320
            Y2              =   1320
         End
         Begin VB.Label lbl_tian 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Label9"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   3000
            TabIndex        =   10
            Top             =   1080
            Width           =   375
         End
         Begin VB.Label Label8 
            BackColor       =   &H00FFFFFF&
            Caption         =   "预住天数:"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   2160
            TabIndex        =   9
            Top             =   1080
            Width           =   855
         End
         Begin VB.Label lbl_name 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Label7"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   840
            TabIndex        =   8
            Top             =   1080
            Width           =   975
         End
         Begin VB.Label Label6 
            BackColor       =   &H00FFFFFF&
            Caption         =   "登记人:"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   120
            TabIndex        =   7
            Top             =   1080
            Width           =   735
         End
         Begin VB.Line Line2 
            X1              =   120
            X2              =   4920
            Y1              =   840
            Y2              =   840
         End
         Begin VB.Line Line1 
            X1              =   480
            X2              =   3840
            Y1              =   360
            Y2              =   360
         End
         Begin VB.Label lbl_time 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Label5"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   3000
            TabIndex        =   6
            Top             =   600
            Width           =   1695
         End
         Begin VB.Label lbl_no 
            BackColor       =   &H00FFFFFF&
            Caption         =   "Label4"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   600
            TabIndex        =   5
            Top             =   600
            Width           =   1335
         End
         Begin VB.Label Label3 
            BackColor       =   &H00FFFFFF&
            Caption         =   "入住时间:"
            ForeColor       =   &H00FF0000&
            Height          =   195
            Left            =   2160
            TabIndex        =   4
            Top             =   600
            Width           =   855
         End
         Begin VB.Label Label2 
            BackColor       =   &H00FFFFFF&
            Caption         =   "帐号:"
            ForeColor       =   &H00FF0000&
            Height          =   255
            Left            =   120
            TabIndex        =   3
            Top             =   600
            Width           =   855
         End
         Begin VB.Label Label1 
            BackColor       =   &H00FFFFFF&
            Caption         =   "旅客帐单"
            BeginProperty Font 
               Name            =   "楷体_GB2312"
               Size            =   14.25
               Charset         =   134
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00FF0000&
            Height          =   315
            Left            =   1560
            TabIndex        =   2
            Top             =   0
            Width           =   1815
         End
      End
   End
End
Attribute VB_Name = "jiezhang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub Command1_Click()
    
    Call LeaveHouse
    Unload Me
    tuifang.Show
End Sub

Private Sub Command2_Click()
    
    Unload Me
    tuifang.Show vbModal
End Sub

Private Sub Form_Load()

    '窗口居中
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2 - 550
    
    '初始化表格窗体
    MSFlexGrid1.ColWidth(0) = 500
    MSFlexGrid1.ColWidth(1) = 1000
    MSFlexGrid1.ColWidth(2) = 1000

    '初始化表格名称
    MSFlexGrid1.TextMatrix(0, 0) = ""
    MSFlexGrid1.TextMatrix(0, 1) = "房间号"
    MSFlexGrid1.TextMatrix(0, 2) = "人数"
    
    
    Call LoadMoney
    Call LoadHouse
    
End Sub


Private Sub LoadMoney()

    Dim str As String
    str = "select * from guestinfo,house,housekind where guestinfo.numb='" & m_no & "' and house.nam=guestinfo.houseno and house.kind=housekind.kind"
    
    Dim myrs As ADODB.Recordset
    Set myrs = New ADODB.Recordset
    
    myrs.CursorLocation = adUseClient
    myrs.LockType = adLockOptimistic
    myrs.CursorType = adOpenDynamic
    myrs.Open str, myCon
      
    Dim sum As Integer '保存总钱数
    sum = 0
    While Not myrs.EOF
         sum = sum + Int(myrs("jiage"))
         myrs.MoveNext
    Wend
    
    If Int(m_day) = 0 Then
        m_day = 1
    End If
    
    txt_yajin.Text = m_yajin
    txt_fangfei.Text = sum * Int(m_day)
    txt_yu.Text = Int(txt_yajin.Text) - Int(txt_fangfei.Text)
    
End Sub


Private Sub LoadHouse()

    Dim str As String
    str = "select * from guestinfo where numb='" & m_no & "'"
    
    Dim myrs As ADODB.Recordset
    Set myrs = New ADODB.Recordset
    
    myrs.CursorLocation = adUseClient
    myrs.LockType = adLockOptimistic
    myrs.CursorType = adOpenDynamic
    myrs.Open str, myCon
      
    Dim m_row As Integer
    m_row = myrs.RecordCount
    
    MSFlexGrid1.Rows = MSFlexGrid1.Rows + m_row - 1
    Dim m As Integer
    
    For m = 1 To m_row
         MSFlexGrid1.TextMatrix(m, 1) = myrs("houseno")
         MSFlexGrid1.TextMatrix(m, 2) = myrs("sums")
         myrs.MoveNext
    Next
    
End Sub

'旅客退房
Private Sub LeaveHouse()
    
    Dim m_row As Integer
    m_row = MSFlexGrid1.Rows - 1
    
    Dim m As Integer
    Dim m_num As Integer '房间号
    Dim str As String
    
    For m = 1 To m_row
    
        m_num = MSFlexGrid1.TextMatrix(m, 1)
        str = "update house set kong='0',xingbie='2',man='0',zhu='0',ding='0' where nam='" & m_num & "'"
        myCon.Execute (str)
    
    Next
    
    
    str = "delete from guest where numb='" & lbl_no & "'"
    myCon.Execute (str)
    
    str = "delete from guestinfo where numb='" & lbl_no & "'"
    myCon.Execute (str)
    
End Sub

⌨️ 快捷键说明

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