📄 setroom1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form setroom1
BorderStyle = 1 'Fixed Single
Caption = "增加客房"
ClientHeight = 5250
ClientLeft = 45
ClientTop = 330
ClientWidth = 3660
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5250
ScaleWidth = 3660
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 795
Left = 30
ScaleHeight = 735
ScaleWidth = 3555
TabIndex = 17
Top = 30
Width = 3615
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "Label8"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 270
Left = 825
TabIndex = 18
Top = 45
Width = 1905
End
Begin VB.Line Line1
X1 = 150
X2 = 3345
Y1 = 330
Y2 = 330
End
End
Begin VB.CommandButton Command2
Caption = "保存"
Height = 285
Left = 375
TabIndex = 16
Top = 4770
Width = 1050
End
Begin VB.CommandButton Command1
Caption = "撤消"
Height = 285
Left = 2010
TabIndex = 15
Top = 4755
Width = 1050
End
Begin VB.Frame Frame1
Height = 3840
Left = 75
TabIndex = 0
Top = 780
Width = 3465
Begin VB.TextBox Text7
Height = 285
Left = 1395
TabIndex = 21
Top = 3375
Width = 1440
End
Begin VB.TextBox Text6
Height = 285
Left = 1395
TabIndex = 19
Top = 3030
Width = 870
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1395
TabIndex = 8
Top = 2670
Width = 1410
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 285
Left = 1410
TabIndex = 6
Top = 1875
Width = 870
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 285
Left = 1410
TabIndex = 5
Top = 1515
Width = 870
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1395
TabIndex = 7
Top = 2265
Width = 1410
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 285
Left = 1410
TabIndex = 4
Top = 1140
Width = 870
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 285
Left = 1410
TabIndex = 3
Top = 780
Width = 870
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 285
Left = 1410
TabIndex = 2
Top = 390
Width = 870
End
Begin VB.Label Label10
Caption = "电 话:"
Height = 300
Left = 630
TabIndex = 22
Top = 3405
Width = 840
End
Begin VB.Label Label9
Caption = "出售方式:"
Height = 300
Left = 465
TabIndex = 20
Top = 3060
Width = 1005
End
Begin VB.Label Label7
Caption = "当前状态:"
Height = 300
Left = 465
TabIndex = 14
Top = 2715
Width = 1095
End
Begin VB.Label Label6
Caption = "床位数:"
Height = 300
Left = 645
TabIndex = 13
Top = 1905
Width = 840
End
Begin VB.Label Label5
Caption = "日房价:"
Height = 300
Left = 615
TabIndex = 12
Top = 1545
Width = 840
End
Begin VB.Label Label4
Caption = "类 型:"
Height = 300
Left = 630
TabIndex = 11
Top = 2325
Width = 840
End
Begin VB.Label Label3
Caption = "层:"
Height = 300
Left = 990
TabIndex = 10
Top = 1170
Width = 465
End
Begin VB.Label Label2
Caption = "楼 号:"
Height = 300
Left = 630
TabIndex = 9
Top = 810
Width = 840
End
Begin VB.Label Label1
Caption = "房 号:"
Height = 300
Left = 630
TabIndex = 1
Top = 420
Width = 840
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2130
Top = 885
Visible = 0 'False
Width = 1635
_ExtentX = 2884
_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
End
Attribute VB_Name = "setroom1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Select Case RoomForm_Type
Case "增加"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("房号") = Me.Text1.Text
Adodc1.Recordset.Fields("楼号") = Me.Text2.Text
Adodc1.Recordset.Fields("层") = Me.Text3.Text
Adodc1.Recordset.Fields("日房价") = Me.Text4.Text
Adodc1.Recordset.Fields("床位数") = Me.Text5.Text
Adodc1.Recordset.Fields("类型") = Me.Combo1.Text
Adodc1.Recordset.Fields("当前状态") = Me.Combo2.Text
Adodc1.Recordset.Fields("电话") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Case "修改"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 1 Then
Adodc1.Recordset.Fields("房号") = Me.Text1.Text
Adodc1.Recordset.Fields("楼号") = Me.Text2.Text
Adodc1.Recordset.Fields("层") = Me.Text3.Text
Adodc1.Recordset.Fields("日房价") = Me.Text4.Text
Adodc1.Recordset.Fields("床位数") = Me.Text5.Text
Adodc1.Recordset.Fields("类型") = Me.Combo1.Text
Adodc1.Recordset.Fields("当前状态") = Me.Combo2.Text
Adodc1.Recordset.Fields("电话") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Else
If Adodc1.Recordset.RecordCount > 1 Then
Adodc1.Recordset.MoveNext
Adodc1.Recordset.Fields("房号") = Me.Text1.Text
Adodc1.Recordset.Fields("楼号") = Me.Text2.Text
Adodc1.Recordset.Fields("层") = Me.Text3.Text
Adodc1.Recordset.Fields("日房价") = Me.Text4.Text
Adodc1.Recordset.Fields("床位数") = Me.Text5.Text
Adodc1.Recordset.Fields("类型") = Me.Combo1.Text
Adodc1.Recordset.Fields("当前状态") = Me.Combo2.Text
Adodc1.Recordset.Fields("电话") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
Else
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("房号") = Me.Text1.Text
Adodc1.Recordset.Fields("楼号") = Me.Text2.Text
Adodc1.Recordset.Fields("层") = Me.Text3.Text
Adodc1.Recordset.Fields("日房价") = Me.Text4.Text
Adodc1.Recordset.Fields("床位数") = Me.Text5.Text
Adodc1.Recordset.Fields("类型") = Me.Combo1.Text
Adodc1.Recordset.Fields("当前状态") = Me.Combo2.Text
Adodc1.Recordset.Fields("电话") = Me.Text7.Text
Adodc1.Recordset.Fields("出售方式") = Me.Text6.Text
Adodc1.Recordset.Update
Adodc1.Recordset.Close
End If
End If
End Select
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 项目编码 where 编码 like 'FL%' order by 名称"
Adodc1.Refresh
While Not Adodc1.Recordset.EOF
Me.Combo1.AddItem Adodc1.Recordset.Fields("名称")
If Adodc1.Recordset.Fields("首选项") = "是" Then
Me.Combo1.Text = Adodc1.Recordset.Fields("名称")
End If
Adodc1.Recordset.MoveNext
Wend
Adodc1.Recordset.Close
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 房间状态"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
While Not Adodc1.Recordset.EOF
Me.Combo2.AddItem Adodc1.Recordset.Fields("房间状态")
Adodc1.Recordset.MoveNext
Wend
End If
Adodc1.Recordset.Close
Select Case RoomForm_Type
Case "增加"
Me.Label8.Caption = "增加客房"
Case "修改"
Me.Label8.Caption = "修改客房资料"
Me.Caption = "修改" & RoomNO & "客房资料"
Adodc1.ConnectionString = My_PROVIDER
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 客房 where 房号 like '" & RoomNO & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Me.Text1.Text = IIf(IsNull(Adodc1.Recordset.Fields("房号")), "", Adodc1.Recordset.Fields("房号"))
Me.Text2.Text = IIf(IsNull(Adodc1.Recordset.Fields("楼号")), "", Adodc1.Recordset.Fields("楼号"))
Me.Text3.Text = IIf(IsNull(Adodc1.Recordset.Fields("层")), "", Adodc1.Recordset.Fields("层"))
Me.Text4.Text = IIf(IsNull(Adodc1.Recordset.Fields("日房价")), 0, Adodc1.Recordset.Fields("日房价"))
Me.Text5.Text = IIf(IsNull(Adodc1.Recordset.Fields("床位数")), 0, Adodc1.Recordset.Fields("床位数"))
Me.Combo1.Text = IIf(IsNull(Adodc1.Recordset.Fields("类型")), 0, Adodc1.Recordset.Fields("类型"))
Me.Combo2.Text = IIf(IsNull(Adodc1.Recordset.Fields("当前状态")), 0, Adodc1.Recordset.Fields("当前状态"))
Else
MsgBox "操作错误:您没有选择要修改的房间!", 48, "提示"
Unload Me
End If
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -