📄 frmcheckin.frm
字号:
End
Begin VB.Label Label25
BackStyle = 0 'Transparent
Caption = "%"
Height = 315
Left = 10680
TabIndex = 68
Top = 3180
Width = 165
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Folio Number"
Height = 300
Left = 240
TabIndex = 67
Top = 630
Width = 1395
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Last Name"
Height = 300
Left = 240
TabIndex = 66
Top = 1530
Width = 1395
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "First name"
Height = 300
Left = 240
TabIndex = 65
Top = 1980
Width = 1395
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Address"
Height = 300
Left = 240
TabIndex = 64
Top = 2430
Width = 1395
End
Begin VB.Label Label5
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Company"
Height = 300
Left = 240
TabIndex = 63
Top = 3300
Width = 1395
End
Begin VB.Label Label6
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Country"
Height = 300
Left = 240
TabIndex = 62
Top = 2850
Width = 1395
End
Begin VB.Label Label10
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "ID Number"
Height = 300
Left = 240
TabIndex = 61
Top = 4650
Width = 1395
End
Begin VB.Label Label11
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "ID Type"
Height = 300
Left = 240
TabIndex = 60
Top = 4230
Width = 1395
End
Begin VB.Label Label12
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Room Number"
Height = 300
Left = 4320
TabIndex = 59
Top = 660
Width = 1395
End
Begin VB.Label Label13
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Date In"
Height = 300
Left = 4320
TabIndex = 58
Top = 1110
Width = 1395
End
Begin VB.Label Label14
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Date Out"
Height = 300
Left = 7650
TabIndex = 57
Top = 1080
Width = 1395
End
Begin VB.Label Label15
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Rate Type"
Height = 300
Left = 4320
TabIndex = 56
Top = 1530
Width = 1395
End
Begin VB.Label lblRatePerPeriod
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Rate/Period"
ForeColor = &H00FF0000&
Height = 300
Left = 7650
TabIndex = 55
Top = 1500
Width = 1395
End
Begin VB.Label Label17
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Discount"
Height = 300
Left = 7650
TabIndex = 54
Top = 3210
Width = 1395
End
Begin VB.Label Label18
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "No. of Days"
Height = 300
Left = 4320
TabIndex = 53
Top = 1950
Width = 1395
End
Begin VB.Label Label19
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "No. of Adults"
Height = 300
Left = 4320
TabIndex = 52
Top = 2370
Width = 1395
End
Begin VB.Label Label20
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "No. of Childrens"
Height = 300
Left = 4320
TabIndex = 51
Top = 2790
Width = 1395
End
Begin VB.Label Label21
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Business Source"
Height = 300
Left = 4320
TabIndex = 50
Top = 3210
Width = 1395
End
Begin VB.Label Label22
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "Total Charges"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 7650
TabIndex = 49
Top = 1950
Width = 1395
End
Begin VB.Label lblRM
AutoSize = -1 'True
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Tahoma"
Size = 6.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 165
Left = 9450
TabIndex = 40
Top = 3030
Width = 45
End
End
End
Attribute VB_Name = "frmCheckIn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public State As FormState 'Variable used to determine on how the form used
Public PK As Long 'Variable used to get what record is going to edit
Public PopupPK As String
Public Room As Long
Public AmountPaid As Currency 'Amount paid from frmPayment
Public OtherCharges As Currency
Public blnChangeRoom As Boolean
Dim HaveAction As Boolean 'Variable used to detect if the user perform some action
Dim RS As New Recordset
Private Sub DisplayForEditing()
On Error GoTo err
With RS
txtFolioNumber.Text = .Fields("FolioNumber")
txtRCardNo.Text = .Fields("RCardNo")
txtLastName.Text = getValueAt("SELECT LastName FROM Customers WHERE CustomerID = " & RS.Fields("CustomerID"), "LastName")
txtFirstName.Text = getValueAt("SELECT FirstName FROM Customers WHERE CustomerID = " & RS.Fields("CustomerID"), "FirstName")
txtAddress.Text = .Fields("Address")
dcCountry.BoundText = .Fields("CountryID")
If RS.Fields("CompanyID") <> "" Then _
txtCompany.Text = getValueAt("SELECT Company FROM Company WHERE CompanyID = " & RS.Fields("CompanyID"), "Company")
dcIDType.BoundText = .Fields("IDTypeID")
txtIDNumber.Text = .Fields("IDNumber")
txtRoomNumber.Text = .Fields("RoomNumber")
dtpDateIn.Value = .Fields("DateIn")
If State = adStateAddMode Or State = adStateEditMode Then
If .Fields("DateOut") >= Date Then
dtpDateOut.Value = .Fields("DateOut")
ElseIf .Fields("DateIn") = Date Then
dtpDateOut.Value = dtpDateIn.Value + 1
Else
dtpDateOut.Value = Date
End If
Else
dtpDateOut.Value = .Fields("DateOut")
End If
dcRateType.BoundText = .Fields("RateType")
txtRate.Text = toMoney(.Fields("Rate"))
txtOtherCharges.Text = toMoney(.Fields("OtherCharges"))
txtDiscount.Text = .Fields("Discount")
txtAmountPaid.Text = toMoney(.Fields("AmountPaid"))
txtDays.Text = dtpDateOut.Value - dtpDateIn.Value '.Fields("Days")
txtAdults.Text = .Fields("Adults")
txtChildrens.Text = .Fields("Childrens")
dcBusSource.BoundText = .Fields("BusinessSourceID")
dcVehicle.BoundText = .Fields("VehicleID")
txtVehicleModel.Text = .Fields("VehicleModel")
txtPlateNo.Text = .Fields("PlateNo")
txtNotes.Text = .Fields("Notes")
End With
hsDays.Value = txtDays.Text
hsAdults.Value = txtAdults.Text
hsChildrens.Value = txtChildrens.Text
StatusBar1.Panels(2).Text = "Check In By: " & getValueAt("SELECT UserID FROM Users WHERE PK = " & RS.Fields("CheckInBy"), "UserID")
StatusBar1.Panels(4).Text = "Business Source: " & dcBusSource.Text
Exit Sub
err:
If err.Number = 94 Then Resume Next
prompt_err err, Name, "DisplayForEditing"
Screen.MousePointer = vbDefault
End Sub
Private Sub bgMain_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lblAmountPaid.FontUnderline = False
lblRatePerPeriod.FontUnderline = False
lblOtherCharges.FontUnderline = False
End Sub
Private Sub cmdCancel_Click()
On Error GoTo err
CN.BeginTrans
CN.Execute "DELETE FolioNumber " & _
"From [Rate Per Period] " & _
"WHERE FolioNumber='" & txtFolioNumber.Text & "'"
CN.Execute "INSERT INTO [Rate Per Period] " & _
"SELECT [Rate Per Period Temp].* " & _
"FROM [Rate Per Period Temp] " & _
"Where ((([Rate Per Period Temp].FolioNumber) = '" & txtFolioNumber.Text & "')) " & _
"ORDER BY [Rate Per Period Temp].Date;"
CN.CommitTrans
Unload Me
Exit Sub
err:
CN.RollbackTrans
prompt_err err, Name, "CmdCancel_Click"
Screen.MousePointer = vbDefault
End Sub
Private Sub ResetFields()
' clearText Me
'
' txtEntry(15).Text = "0.00"
' txtEntry(1).SetFocus
End Sub
Private Sub CmdChangeRoom_Click()
On Error GoTo err
Dim OldRoomNumber As Integer
CN.BeginTrans
With frmChangeRoom
OldRoomNumber = txtRoomNumber.Text
.txtFrom = OldRoomNumber
.Show vbModal
End With
If blnChangeRoom = False Then Exit Sub
ChangeValue CN, "Rooms", "RoomStatusID", 2, True, "WHERE RoomNumber = " & txtRoomNumber.Text
ChangeValue CN, "Rooms", "RoomStatusID", 3, True, "WHERE RoomNumber = " & OldRoomNumber
CN.Execute "UPDATE [Inventory] SET [Inventory].RoomNumber = " & txtRoomNumber.Text & " " & _
"WHERE RoomNumber=" & OldRoomNumber & " AND ID='" & txtFolioNumber.Text & "' AND Status='Check In'"
CN.CommitTrans
Exit Sub
err:
CN.RollbackTrans
prompt_err err, Name, "CmdChangeRoom_Click"
Screen.MousePointer = vbDefault
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -