📄 frmleaveman.frm
字号:
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 FrmLeaveMan
Caption = "客房退房管理"
ClientHeight = 4995
ClientLeft = 60
ClientTop = 345
ClientWidth = 10320
Icon = "FrmLeaveMan.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4995
ScaleWidth = 10320
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox ComboStatus
Height = 300
ItemData = "FrmLeaveMan.frx":0CCA
Left = 1440
List = "FrmLeaveMan.frx":0CD4
Style = 2 'Dropdown List
TabIndex = 7
Top = 180
Width = 1455
End
Begin VB.CommandButton Cmd_Close
Caption = "关 闭"
Height = 495
Left = 5640
TabIndex = 4
Top = 4380
Width = 1215
End
Begin VB.TextBox txtCltName
Height = 270
Left = 4560
TabIndex = 3
Top = 195
Width = 1455
End
Begin VB.CommandButton Cmd_Search
Caption = "查 询"
Height = 375
Left = 6600
TabIndex = 2
Top = 143
Width = 1095
End
Begin VB.CommandButton Cmd_Leave
Caption = "退 房"
Height = 495
Left = 3480
TabIndex = 0
Top = 4380
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3495
Left = 120
TabIndex = 1
Top = 660
Width = 10095
_ExtentX = 17806
_ExtentY = 6165
_Version = 393216
AllowUpdate = 0 'False
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
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 4380
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_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 = "选择状态"
Height = 180
Left = 360
TabIndex = 6
Top = 240
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "客户姓名"
Height = 180
Left = 3600
TabIndex = 5
Top = 240
Width = 720
End
End
Attribute VB_Name = "FrmLeaveMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub Refresh_Reg()
'入住信息记录
Dim TmpSource As String
TmpSource = "SELECT r.RegId As 编号, c.CustId As 客户编号, c.CustName As 客户姓名," _
+ " r.RoomNo As 房间编号, r.InDate As 入住时间, r.LeaveDate As 退房时间," _
+ " r.Days As 入住天数, r.Price As 报价, r.Rate As 折扣, r.OtherFee As 其他收费," _
+ " r.FirstPay As 押金, r.Memo As 其他说明, u.EmpName As 操作人" _
+ " FROM Registration r, Customer c , Users u WHERE r.CustId=c.CustId" _
+ " And r.UserName=u.UserName And r.Status=" + Trim(ComboStatus.ListIndex + 1)
If Trim(txtCustName) <> "" Then
Adodc1.RecordSource = TmpSource + " And c.CustName LIKE '%" + MakeStr(txtCustName) + "%'"
End If
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = TmpSource
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(0).Width = 0
DataGrid1.Columns(1).Width = 1000
DataGrid1.Columns(2).Width = 1000 '客户姓名
DataGrid1.Columns(3).Width = 1000 '房间编号
DataGrid1.Columns(4).Width = 1000 '入住时间
DataGrid1.Columns(5).Width = 1000 '退房时间
DataGrid1.Columns(6).Width = 800 '入住天数
DataGrid1.Columns(7).Width = 1000 '报价
DataGrid1.Columns(8).Width = 1000 '折扣
DataGrid1.Columns(9).Width = 1000 '其他收费
DataGrid1.Columns(10).Width = 1000 '押金
DataGrid1.Columns(11).Width = 1000 '其他说明
DataGrid1.Columns(11).Width = 1000
End Sub
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub Cmd_Leave_Click()
'修改预定信息
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
'登记编号
FrmLeaveEdit.TmpId = Trim(Adodc1.Recordset.Fields(0))
'房间编号
FrmLeaveEdit.lblRoomNo = Trim(Adodc1.Recordset.Fields(3))
'客户信息
If Trim(Adodc1.Recordset.Fields(1)) <> "" Then
FrmLeaveEdit.lblCid = Trim(Adodc1.Recordset.Fields(1))
MyCust.GetInfo (Trim(Adodc1.Recordset.Fields(1)))
FrmLeaveEdit.lblCname = MyCust.CustName
FrmLeaveEdit.lblCtype = MyCust.CustType
End If
'入住日期
If Trim(Adodc1.Recordset.Fields(4)) <> "" Then
FrmLeaveEdit.txtInDate = Adodc1.Recordset.Fields(4)
End If
'退房日期
If Trim(Adodc1.Recordset.Fields(5)) <> "" Then
FrmLeaveEdit.txtLeaveDate = Adodc1.Recordset.Fields(5)
End If
'入住天数
If Trim(Adodc1.Recordset.Fields(6)) <> "" Then
FrmLeaveEdit.txtDays = Adodc1.Recordset.Fields(6)
End If
'报价
If Trim(Adodc1.Recordset.Fields(7)) <> "" Then
FrmLeaveEdit.txtPrice = Adodc1.Recordset.Fields(7)
End If
'折扣
If Trim(Adodc1.Recordset.Fields(8)) <> "" Then
FrmLeaveEdit.ComboRate = Adodc1.Recordset.Fields(8)
End If
'其他费用
If Trim(Adodc1.Recordset.Fields(9)) <> "" Then
FrmLeaveEdit.txtOtherFee = Adodc1.Recordset.Fields(9)
End If
'押金
If Trim(Adodc1.Recordset.Fields(10)) <> "" Then
FrmLeaveEdit.txtFirstPay = Adodc1.Recordset.Fields(10)
End If
'其他说明
If Trim(Adodc1.Recordset.Fields(11)) <> "" Then
FrmLeaveEdit.txtMemo = Adodc1.Recordset.Fields(11)
End If
'操作人
If Trim(Adodc1.Recordset.Fields(12)) <> "" Then
FrmLeaveEdit.lblEmpName = Trim(Adodc1.Recordset.Fields(12))
End If
FrmLeaveEdit.Show 1
Refresh_Reg
End Sub
Private Sub Cmd_Search_Click()
'按客户姓名查找客户入住信息
Refresh_Reg
End Sub
Private Sub ComboStatus_Click()
Refresh_Reg
'如果是已退房记录,则不能再执行退房操作
If ComboStatus.ListIndex = 0 Then
Cmd_Leave.Enabled = True
Else
Cmd_Leave.Enabled = False
End If
End Sub
Private Sub Form_Load()
ComboStatus.ListIndex = 0
'刷新入住信息
Refresh_Reg
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -