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

📄 frmreg.frm

📁 酒店管理系统 (VB版) 简单的酒店管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmReg 
   AutoRedraw      =   -1  'True
   Caption         =   "房间登记"
   ClientHeight    =   6345
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4530
   LinkTopic       =   "Form1"
   ScaleHeight     =   6345
   ScaleWidth      =   4530
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox txtarr 
      Height          =   270
      Left            =   1440
      TabIndex        =   22
      Top             =   3960
      Width           =   1455
   End
   Begin VB.ComboBox Comgodate 
      Height          =   300
      Left            =   1440
      TabIndex        =   21
      Top             =   4440
      Width           =   1455
   End
   Begin VB.TextBox Textremarks 
      Height          =   375
      Left            =   1440
      TabIndex        =   20
      Top             =   4920
      Width           =   2775
   End
   Begin MSDataListLib.DataCombo Datacountry 
      Height          =   330
      Left            =   1440
      TabIndex        =   16
      Top             =   3360
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      _Version        =   393216
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo Datacert 
      Height          =   330
      Left            =   1440
      TabIndex        =   14
      Top             =   2280
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      _Version        =   393216
      Text            =   ""
   End
   Begin VB.TextBox agetext 
      Height          =   375
      Left            =   1440
      TabIndex        =   12
      Top             =   1680
      Width           =   1455
   End
   Begin VB.OptionButton female 
      Caption         =   "女"
      Height          =   255
      Left            =   2280
      TabIndex        =   10
      Top             =   1320
      Width           =   615
   End
   Begin VB.OptionButton male 
      Caption         =   "男"
      Height          =   255
      Left            =   1440
      TabIndex        =   9
      Top             =   1320
      Width           =   735
   End
   Begin VB.CommandButton cmdcancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   2760
      TabIndex        =   4
      Top             =   5520
      Width           =   1215
   End
   Begin VB.CommandButton cmdreg 
      Caption         =   "登记"
      Height          =   495
      Left            =   840
      TabIndex        =   3
      Top             =   5520
      Width           =   1215
   End
   Begin VB.TextBox Textcerno 
      Height          =   375
      Left            =   1440
      TabIndex        =   2
      Top             =   2760
      Width           =   2655
   End
   Begin VB.TextBox Textname 
      Height          =   375
      Left            =   1440
      TabIndex        =   1
      Top             =   720
      Width           =   1455
   End
   Begin VB.TextBox TxtRoomno 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1440
      TabIndex        =   0
      Top             =   120
      Width           =   1455
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "备注"
      Height          =   180
      Left            =   240
      TabIndex        =   19
      Top             =   4920
      Width           =   360
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "拟走日期"
      Height          =   180
      Left            =   240
      TabIndex        =   18
      Top             =   4440
      Width           =   720
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "抵达日期"
      Height          =   180
      Left            =   240
      TabIndex        =   17
      Top             =   3960
      Width           =   720
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "国籍编码"
      Height          =   180
      Left            =   240
      TabIndex        =   15
      Top             =   3480
      Width           =   720
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "证件种类"
      Height          =   180
      Left            =   240
      TabIndex        =   13
      Top             =   2280
      Width           =   720
   End
   Begin VB.Label age 
      AutoSize        =   -1  'True
      Caption         =   "年龄"
      Height          =   180
      Left            =   240
      TabIndex        =   11
      Top             =   1800
      Width           =   360
   End
   Begin VB.Label Label4 
      Caption         =   "性别"
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   1320
      Width           =   495
   End
   Begin VB.Label Label3 
      Caption         =   "证件号码"
      Height          =   255
      Left            =   240
      TabIndex        =   7
      Top             =   2880
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "客户名称:"
      Height          =   255
      Left            =   240
      TabIndex        =   6
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "房间号:"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   240
      Width           =   855
   End
End
Attribute VB_Name = "FrmReg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str1 As String
Dim str2 As String
Dim rscertclasses As ADODB.Recordset
Dim rscountrycodes As ADODB.Recordset
Dim rsroom As ADODB.Recordset

Private Sub Cmdcancel_Click()
Unload Me
End Sub

Private Sub Cmdreg_Click()
Set cnn = New ADODB.Connection
Dim connectstring As String
connectstring = "DSN=hotelodbc"
cnn.Open connectstring

Dim str As String
Dim a As String
If male.Value = True Then
a = "M"
Else: a = "F"                                 ' 缺省状态或者选“女”

End If

On Error GoTo err

cnn.BeginTrans

str = "insert into guests(roomcode,name,sex,age,certclassno,certificate,countryno,arridate,leftdate,remarks)  values('" & FrmMain.Dataroom.BoundText & "','" & Textname.Text & "','" & a & "','" & agetext.Text & "','" & Datacert.BoundText & "','" & Textcerno.Text & "','" & Datacountry.BoundText & "','" & txtarr.Text & "','" & Comgodate.Text & "','" & Textremarks.Text & "')"
'将登记的客人信息入库
Debug.Print str
cnn.Execute str

str = "update roomstate set roomstate='l' where roomcode=(select roomcode from room where roomcode='" & TxtRoomno.Text & "')"      '保持参考完整性

Debug.Print str
cnn.Execute str

FrmMain.Dataroom.Refresh
MsgBox "登记成功", vbOKOnly + vbInformation, "提示"

cnn.CommitTrans
Unload Me
Unload FrmMain
Exit Sub

err:
cnn.RollbackTrans
MsgBox "登记失败", vbOKOnly + vbInformation, "提示"
End Sub

Private Sub female_Click()
female.Value = True
End Sub

Private Sub Form_Load()
Set cnn = New ADODB.Connection
Dim connectstring As String
connectstring = "DSN=hotelodbc"
cnn.Open connectstring

Dim i As Integer
If reg = 1 Then
TxtRoomno.Text = FrmMain.Dataroom.Text
ElseIf reg = 2 Then
TxtRoomno.Text = frmchaxunf.Dataroomno.Text
End If

str1 = "select * from certclasses "
Set rscertclasses = New ADODB.Recordset
rscertclasses.Open str1, cnn, adOpenKeyset, adLockOptimistic
Set Datacert.RowSource = rscertclasses
Datacert.ListField = "certclass"
Datacert.BoundColumn = "certno"
rscertclasses.MoveFirst
Datacert.Text = rscertclasses.Fields("certclass")

str2 = "select * from countrycodes"
Set rscountrycodes = New ADODB.Recordset
rscountrycodes.Open str2, cnn, adOpenKeyset, adLockOptimistic
Set Datacountry.RowSource = rscountrycodes
Datacountry.ListField = "country"
Datacountry.BoundColumn = "countryno"
rscountrycodes.MoveFirst
Datacountry.Text = rscountrycodes.Fields("country")

txtarr.Text = Date

For i = 0 To 30
    Comgodate.List(i) = Date + i + 1
Next i

End Sub

Private Sub male_Click()
male.Value = True
End Sub

⌨️ 快捷键说明

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