📄 frmreservation.frm
字号:
Text = "Reservation Date"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "Date Reserved "
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "Checkout Date"
Object.Width = 2540
EndProperty
End
Begin MSComctlLib.ListView lvroom
Height = 3015
HelpContextID = 7
Left = 120
TabIndex = 9
ToolTipText = "Click to Select Room"
Top = 240
WhatsThisHelpID = 7
Width = 6015
_ExtentX = 10610
_ExtentY = 5318
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
HoverSelection = -1 'True
PictureAlignment= 4
_Version = 393217
SmallIcons = "ImageList1"
ForeColor = 0
BackColor = 16777215
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 3
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "Room No."
Object.Width = 2646
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Room Type"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Room Rate"
Object.Width = 2080
EndProperty
End
Begin MSComctlLib.ListView ll
Height = 2175
HelpContextID = 7
Left = 120
TabIndex = 35
Top = 3480
WhatsThisHelpID = 7
Width = 9615
_ExtentX = 16960
_ExtentY = 3836
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
HotTracking = -1 'True
HoverSelection = -1 'True
TextBackground = -1 'True
_Version = 393217
SmallIcons = "ImageList1"
ForeColor = -2147483640
BackColor = 16777215
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 6
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "Reservation No."
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Guest ID"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Room No."
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Reservation Date"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "Date Reserved "
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "Chekout Date"
Object.Width = 2540
EndProperty
End
End
Begin MSComctlLib.ImageList ImageList2
Left = 0
Top = 5040
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmReservation.frx":1930
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmReservation.frx":220A
Key = ""
EndProperty
EndProperty
End
Begin VB.Label lblDate
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "date"
ForeColor = &H00000000&
Height = 255
Left = 8760
TabIndex = 58
Top = 120
Width = 1455
End
Begin VB.Label Label22
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Reservation No. 1"
BeginProperty Font
Name = "Monotype Corsiva"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 615
Left = -600
TabIndex = 29
Top = 0
Width = 3375
End
End
Attribute VB_Name = "Reservation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public r As Integer
Public G As Integer
Public T As Integer
Dim Status As String
Dim Guest As String
Private Function ValidData() As Boolean
Dim strMessage As String
If txtLN.Text = "" Then
txtLN.SetFocus
strMessage = "Please Enter Last Name..."
ElseIf txtFN.Text = "" Then
txtFN.SetFocus
strMessage = "Please Enter First Name..."
ElseIf txtMI.Text = "" Then
txtMI.SetFocus
strMessage = "Please Enter Middle Name..."
ElseIf txtAddress.Text = "" Then
txtAddress.SetFocus
strMessage = "Please Enter Address..."
ElseIf txtAge.Text = "" Then
txtAge.SetFocus
strMessage = "Please Enter Age..."
ElseIf txtSex.Text = "" Then
txtSex.SetFocus
strMessage = "Please Enter Sex..."
ElseIf txtNationality.Text = "" Then
txtNationality.SetFocus
strMessage = "Please Enter Nationality..."
ElseIf txtTelNo.Text = "" Then
txtTelNo.SetFocus
strMessage = "Please Enter the Telephone Number..."
ElseIf txtCompany.Text = "" Then
txtCompany.SetFocus
strMessage = "Please Enter Company..."
Else
ValidData = True
End If
If Not ValidData Then
MsgBox strMessage, vbOKOnly
End If
End Function
Private Function ValidDataRes() As Boolean
check_RS1
rs1.Open "select * from room_reservation", Cnn
Dim strMessage As String
' If txtReservedDate.Text > txtEndDate.Text Then
' strMessage = "Reserved date must be higher than checkout date"
' txtReservedDate = ""
If txtReservedDate.Text = "" Then
txtReservedDate.SetFocus
strMessage = "Please Enter the Reserved Date..."
ElseIf txtEndDate.Text = "" Then
txtEndDate.SetFocus
strMessage = "Please Enter the said End Date..."
ElseIf lblRoomNo.Caption = "" Then
strMessage = "Please Enter the Room Number to be reserved..."
lvroom.SetFocus
' ElseIf txtEndDate.Text > txtReservedDate.Text Then
' strMessage = "Lenght of stay must be higher than Reserved date"
' txtEndDate.SetFocus
Else
ValidDataRes = True
End If
If Not ValidDataRes Then
MsgBox strMessage, vbOKOnly
End If
End Function
Private Sub Combo1_Click()
txtSex.Text = Combo1.Text
Combo1.Visible = False
End Sub
Private Sub Command1_Click()
Frame2.Visible = True
End Sub
Private Sub Command2_Click()
If Guest = "old" Then
rs1.Requery 1
Unload Me
ElseIf Guest = "new" Then
check_RStemp
rstemp.Open "select * from guest", Cnn
Cnn.Execute "INSERT INTO guest (guest_id, last_name, first_name, mi, address, age, sex, nationality, tel_no, company) VALUES (" & lblGC.Caption & ", '" & txtLN.Text & _
"', '" & txtFN.Text & "', '" & txtMI.Text & "', '" & txtAddress.Text & "', '" & txtAge.Text & "', '" & txtSex.Text & "', '" & txtNationality.Text & "', '" & txtTelNo.Text & _
"', '" & txtCompany.Text & "')" '
rs1.Requery 1
Unload Me
End If
End Sub
Private Sub Command3_Click()
Frame3.Visible = False
Option1.Value = True
End Sub
Private Sub Command4_Click()
Guest = "old"
Frame3.Visible = True
End Sub
Private Sub Command5_Click()
check_RS1
rs1.Open "select * from room_reservation", Cnn
fillttt
End Sub
Private Sub DTPicker1_Change()
If DTPicker1.Value <= Date Then
MsgBox "Date reserved must be higher than date today...", vbInformation, "IIS-CVH"
txtReservedDate = ""
DTPicker2.Enabled = False
Else
txtReservedDate.Text = DTPicker1.Value
DTPicker2.Enabled = True
End If
'If DTPicker1.Value > txtEndDate Then
' MsgBox "Checkout date must be higher or equal than reserved date"
' txtReservedDate = ""
'Else
'txtReservedDate.Text = DTPicker1.Value
'End If
End Sub
Private Sub DTPicker2_Change()
'If DTPicker2.Value < txtReservedDate Then
'MsgBox "Checkout date must be higher than reserved date...", vbInformation, "IIS-CVH"
'txtEndDate = ""
'Else
'txtEndDate.Text = DTPicker2.Value
'End If
End Sub
Private Sub Form_Load()
DTPicker1.Value = Date
DTPicker2.Value = Date
DTPicker2.Enabled = False
Status = "Not Confirmed"
check_RS
rs.Open "select * from room order by room_no asc", Cnn
fill
'=============
G = 10000
check_RStemp
rstemp.Open "select * from guest", Cnn
'=============
While Not rstemp.RecordCount = 0
check_RStemp
G = G + 1
rstemp.Open "select * from guest where guest_id= " & G, Cnn
Wend
Label14 = G
lblGC = G
'=============
check_RS1
rs1.Open "select * from room_reservation", Cnn
fillttt
'============
On Error GoTo r
check_RS1
rs1.Open "select * from room_reservation order by room_res_no desc", Cnn
If rs1.BOF = True And rs1.EOF = True Then
End If
rs1.MoveFirst
lblResNo.Caption = rs1!room_res_no
Label22.Caption = "Reservation No." & rs1!room_res_no
r:
check_RS
rs.Open "select * from guest", Cnn
fillg
'=============
Command2.Enabled = False
lblDate.Caption = Date
Option1.Value = True
Guest = "new"
Command4.Visible = False
Combo1.Visible = False
Call txt
End Sub
Public Sub fill()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -