📄 clscheckout.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ClsCheckOut"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'General Declarations
'local variable(s) to hold property value(s)
Private mvarCustId As String
Private mvarRoomNo As Integer
' declaring the ADODB objects
Dim cn As ADODB.Connection
Dim cmdreserv As ADODB.Command
Dim cmdroom As ADODB.Command
'property to return the RoomNo
Public Property Let RoomNo(ByVal vData As Integer)
mvarRooomNo = vData
End Property
'property to store the RoomNo
Public Property Get RoomNo() As Integer
RoomNo = mvarRoomNo
End Property
'method to delete the record from the Reservation table and update the Room table
Public Sub UpdateReservation()
Dim strreserv As String
Set cn = New ADODB.Connection
Set cmdreserv = New ADODB.Command
Set cmdroom = New ADODB.Command
'change the DN that you have created.
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=customer;Data Source=09d13bd4bca4422"
strreserv = "delete from Reservation where cust_id = ' " & mvarCustId & " ' "
cmdreserv.ActiveConnection = cn
cmdreserv.CommandText = strreserv
cmdreserv.CommandType = adCmdText
cmdreserv.Execute
strRoom = " Update Room set statrus= 'A' where room_no= " & mvarRoomNo
cmdroom.ActiveConnection = cn
cmdroom.CommandText = strRoom
cmdroom.CommandType = adCmdText
End Sub
'property to store the CustId
Public Property Let CustId(ByVal vData As String)
mvarCustId = vData
End Property
'property to return the CustID
Public Property Get CustId() As String
CustId = mvarCustId
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -