📄 groupcard.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 = "groupcard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'保持属性值的局部变量
Private mvarcardno As Long '局部复制
Private mvarcardpwd As Long '局部复制
Private mvarcardtype As Byte '局部复制
Private mvarhotelcode As Long '局部复制
Private mvarhotelpwd As Long '局部复制
Private mvaroperatorid As Long '局部复制
Private mvaruserid As Long '局部复制
Private mvarbegindatetime As Date '局部复制
Private mvarenddatetime As Date '局部复制
'保持属性值的局部变量
Private mvarnormalorhourcard As Boolean '局部复制
Private mvarRoomList() As Byte
Private mvarBuildingList() As Byte
Public Property Let normalorhourcard(ByVal vData As Boolean)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.normalorhourcard = 5
mvarnormalorhourcard = vData
End Property
Public Property Get normalorhourcard() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.normalorhourcard
normalorhourcard = mvarnormalorhourcard
End Property
Public Function twrite() As Boolean
Dim ptemp As String
Dim temp As String
Dim ntemp As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim thisdatetime As Data
Dim prepaydatetime As Data
Dim card1 As New tmreadtype
Set card1 = New tmreadtype
With card1
.treadtype
temp = .romid
i = CLng("&H" + Mid(temp, 15, 2))
If i <> 2 Then
Err.Raise 60005, , GetError(5)
Exit Function
End If
Me.cardtype = .cardtype
If .cardtype <> 7 Then
Err.Raise 60005, , GetError(5)
Exit Function
End If
End With
'PortNum = linkport
'PortType = linktype
ptemp = ""
temp = Hex(cardtype)
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(cardno)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
ptemp = ptemp + "0101010101"
temp = Hex(hotelcode)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(hotelpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(255 - cardtype)
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(65535 - cardno)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
ptemp = ptemp + "01"
ptemp = ptemp + "000000"
temp = ""
If normalorhourcard Then
'If regionorgroup Then
' temp = "BB"
'Else
temp = "CC"
'End If
Else
'If regionorgroup Then
' temp = "AA"
'Else
temp = "00"
'End If
End If
ptemp = ptemp + temp
temp = DateToBCD(begindatetime)
ptemp = ptemp + temp
temp = DateToBCD(enddatetime)
ptemp = ptemp + temp
ptemp = ptemp + "0000000000000000"
ptemp = ptemp + "0000000000000000"
temp = Hex(cardpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(operatorid)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(userid)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(mvarBuildingList(0))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
For j = 0 To 4
For k = 0 To 1
temp = Hex(mvarRoomList(0, j, k))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
Next k
Next j
temp = Hex(mvarRoomList(0, 5, 0))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
twrite = tm91.writesub1(ptemp)
ptemp = ""
ptemp = ptemp + "0202020202020202"
temp = Hex(hotelcode)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(hotelpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(255 - cardtype)
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(65535 - cardno)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
ptemp = ptemp + "02"
temp = Hex(mvarRoomList(0, 5, 1))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
For j = 6 To 16
For k = 0 To 1
temp = Hex(mvarRoomList(0, j, k))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
Next k
Next j
ptemp = ptemp + "00"
temp = Hex(mvarBuildingList(1))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
For j = 0 To 10
For k = 0 To 1
temp = Hex(mvarRoomList(1, j, k))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
Next k
Next j
temp = Hex(mvarRoomList(1, 11, 0))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
twrite = tm91.writesub2(ptemp)
ptemp = ""
ptemp = ptemp + "0303030303030303"
temp = Hex(hotelcode)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(hotelpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(255 - cardtype)
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = Hex(65535 - cardno)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
ptemp = ptemp + "03"
temp = Hex(mvarRoomList(1, 11, 1))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
For j = 12 To 16
For k = 0 To 1
temp = Hex(mvarRoomList(1, j, k))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
Next k
Next j
ptemp = ptemp + "00"
temp = Hex(mvarBuildingList(2))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
For j = 0 To 16
For k = 0 To 1
temp = Hex(mvarRoomList(2, j, k))
While Len(temp) < 2
temp = "0" + temp
Wend
ptemp = ptemp + temp
Next k
Next j
ptemp = ptemp + "00"
twrite = tm91.writesub3(ptemp)
End Function
Public Function tread() As Boolean
Dim ptemp As String
Dim temp As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim card1 As New tmreadtype
Set card1 = New tmreadtype
With card1
.treadtype
temp = .romid
i = CLng("&H" + Mid(temp, 15, 2))
If i <> 2 Then
Err.Raise 60005, , GetError(5)
Exit Function
End If
Me.cardtype = .cardtype
If .cardtype <> 7 Then
Err.Raise 60005, , GetError(5)
Exit Function
End If
End With
'PortNum = linkport
'PortType = linktype
temp = ""
ptemp = ""
temp = Hex(hotelcode)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = ""
temp = Hex(hotelpwd)
While Len(temp) < 4
temp = "0" + temp
Wend
ptemp = ptemp + temp
temp = ""
temp = ptemp
ptemp = ""
ptemp = tm91.readsub1(temp)
If (ptemp = "") Or (Len(ptemp) <> 128) Then
tread = False
Err.Raise 60012, "regioncard.readsub", GetError(12)
Else
tread = True
temp = Mid(ptemp, 1, 2)
cardtype = CLng("&H" + temp)
temp = Mid(ptemp, 3, 4)
cardno = CLng("&H" + temp)
temp = Mid(ptemp, 17, 4)
hotelcode = CLng("&H" + temp)
temp = Mid(ptemp, 21, 4)
hotelpwd = CLng("&H" + temp)
temp = Mid(ptemp, 39, 2)
Select Case temp
'Case "AA"
' normalorhourcard = False
'regionorgroup = True
'Case "BB"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -