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

📄 frmroomtypeedit.frm

📁 酒店管理系统 基于VB和SQL的一个很好的程序 可以实现酒店的日常管理工作
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmRoomTypeEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑房间类型信息"
   ClientHeight    =   4455
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3900
   Icon            =   "FrmRoomTypeEdit.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4455
   ScaleWidth      =   3900
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame4 
      Caption         =   "电视"
      Height          =   735
      Left            =   240
      TabIndex        =   22
      Top             =   2040
      Width           =   1695
      Begin VB.OptionButton Option5 
         Caption         =   "有"
         Height          =   375
         Left            =   240
         TabIndex        =   7
         Top             =   240
         Width           =   495
      End
      Begin VB.OptionButton Option6 
         Caption         =   "无"
         Height          =   375
         Left            =   960
         TabIndex        =   8
         Top             =   240
         Width           =   495
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "电话"
      Height          =   735
      Left            =   2040
      TabIndex        =   21
      Top             =   1200
      Width           =   1695
      Begin VB.OptionButton Option3 
         Caption         =   "有"
         Height          =   375
         Left            =   240
         TabIndex        =   5
         Top             =   240
         Width           =   495
      End
      Begin VB.OptionButton Option4 
         Caption         =   "无"
         Height          =   375
         Left            =   960
         TabIndex        =   6
         Top             =   240
         Width           =   495
      End
   End
   Begin VB.Frame Frame5 
      Caption         =   "独立卫生间"
      Height          =   735
      Left            =   2040
      TabIndex        =   20
      Top             =   2040
      Width           =   1695
      Begin VB.OptionButton Option7 
         Caption         =   "有"
         Height          =   375
         Left            =   240
         TabIndex        =   9
         Top             =   240
         Width           =   495
      End
      Begin VB.OptionButton Option8 
         Caption         =   "无"
         Height          =   375
         Left            =   960
         TabIndex        =   10
         Top             =   240
         Width           =   495
      End
   End
   Begin VB.Frame Frame6 
      Caption         =   "冰箱"
      Height          =   735
      Left            =   240
      TabIndex        =   19
      Top             =   2880
      Width           =   1695
      Begin VB.OptionButton Option9 
         Caption         =   "有"
         Height          =   375
         Left            =   240
         TabIndex        =   11
         Top             =   240
         Width           =   495
      End
      Begin VB.OptionButton Option10 
         Caption         =   "无"
         Height          =   375
         Left            =   960
         TabIndex        =   12
         Top             =   240
         Width           =   495
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "空调"
      Height          =   735
      Left            =   240
      TabIndex        =   18
      Top             =   1200
      Width           =   1695
      Begin VB.OptionButton Option2 
         Caption         =   "无"
         Height          =   375
         Left            =   960
         TabIndex        =   4
         Top             =   263
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "有"
         Height          =   375
         Left            =   240
         TabIndex        =   3
         Top             =   240
         Width           =   495
      End
   End
   Begin VB.TextBox txtBnum 
      Alignment       =   1  'Right Justify
      Height          =   270
      Left            =   1200
      MaxLength       =   50
      TabIndex        =   1
      Top             =   720
      Width           =   615
   End
   Begin VB.TextBox txtRnum 
      Alignment       =   1  'Right Justify
      Height          =   270
      Left            =   3120
      MaxLength       =   50
      TabIndex        =   2
      Top             =   720
      Width           =   615
   End
   Begin VB.TextBox txtRtype 
      Alignment       =   1  'Right Justify
      Height          =   270
      Left            =   1200
      MaxLength       =   50
      TabIndex        =   0
      Top             =   240
      Width           =   2535
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Height          =   495
      Left            =   1320
      TabIndex        =   13
      Top             =   3840
      Width           =   1095
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取 消"
      Height          =   495
      Left            =   2640
      TabIndex        =   14
      Top             =   3840
      Width           =   1095
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "床位数量"
      Height          =   180
      Left            =   240
      TabIndex        =   17
      Top             =   720
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "房间数量"
      Height          =   180
      Left            =   2160
      TabIndex        =   16
      Top             =   720
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "房间类型"
      Height          =   180
      Left            =   240
      TabIndex        =   15
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "FrmRoomTypeEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriTypeId As String '修改状态时,房间类型记录中原有的类型编号。这是此记录的标识
Public OriType As String '原房间类型名称
Public Modify As Boolean

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  '检查用户录入的数据是否完全有效
  '客房类型、房间数量、床位数量是必须输入的
  If Trim(txtRtype) = "" Then
    MsgBox "请输入客房类型"
    txtRtype.SetFocus
    Exit Sub
  End If
  If Trim(txtRnum) = "" Then
    MsgBox "请输入房间数量"
    txtRnum.SetFocus
    Exit Sub
  End If
  If Trim(txtBnum) = "" Then
    MsgBox "请输入床位数量"
    txtBnum.SetFocus
    Exit Sub
  End If
  '把用户录入的数据赋值到MyRoomType对象中,并保存到数据库
  With MyRoomType
  .TypeName = MakeStr(txtRtype.Text)  '==客房类型
  .RoomNum = Val(txtRnum)   '==房间数量
  .Bednum = Val(txtBnum)  '==床位数量
  If Option1.Value = True Then '==空调
    .AirConditioning = 1
  Else
    .AirConditioning = 0
  End If
  If Option3.Value = True Then '==电话
    .Tel = 1
  Else
    .Tel = 0
  End If
  If Option5.Value = True Then '==电视
    .Tv = 1
  Else
    .Tv = 0
  End If
  If Option7.Value = True Then '==独立卫生间
    .Toilet = 1
  Else
    .Toilet = 0
  End If
  If Option9.Value = True Then '==冰箱
    .IceBox = 1
  Else
    .IceBox = 0
  End If
  'Modify=False表示当前为插入新数据状态;否则为修改数据状态
  If Modify = False Then
    '判断当前房间类型是否存在
    If .In_DB(.TypeName) = True Then
      MsgBox "当前房间类型已经存在"
      Exit Sub
    End If
    .Insert
  Else
    If .TypeName <> OriType Then
      '判断当前客户是否存在
      If .In_DB(.TypeName) = True Then
        MsgBox "当前房间类型已经存在"
        Exit Sub
      End If
    End If
    .Update (OriTypeId)
  End If
  End With
  
  Unload Me
End Sub

Private Sub txtBnum_KeyPress(KeyAscii As Integer)
  If In_Int(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtRnum_KeyPress(KeyAscii As Integer)
  If In_Int(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

⌨️ 快捷键说明

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