📄 frmroomsearch.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form frmRoomSearch
Caption = "查询修改客房信息"
ClientHeight = 5865
ClientLeft = 60
ClientTop = 345
ClientWidth = 9060
LinkTopic = "Form1"
ScaleHeight = 5865
ScaleWidth = 9060
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1020
Top = 5460
Visible = 0 'False
Width = 2595
_ExtentX = 4577
_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 = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "客房信息"
Height = 4695
Left = 240
TabIndex = 3
Top = 720
Width = 8655
Begin MSDataGridLib.DataGrid dtgCustom
Height = 1635
Left = 3240
TabIndex = 19
Top = 2880
Width = 5235
_ExtentX = 9234
_ExtentY = 2884
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
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 VB.TextBox txtFurnish
Height = 1335
Left = 3240
TabIndex = 17
Top = 1020
Width = 5175
End
Begin VB.TextBox txtMemo
Height = 1635
Left = 240
MultiLine = -1 'True
TabIndex = 13
Top = 2880
Width = 2655
End
Begin MSDataListLib.DataCombo cmbRoomState
Bindings = "FrmRoomSearch.frx":0000
Height = 315
Left = 840
TabIndex = 11
Top = 1920
Width = 1755
_ExtentX = 3096
_ExtentY = 582
_Version = 393216
ListField = "descript"
Text = ""
Object.DataMember = "CmdRoomState"
End
Begin MSDataListLib.DataCombo cmbRoomLevel
Bindings = "FrmRoomSearch.frx":001F
Height = 315
Left = 840
TabIndex = 10
Top = 1380
Width = 1755
_ExtentX = 3096
_ExtentY = 582
_Version = 393216
ListField = "descript"
Text = ""
Object.DataMember = "CmdRoomLevel"
End
Begin VB.TextBox txtPlace
Height = 285
Left = 840
TabIndex = 9
Top = 900
Width = 1695
End
Begin VB.Label Label11
Caption = "房客"
Height = 255
Left = 3300
TabIndex = 18
Top = 2580
Width = 1035
End
Begin VB.Label Label10
Caption = "设施:"
Height = 315
Left = 3240
TabIndex = 16
Top = 720
Width = 555
End
Begin VB.Label lblRoomPrice
BeginProperty DataFormat
Type = 1
Format = """¥""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 2
EndProperty
Height = 315
Left = 4020
TabIndex = 15
Top = 360
Width = 1455
End
Begin VB.Label Label8
Caption = "房价:"
Height = 375
Left = 3240
TabIndex = 14
Top = 360
Width = 855
End
Begin VB.Label Label7
Caption = "状态:"
Height = 315
Left = 240
TabIndex = 12
Top = 1980
Width = 555
End
Begin VB.Label lblID
Height = 315
Left = 840
TabIndex = 8
Top = 360
Width = 1335
End
Begin VB.Label Label5
Caption = "备注:"
Height = 255
Left = 240
TabIndex = 7
Top = 2460
Width = 675
End
Begin VB.Label Label4
Caption = "等级:"
Height = 375
Left = 240
TabIndex = 6
Top = 1440
Width = 495
End
Begin VB.Label Label3
Caption = "位置:"
Height = 315
Left = 240
TabIndex = 5
Top = 900
Width = 675
End
Begin VB.Label Label2
Caption = "编号:"
Height = 255
Left = 240
TabIndex = 4
Top = 360
Width = 675
End
End
Begin VB.CommandButton Command1
Caption = "查询(&S)"
Default = -1 'True
Height = 375
Left = 3600
TabIndex = 2
Top = 240
Width = 1335
End
Begin MSMask.MaskEdBox txtID
Height = 315
Left = 1920
TabIndex = 1
Top = 240
Width = 1575
_ExtentX = 2778
_ExtentY = 556
_Version = 393216
MaxLength = 5
Mask = "#####"
PromptChar = "_"
End
Begin VB.Label Label1
Caption = "请输入客房编号:"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 1515
End
End
Attribute VB_Name = "frmRoomSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strCnn As String
Dim cnn As New Connection
Private Sub Command1_Click() '查询
GetRoomInfo
ShowCustom
End Sub
Private Sub Form_Load()
strCnn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=酒店客房管理系统;Data Source=127.0.0.1"
cnn.Open strCnn
End Sub
Private Sub Form_Unload(Cancel As Integer)
' 关闭连接
cnn.Close
Set cnn = Nothing
End Sub
Private Sub GetRoomInfo()
On Error GoTo errHandle
Dim cmd As New Command
Dim rs As New Recordset
'cnn.Open strCnn
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "Hotel_GetRoomInfo"
cmd.Parameters.Append cmd.CreateParameter("@id", adChar, adParamInput, 5)
cmd.Parameters.Append cmd.CreateParameter("@place", adVarChar, adParamOutput, 100)
cmd.Parameters.Append cmd.CreateParameter("@roomLevel", adVarChar, adParamOutput, 100)
cmd.Parameters.Append cmd.CreateParameter("@state", adVarChar, adParamOutput, 100)
cmd.Parameters.Append cmd.CreateParameter("@remark", adVarChar, adParamOutput, 1000)
cmd.Parameters.Append cmd.CreateParameter("@price", adInteger, adParamOutput)
cmd.Parameters.Append cmd.CreateParameter("@furnish", adVarChar, adParamOutput, 1000)
cmd.Parameters("@id").Value = txtID.Text
cmd.Execute
lblID.Caption = txtID.Text
txtPlace.Text = cmd.Parameters("@place").Value
cmbRoomLevel.Text = cmd.Parameters("@roomLevel").Value
cmbRoomState.Text = cmd.Parameters("@state").Value
txtMemo.Text = cmd.Parameters("@remark").Value
lblRoomPrice.Caption = cmd.Parameters("@price").Value
txtFurnish.Text = cmd.Parameters("@furnish").Value
Exit Sub
errHandle:
MsgBox Err.Description
End Sub
Private Sub ShowCustom()
On Error GoTo errHandle:
Dim strSql As String
strSql = ""
On Error GoTo errHandle
strSql = "SELECT c.id as 证件编号, c.name as 姓名 FROM Hotel_WorkSheetItem S LEFT JOIN Hotel_Custom C On S.custom = c.id where s.room = " + txtID.Text + " and s.startTime < getdate() and s.endTime>getDate()"
Dim rs As New Recordset
With rs
.ActiveConnection = cnn
.CursorLocation = adUseClient
.Open strSql, , adOpenStatic, adLockReadOnly, adCmdText
End With
Set Adodc1.Recordset = rs
Set dtgCustom.DataSource = Nothing
dtgCustom.DataMember = ""
dtgCustom.ClearFields
Set dtgCustom.DataSource = Adodc1
dtgCustom.Refresh
Exit Sub
errHandle:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -