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

📄 frmkfbztj.frm

📁 宾馆管理系统 宾馆管理系统 宾馆管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmKfbztj 
   Caption         =   "客房标准添加"
   ClientHeight    =   3420
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6360
   LinkTopic       =   "Form1"
   ScaleHeight     =   3420
   ScaleWidth      =   6360
   StartUpPosition =   3  '窗口缺省
   WindowState     =   1  'Minimized
   Begin VB.Frame Frame1 
      Caption         =   "客房标准"
      Height          =   2415
      Left            =   120
      TabIndex        =   2
      Top             =   0
      Width           =   6015
      Begin VB.TextBox txtItem 
         Height          =   270
         Index           =   4
         Left            =   960
         TabIndex        =   21
         Top             =   1800
         Width           =   1455
      End
      Begin VB.TextBox txtItem 
         Height          =   270
         Index           =   3
         Left            =   960
         TabIndex        =   20
         Top             =   1440
         Width           =   1455
      End
      Begin VB.TextBox txtItem 
         Height          =   270
         Index           =   2
         Left            =   960
         TabIndex        =   19
         Top             =   1080
         Width           =   1455
      End
      Begin VB.TextBox txtItem 
         Height          =   270
         Index           =   1
         Left            =   960
         TabIndex        =   18
         Top             =   720
         Width           =   1455
      End
      Begin VB.TextBox txtItem 
         Height          =   270
         Index           =   0
         Left            =   960
         TabIndex        =   7
         Top             =   360
         Width           =   1455
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Index           =   0
         ItemData        =   "frmKfbztj.frx":0000
         Left            =   4920
         List            =   "frmKfbztj.frx":000A
         TabIndex        =   6
         Text            =   "否"
         Top             =   240
         Width           =   855
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Index           =   1
         ItemData        =   "frmKfbztj.frx":0016
         Left            =   4920
         List            =   "frmKfbztj.frx":0020
         TabIndex        =   5
         Text            =   "否"
         Top             =   600
         Width           =   855
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Index           =   2
         ItemData        =   "frmKfbztj.frx":002C
         Left            =   4920
         List            =   "frmKfbztj.frx":0036
         TabIndex        =   4
         Text            =   "否"
         Top             =   960
         Width           =   855
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Index           =   3
         ItemData        =   "frmKfbztj.frx":0042
         Left            =   4920
         List            =   "frmKfbztj.frx":004C
         TabIndex        =   3
         Text            =   "否"
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "标准编号:"
         Height          =   255
         Left            =   120
         TabIndex        =   17
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "标准名称:"
         Height          =   255
         Left            =   120
         TabIndex        =   16
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "房间面积:"
         Height          =   255
         Left            =   120
         TabIndex        =   15
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "床位数量:"
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label5 
         Caption         =   "住房单价:"
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   1800
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "/每天"
         Height          =   375
         Left            =   2520
         TabIndex        =   12
         Top             =   1800
         Width           =   375
      End
      Begin VB.Label Label7 
         Caption         =   "是否有空调"
         Height          =   255
         Left            =   3600
         TabIndex        =   11
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label8 
         Caption         =   "是否有电话"
         Height          =   255
         Left            =   3600
         TabIndex        =   10
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label9 
         Caption         =   "是否有电视"
         Height          =   255
         Left            =   3600
         TabIndex        =   9
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label10 
         Caption         =   "是否有卫生间"
         Height          =   255
         Left            =   3600
         TabIndex        =   8
         Top             =   1440
         Width           =   1095
      End
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "保 存"
      Height          =   375
      Left            =   1560
      TabIndex        =   1
      Top             =   2880
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返 回"
      Height          =   375
      Left            =   3600
      TabIndex        =   0
      Top             =   2880
      Width           =   855
   End
End
Attribute VB_Name = "frmKfbztj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mblChange As Boolean
Dim mrc As ADODB.Recordset
Public txtSQL As String

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub form_load()
 Dim intCount As Integer
 Dim MsgText As String
 Dim i As Integer
 
  If gintTmode = 1 Then
      Me.Caption = Me.Caption & "添加"
      For i = 0 To 3
         Combo1(i).AddItem "否"
         Combo1(i).AddItem "是"
         Combo1(i).ListIndex = 0
      Next i
  ElseIf gintTmode = 2 Then
    Set mrc = ExecuteSQL(txtSQL, MsgText)
      If mrc.EOF = False Then
        With mrc
          For intCount = 0 To 3
             txtItem(intCount) = .Fields(intCount)
          Next intCount
          txtItem(4) = .Fields(8)
        For i = 0 To 3
           Combo1(i).AddItem "否"
           Combo1(i).AddItem "是"
    If .Fields(4 + i).Value = "否" Then
           Combo1(i).ListIndex = 0
        Else
           Combo1(i).ListIndex = 1
        End If
        Next i
      End With
      txtItem(0).Enabled = False
     End If
      'Me.Capion = Me.Caption & "修改"
    End If
  mblChange = False
             
End Sub
Private Sub cmdSave_click()
  Dim intCount As Integer
  Dim sMeg As String
  Dim MsgText As String
  
  For intCount = 0 To 4
     If Trim(txtItem(intCount) & "") = "" Then
        Select Case intCount
            Case 0
              sMeg = "标准编号"
            Case 1
              sMeg = "标准名称"
            Case 2
              sMeg = "房间面积"
            Case 3
              sMeg = "床位数量"
            Case 4
              sMeg = "床位单价"
        End Select
        sMeg = sMeg & "不能为空!"
        MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
        txtItem(intCount).SetFocus
        Exit Sub
    End If
 Next intCount
 
 For intCount = 2 To 4
    If Not IsNumeric(Trim(txtItem(intCount))) Then
      Select Case intCount
         Case 2
           sMeg = "房间面积"
         Case 3
           sMeg = "床位数量"
         Case 4
           sMeg = "床位单价"
      End Select
      sMeg = sMeg & " 请输入数字!"
      MsgBox sMeg, vbOKOnly + vbExclamation, "警告"
      txtItem(intCount).SetFocus
      Exit Sub
   End If
Next intCount

 If gintTmode = 1 Then
   txtSQL = "select * from roomtype where typeid='" & Trim(txtItem(0)) & "'"
   Set mrc = ExecuteSQL(txtSQL, MsgText)
   If mrc.EOF = False Then
      MsgBox "已经存在此标准编号的记录!", vbOKOnly + vbExclamation, "警告"
      txtItem(0).SetFocus
      Exit Sub
   End If
    mrc.Close
 End If
 txtSQL = "select * from roomtype where typeid<>'" & Trim(txtItem(0)) & "'and typename='" & Trim(txtItem(1)) & "'"
 Set mrc = ExecuteSQL(txtSQL, MsgText)
  ' MsgBox "已经存在相同物资内容的记录!", vbOKOnly + vbExclamation, "警告"
   txtItem(1).SetFocus
   Exit Sub
' End If
 
 txtSQL = "delect from roomtype where typeid='" & Trim(txtItem(0)) & "'"
  Set mrc = ExecuteSQL(txtSQL, MsgText)
  txtSQL = "select * from roomtype"
   Set mrc = ExecuteSQL(txtSQL, MsgText)
   mrc.AddNew
   For intCount = 0 To 3
      mrc.Fields(intCount + 4) = Trim(Combo1(intCount))
   Next intCount
   mrc.Fields(8) = Trim(txtItem(4))
   mrc.Update
   mrc.Close
   
   If ginTmode = 1 Then
     MsgBox "添加记录成功!", vbOKOnly + vbExclamation, "添加记录"
     For intCount = 0 To 4
       txtItem(intCount) = " "
     Next intCount
     For intCount = 0 To 3
        Combo1(intCount).ListIndex = 0
     Next intCount
     mblChange = False
     If flagTedit Then
       Unload frmRoomtype
       frmRoomtype.txtSQL = "select * from roomtype"
       frmRoomtype.Show
     End If
     ElseIf ginTmode = 2 Then
       Unload Me
       If flagTedit Then
          Unload frmRoomtype
       End If
       frmRoomtype.txtSQL = "select * from roomtype"
       frmRoomtype.Show
    End If
        
              
End Sub

⌨️ 快捷键说明

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