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

📄 frmroom.frm

📁 用VB编写的酒店管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmRoom 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "房态查看"
   ClientHeight    =   4095
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6375
   Icon            =   "FrmRoom.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4095
   ScaleWidth      =   6375
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txt_Card 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   15
      Top             =   2040
      Width           =   4335
   End
   Begin VB.PictureBox CmdFresh 
      Height          =   495
      Left            =   1080
      ScaleHeight     =   435
      ScaleWidth      =   1155
      TabIndex        =   16
      ToolTipText     =   "清空"
      Top             =   3480
      Width           =   1215
   End
   Begin VB.TextBox txt_Remark 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   13
      Top             =   2640
      Width           =   4335
   End
   Begin VB.TextBox txt_Sex 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   11
      Top             =   1440
      Width           =   1455
   End
   Begin VB.TextBox txt_name 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   10
      Top             =   840
      Width           =   1455
   End
   Begin VB.TextBox txt_Sheng 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   7
      Top             =   1440
      Width           =   1455
   End
   Begin VB.TextBox txt_Zhu 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   6
      Top             =   840
      Width           =   1455
   End
   Begin VB.TextBox txt_Chang 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   3
      Top             =   240
      Width           =   1455
   End
   Begin VB.ComboBox cmb_RoomNo 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   1560
      TabIndex        =   0
      Top             =   240
      Width           =   1455
   End
   Begin VB.PictureBox CmdExit 
      Height          =   495
      Left            =   4440
      ScaleHeight     =   435
      ScaleWidth      =   1155
      TabIndex        =   17
      ToolTipText     =   "关闭"
      Top             =   3480
      Width           =   1215
   End
   Begin VB.Label Label8 
      Caption         =   "身 份 证:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   14
      Top             =   2160
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "备    注:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   12
      Top             =   2760
      Width           =   1095
   End
   Begin VB.Shape Shape1 
      Height          =   4095
      Left            =   0
      Top             =   0
      Width           =   6375
   End
   Begin VB.Label Label7 
      Caption         =   "性    别:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   9
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label6 
      Caption         =   "姓    名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   8
      Top             =   960
      Width           =   975
   End
   Begin VB.Label Label5 
      Caption         =   "剩余床位:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3360
      TabIndex        =   5
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label4 
      Caption         =   "实住床位:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3360
      TabIndex        =   4
      Top             =   960
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "床    位:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3360
      TabIndex        =   2
      Top             =   360
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "客房编号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   1
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "FrmRoom"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sqlstr As String
Dim msgstr As String
Dim rs As ADODB.Recordset
Private Sub cmdClose_Click()
Unload Me
End Sub

Private Sub cmb_RoomNo_Click()
If cmb_RoomNo.Text <> "" Then
sqlstr = "select a.客房编号,b.姓名,b.性别, a.身份证,a.已住床位+a.剩余床位 as 床位,a.已住床位,a.剩余床位,b.备注  from room_info a ,accomm_info b where  a.客房编号=b.客房编号  and a.客房编号='" & cmb_RoomNo.Text & "'"
  Set rs = ExecuteSQL(sqlstr, msgstr)
     If rs.EOF Then
        MsgBox "此房间无人居住!"
        
        cmb_RoomNo.Text = ""
        txt_Chang.Text = ""
        txt_name.Text = ""
        txt_Sex.Text = ""
        txt_Zhu.Text = ""
        txt_Sheng.Text = ""
        txt_Remark.Text = ""
        txt_Card.Text = ""
        Exit Sub
        Else
   If IsNull(rs.Fields("客房编号")) Then
    cmb_RoomNo.Text = ""
  Else
    cmb_RoomNo.Text = rs.Fields("客房编号")
  End If

  If IsNull(rs.Fields("姓名")) Then
    txt_name.Text = ""
  Else
    txt_name.Text = rs.Fields("姓名")
  End If
  If IsNull(rs.Fields("性别")) Then
    txt_Sex.Text = ""
  Else
    txt_Sex.Text = rs.Fields("性别")
  End If
  If IsNull(rs.Fields("身份证")) Then
    txt_Card.Text = ""
  Else
    txt_Card.Text = rs.Fields("身份证")
  End If
  If IsNull(rs.Fields("床位")) Then
    txt_Chang.Text = ""
  Else
    txt_Chang.Text = rs.Fields("床位")
  End If
  If IsNull(rs.Fields("已住床位")) Then
    txt_Zhu.Text = ""
  Else
    txt_Zhu.Text = rs.Fields("已住床位")
  End If
  If IsNull(rs.Fields("剩余床位")) Then
    txt_Sheng.Text = ""
  Else
    txt_Sheng.Text = rs.Fields("剩余床位")
  End If
'  If IsNull(rs.Fields("备注")) Then
'    txt_Remark.Text = ""
'  Else
'    txt_Remark.Text = rs.Fields("备注")
'  End If
  If Val(Trim(txt_Sheng.Text)) > 0 Then
    txt_Remark.Text = "还有" & Trim(txt_Sheng.Text) & "张床位"
  Else
     txt_Remark.Text = "没有床位了!"
  End If
    
    End If

End If
End Sub

Private Sub CmdExit_Click()
Unload Me
End Sub

Private Sub cmdFresh_Click()
cmb_RoomNo.Text = ""
txt_Chang.Text = ""
txt_name.Text = ""
txt_Sex.Text = ""
txt_Zhu.Text = ""
txt_Sheng.Text = ""
txt_Remark.Text = ""
txt_Card.Text = ""
End Sub

Private Sub Form_Load()
'按客房编号 全部查找出来
Dim i As Integer
 sqlstr = "select 客房编号 from guestroom_info"
 Set rs = ExecuteSQL(sqlstr, msgstr)
Do While Not rs.EOF
 cmb_RoomNo.List(i) = rs.Fields("客房编号")
 rs.MoveNext
 i = i + 1
Loop
rs.Close

End Sub


⌨️ 快捷键说明

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