?? reservationform1.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmreservation
Caption = "Form2"
ClientHeight = 7320
ClientLeft = 165
ClientTop = 270
ClientWidth = 9525
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 7320
ScaleWidth = 9525
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 720
Top = 5400
Width = 1215
_ExtentX = 2143
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ComboBox CbRoomNo
Height = 300
Left = 3120
TabIndex = 16
Top = 4560
Width = 3135
End
Begin VB.TextBox txtCheckDate
Height = 495
Left = 7440
TabIndex = 15
Top = 3720
Width = 1935
End
Begin VB.ComboBox DCRoomTypes
Height = 300
Left = 3120
TabIndex = 14
Top = 3840
Width = 3135
End
Begin VB.ComboBox DCCustomerName
Height = 300
Left = 3120
TabIndex = 13
Top = 960
Width = 3135
End
Begin VB.TextBox txtNoOfDays
Height = 495
Left = 3120
TabIndex = 12
Top = 3120
Width = 3135
End
Begin VB.TextBox txtCheckInDate
Height = 495
Left = 3120
TabIndex = 11
Top = 2520
Width = 3135
End
Begin VB.TextBox txtNoOfPeople
Height = 615
Left = 3120
TabIndex = 10
Top = 1680
Width = 3135
End
Begin VB.CommandButton CmdClose
Caption = "Close"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 5280
TabIndex = 9
Top = 5640
Width = 1335
End
Begin VB.CommandButton CmdSave
Caption = "Save "
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3240
TabIndex = 8
Top = 5640
Width = 1455
End
Begin VB.Label LblRate
Caption = "Rate:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6360
TabIndex = 7
Top = 3840
Width = 1695
End
Begin VB.Label LblRoomNo
Caption = "Room NO.:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 6
Top = 4440
Width = 1935
End
Begin VB.Label LblRoomType
Caption = "Room types:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 5
Top = 3840
Width = 2295
End
Begin VB.Label LblNoofDays
Caption = "No.of Days:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 4
Top = 3120
Width = 2295
End
Begin VB.Label LblCheckoutDate
Caption = "Checkout in Date:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 3
Top = 2400
Width = 3135
End
Begin VB.Label LblNoofPeople
Caption = "No.of People:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 2
Top = 1680
Width = 2295
End
Begin VB.Label LblCname
Caption = "Customer Name:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 120
TabIndex = 1
Top = 960
Width = 2295
End
Begin VB.Label LblReservationform
Caption = "Reservation Form"
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2400
TabIndex = 0
Top = 120
Width = 3975
End
End
Attribute VB_Name = "frmreservation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'General Declarations
'Declaring the ADODB objects
Dim objReserv As Clipboard
Dim rsRoomno As ADODB.Recordset
Dim rsRate As ADODB.Recordset
Private Sub cbRoomNo_GotFocus()
Dim strRoomno As String
'populates the combo box with available room numbers of the selected type
Set rsRoomno = New ADODB.Recordset
CbRoomNo.Clear
strRoomno = "select Room_no from Room where Stastus='A' and Room_type_cd=' " & DCRoomTypes.BoundText & " '"
rsRoomno.Open strRoomno, cn, adOpenDynamic, adLockBatchOptimistic
rsRoomno.MoveNext
Loop
End Sub
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdSave_Click()
'passing the values entered by the user to the class module
objReserv.CustId = DCCustomerName.BoundText
objReserv.NoOfPeople = Val(TxtNoofPeople.Text)
objReserv.CheckInDate = CDate(txtCheckDate.Text)
objReserv.NoOfDays = Val(txtNoOfDays.Text)
objReserv.RoomTypes = DCRoomTypes.BoundText
objReserv.RoomNo = Val(CbRoomNo.Text)
objReserv.SaveReservation
TxtNoofPeople.Text = ""
txtCheckDate.Text = ""
txtNoOfDays.Text = ""
Call CallCustId
End Sub
Private Sub DCCustomerName_Change()
Set objReserv = New ClsReservation
End Sub
Private Sub DCRoomTypes_Change()
Dim strrate As String
'Displaying the rate of the room of the selected Room type
Set rsRate = New ADODB.Recordset
strrate = "select rate from Roomtype where room_type_cd= ' " & DCRoomTypes.BoundText & " '"
rsRate.Open strrate, cn, adOpenDynamic, adLockBatchOptimistic
txtRate.Text = rsRate!Rate
End Sub
Private Sub form_Activate()
Call CallCustId
End Sub
Private Sub Form_Initialize()
Getconnected
End Sub
Private Sub CallCustId()
Dim strnm As String
Dim rsCustnm As ADODB.Recordset
'Displaying the name of the customer who has logged in
Set rsCustnm = New ADODB.Recordset
strnm = "select Cust_name from customers where cust_id= ' " & CustId & " '"
rsCustnm.Open strnm, conn, adOpenDynamic, adLockBatchOptimistic
If UCase(CustId) = "ADMIN" Then
AdodcCust.Refresh
DCCustomerName.Enabled = True
Else
DCCustomerName.Text = rsCustnm!Cust_name
DCCustomerName.Enabled = False
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -