📄 fmcanceldestine.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FMCancelDestine
Caption = "取消预定"
ClientHeight = 5100
ClientLeft = 60
ClientTop = 345
ClientWidth = 6330
LinkTopic = "Form1"
ScaleHeight = 5100
ScaleWidth = 6330
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 4095
Left = 0
TabIndex = 2
Top = 360
Width = 6255
Begin VB.TextBox TextClientName
Height = 375
Left = 1680
TabIndex = 13
Top = 360
Width = 1335
End
Begin VB.ComboBox CombRoomID
Height = 300
Left = 4560
TabIndex = 12
Top = 360
Width = 1335
End
Begin VB.ComboBox CombRoomType
Height = 300
ItemData = "FMCancelDestine.frx":0000
Left = 1680
List = "FMCancelDestine.frx":0010
TabIndex = 11
Top = 948
Width = 1335
End
Begin VB.ComboBox CombRoomPrice
Height = 300
ItemData = "FMCancelDestine.frx":002D
Left = 4560
List = "FMCancelDestine.frx":003D
TabIndex = 10
Top = 960
Width = 1335
End
Begin VB.TextBox TextClientTel
Height = 375
Left = 1680
TabIndex = 9
Top = 1461
Width = 1335
End
Begin VB.TextBox TextCount
Height = 375
Left = 4560
TabIndex = 8
Top = 1440
Width = 1335
End
Begin VB.ComboBox CombWaitor
Height = 300
Left = 1680
TabIndex = 7
Top = 2640
Width = 1335
End
Begin VB.TextBox TextPrepay
Height = 375
Left = 4560
TabIndex = 6
Top = 2640
Width = 1335
End
Begin VB.TextBox TextRemake
Height = 615
Left = 1680
TabIndex = 5
Top = 3240
Width = 4215
End
Begin VB.TextBox TextORTime
Height = 375
Left = 4560
TabIndex = 3
Top = 2040
Width = 1335
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1680
TabIndex = 4
Top = 2040
Width = 1335
_ExtentX = 2355
_ExtentY = 661
_Version = 393216
Format = 154927105
CurrentDate = 39045
End
Begin VB.Label Label3
Caption = "客户姓名:"
Height = 375
Left = 600
TabIndex = 24
Top = 360
Width = 855
End
Begin VB.Label Label4
Caption = "房间编号:"
Height = 375
Left = 3360
TabIndex = 23
Top = 360
Width = 855
End
Begin VB.Label Label5
Caption = "房间类型:"
Height = 255
Left = 600
TabIndex = 22
Top = 1008
Width = 855
End
Begin VB.Label Label6
Caption = "房价价格:"
Height = 255
Left = 3360
TabIndex = 21
Top = 960
Width = 855
End
Begin VB.Label Label7
Caption = "客户电话:"
Height = 345
Left = 600
TabIndex = 20
Top = 1530
Width = 855
End
Begin VB.Label Label8
Caption = "人 数:"
Height = 255
Left = 3360
TabIndex = 19
Top = 1440
Width = 735
End
Begin VB.Label Label9
Caption = "开房日期:"
Height = 375
Left = 600
TabIndex = 18
Top = 2040
Width = 855
End
Begin VB.Label Label10
Caption = "操作员:"
Height = 255
Left = 600
TabIndex = 17
Top = 2640
Width = 975
End
Begin VB.Label Label11
Caption = "备 注:"
Height = 375
Left = 600
TabIndex = 16
Top = 3240
Width = 975
End
Begin VB.Label Label12
Caption = "开房时间:"
Height = 255
Left = 3360
TabIndex = 15
Top = 2040
Width = 975
End
Begin VB.Label Label13
Caption = "预付金额:"
Height = 375
Left = 3360
TabIndex = 14
Top = 2640
Width = 975
End
End
Begin VB.CommandButton ComdCancel
Caption = "取消"
Height = 495
Left = 5280
TabIndex = 1
Top = 4560
Width = 735
End
Begin VB.CommandButton ComdOK
Caption = "确定"
Height = 495
Left = 4320
TabIndex = 0
Top = 4560
Width = 735
End
Begin VB.Label Label1DestineID
Height = 255
Left = 1560
TabIndex = 27
Top = 120
Width = 1095
End
Begin VB.Label LabelDestineID
Caption = "预定单编号:"
Height = 255
Left = 360
TabIndex = 26
Top = 120
Width = 1095
End
Begin VB.Label LabelDate
Height = 255
Left = 5280
TabIndex = 25
Top = 120
Width = 975
End
End
Attribute VB_Name = "FMCancelDestine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim ReadDestine As New ADODB.Recordset
Dim SqlStr As String
Private Sub ComdCancel_Click()
Unload Me
End Sub
Private Sub ComdOK_Click()
Dim Str As String
SqlStr = "select * from DestineInfo where " & "RoomID='" & Trim(Me.CombRoomID.Text) & "'"
ReadDestine.Open SqlStr, g_DBConn, adOpenStatic, adLockOptimistic
ReadDestine.Delete
ReadDestine.Close
MsgBox "取消预定成功!"
Str = "update RoomInfo set RoomState='空房' where " & " RoomID='" & Trim(Me.CombRoomID.Text) & "'"
g_DBConn.Execute Str
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2 '垂直方向居中
Me.Left = (Screen.Width - Me.Height) / 2 '水平方向居中
'读取房间编号
Dim iRoomID As Integer
Dim strRoomID As String
Dim iRow, iCol As Integer
iRow = FMMain.MSFlexGrid1.Row
iCol = FMMain.MSFlexGrid1.Col
iRoomID = 10 * iRow + iCol + 1
If iRoomID < 10 Then
strRoomID = "0" & iRoomID
ElseIf iRoomID < 100 And iRoomID >= 10 Then
strRoomID = iRoomID
End If
FMCancelDestine.CombRoomID.Text = strRoomID
'从数据可库中读取预定单信息
SqlStr = "select DestineID,RoomID,ClientName,RoomType,RoomPrice," & "ClientTel,ClientCount,OpenRoomDate,OpenRoomTime,Waitor," & "Prepay,Remake,DestineDate,MemberID from DestineInfo where " & "RoomID='" & strRoomID & "'"
ReadDestine.Open SqlStr, g_DBConn, adOpenStatic, adLockOptimistic
If ReadDestine.BOF Then
MsgBox "该预定单不存在!"
Exit Sub
Unload Me
Else
'ReadDestine.MoveFirst
Me.Label1DestineID.Caption = ReadDestine.Fields("DestineID").Value
Me.LabelDate.Caption = ReadDestine.Fields("DestineDate").Value
Me.TextClientName.Text = ReadDestine.Fields("ClientName").Value
Me.CombRoomType.Text = ReadDestine.Fields("RoomType").Value
Me.CombRoomPrice.Text = ReadDestine.Fields("RoomPrice").Value
Me.TextClientTel.Text = ReadDestine.Fields("ClientTel").Value
Me.TextCount.Text = ReadDestine.Fields("ClientCount").Value
Me.DTPicker1.Value = ReadDestine.Fields("OpenRoomDate").Value
Me.TextORTime.Text = Right(ReadDestine.Fields("OpenRoomTime").Value, 8)
Me.CombWaitor.Text = ReadDestine.Fields("Waitor").Value
Me.TextPrepay.Text = ReadDestine.Fields("Prepay").Value
Me.TextRemake.Text = ReadDestine.Fields("Remake").Value
End If
ReadDestine.Close
End Sub
Private Sub TextCount_KeyPress(KeyAscii As Integer)
KeyAscii = sffunLimitNumber(KeyAscii)
End Sub
Private Sub TextPrepay_KeyPress(KeyAscii As Integer)
KeyAscii = sffunLimitNumber(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -