?? frmpayfroomman.frm
字號(hào):
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmPayFRoomMan
Caption = "實(shí)收房款管理"
ClientHeight = 5235
ClientLeft = 60
ClientTop = 450
ClientWidth = 9375
LinkTopic = "Form1"
ScaleHeight = 5235
ScaleWidth = 9375
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Cmd_Pay
Caption = "結(jié) 款"
Height = 495
Left = 2640
TabIndex = 4
Top = 4680
Width = 1335
End
Begin VB.CommandButton Cmd_Close
Caption = "關(guān) 閉"
Height = 495
Left = 5280
TabIndex = 3
Top = 4680
Width = 1335
End
Begin VB.ComboBox ComboStatus
Height = 300
ItemData = "FrmPayFRoomMan.frx":0000
Left = 1200
List = "FrmPayFRoomMan.frx":000A
Style = 2 'Dropdown List
TabIndex = 2
Top = 30
Width = 1215
End
Begin VB.CommandButton Cmd_Search
Caption = "查 詢"
Height = 375
Left = 5400
TabIndex = 1
Top = 0
Width = 1095
End
Begin VB.TextBox txtDate
Height = 270
Left = 3840
TabIndex = 0
Top = 45
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3735
Left = 0
TabIndex = 5
Top = 600
Width = 9255
_ExtentX = 16325
_ExtentY = 6588
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
MarqueeStyle = 3
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6840
Top = 0
Visible = 0 'False
Width = 2415
_ExtentX = 4260
_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.Label Label2
AutoSize = -1 'True
Caption = "選擇狀態(tài)"
Height = 180
Left = 120
TabIndex = 7
Top = 90
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "退房日期"
Height = 180
Left = 2880
TabIndex = 6
Top = 90
Width = 720
End
End
Attribute VB_Name = "FrmPayFRoomMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Pay()
Dim strSearch As String
'設(shè)置查詢條件
If Trim(txtDate) <> "" Then
strSearch = " And r.LeaveDate='" + Trim(txtDate) + "'"
Else
strSearch = ""
End If
Adodc1.ConnectionString = Conn
If ComboStatus.ListIndex = 0 Then '已退房記錄
Adodc1.RecordSource = "SELECT r.RegId As 編號(hào), r.CustId As 客戶編號(hào), c.CustName As 客戶姓名," _
+ " r.RoomNo As 客房編號(hào), r.InDate As 入住日期, r.LeaveDate As 退房日期," _
+ " r.Days As 入住天數(shù), r.Price As 單價(jià), r.Rate As 折扣, r.OtherFee As 其他費(fèi)用," _
+ " ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee As 總費(fèi)用," _
+ " r.FirstPay As 押金, ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee -r.FirstPay" _
+ " As 應(yīng)收款 FROM Registration r, Customer c" _
+ " WHERE r.Status=2 And r.CustId=c.CustId" + strSearch
Else '已結(jié)款記錄
Adodc1.RecordSource = "SELECT p.RegId As 編號(hào), r.CustId As 客戶編號(hào), c.CustName As 客戶姓名," _
+ " r.RoomNo As 客房編號(hào), r.InDate As 入住日期, r.LeaveDate As 退房日期," _
+ " r.Days As 入住天數(shù), r.Price As 單價(jià), r.Rate As 折扣, r.OtherFee As 其他費(fèi)用," _
+ " ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee As 總費(fèi)用," _
+ " r.FirstPay As 押金, ROUND(r.Price * r.Rate * r.Days / 100, 0) + r.OtherFee -r.FirstPay" _
+ " As 應(yīng)收款, p.Amount As 實(shí)收款, u.EmpName As 收款人, p.OptTime As 收款時(shí)間" _
+ " FROM PayforRoom p, Registration r,Users u, Customer c" _
+ " WHERE p.RegId=r.RegId And r.Status=3 And r.CustId=c.CustId" _
+ " And p.UserName=u.UserName" + strSearch
End If
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub Cmd_Delt_Click()
'刪除信息
If Adodc1.Recordset.EOF = True Then
MsgBox "請(qǐng)選擇記錄"
Exit Sub
End If
MyPayFRoom.Delete (Adodc1.Recordset.Fields(0))
Refresh_Pay
End Sub
Private Sub Cmd_Pay_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "請(qǐng)選擇要結(jié)款記錄"
Exit Sub
End If
If ComboStatus.ListIndex = 0 Then '結(jié)款
With FrmPayFRoomEdit
'入住登記編號(hào)
.TmpRid = Adodc1.Recordset.Fields(0)
'客戶信息
.lblCid = Adodc1.Recordset.Fields(1)
.lblCname = Adodc1.Recordset.Fields(2)
'客房編號(hào)
.lblRoomNo = Adodc1.Recordset.Fields(3)
'入住日期
.lblInDate = Adodc1.Recordset.Fields(4)
'退房日期
.lblLeaveDate = Adodc1.Recordset.Fields(5)
'入住天數(shù)
.lblDays = Adodc1.Recordset.Fields(6)
'單價(jià)
.lblPrice = Adodc1.Recordset.Fields(7)
'折扣
.lblRate = Adodc1.Recordset.Fields(8)
'其他費(fèi)用
.lblOtherFee = Adodc1.Recordset.Fields(9)
'總費(fèi)用
.lblTotal = Adodc1.Recordset.Fields(10)
'押金
.lblFirstPay = Adodc1.Recordset.Fields(11)
'應(yīng)收款
.lblPay = Adodc1.Recordset.Fields(12)
.Show 1
End With
Else '取消結(jié)款
If MsgBox("是否取消結(jié)款?", vbYesNo, "請(qǐng)確認(rèn)") = vbYes Then
If CurUser.UserType = 2 Then
MsgBox "沒有權(quán)限"
Exit Sub
End If
MyPayFRoom.Delete (Adodc1.Recordset.Fields(0))
'設(shè)置入住登記狀態(tài)
MyReg.Status = 2
MyReg.UpdateStatus (Adodc1.Recordset.Fields(0))
End If
End If
Refresh_Pay
End Sub
Private Sub Cmd_Search_Click()
Refresh_Pay
End Sub
Private Sub ComboStatus_Click()
If ComboStatus.ListIndex = 0 Then
Cmd_Pay.Caption = "結(jié) 款"
Else
Cmd_Pay.Caption = "取消結(jié)款"
End If
Refresh_Pay
End Sub
Private Sub Form_Load()
ComboStatus.ListIndex = 0
'刷新結(jié)款記錄
Refresh_Pay
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -