⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 groupcard.cls

📁 这是一个银行IC卡门禁系统软件
💻 CLS
📖 第 1 页 / 共 2 页
字号:
            '    normalorhourcard = True
                'regionorgroup = True
            Case "00"
                normalorhourcard = False
                'regionorgroup = False
            Case "CC"
                normalorhourcard = True
                'regionorgroup = False
            Case Else
                tread = False
        End Select
        
        temp = Mid(ptemp, 41, 10)
        begindatetime = BCDToDate(temp)
        
        temp = Mid(ptemp, 51, 10)
        enddatetime = BCDToDate(temp)
        
        temp = Mid(ptemp, 93, 4)
        cardpwd = CLng("&H" + temp)
        
        temp = Mid(ptemp, 97, 4)
        operatorid = CLng("&H" + temp)
        
        temp = Mid(ptemp, 101, 4)
        userid = CLng("&H" + temp)
        
        temp = Mid(ptemp, 105, 2)
        mvarBuildingList(0) = CLng("&H" + temp)
        
        For j = 0 To 4
            For k = 0 To 1
                temp = Mid(ptemp, 107 + 4 * j + 2 * k, 2)
                mvarRoomList(0, j, k) = CLng("&H" + temp)
            Next k
        Next j
        
        temp = Mid(ptemp, 127, 2)
        mvarRoomList(0, 5, 0) = CLng("&H" + temp)
        
    End If
    
    temp = ""
    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
    
    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.readsub2(temp)
    
    If (ptemp = "") Or (Len(ptemp) <> 128) Then
        
        tread = False
        Err.Raise 60012, "regioncard.readsub", GetError(12)
    
    Else
        
        tread = True
        
        temp = Mid(ptemp, 33, 2)
        mvarRoomList(0, 5, 1) = CLng("&H" + temp)
        
        For j = 6 To 16
            For k = 0 To 1
                temp = Mid(ptemp, 35 + 4 * (j - 6) + 2 * k, 2)
                mvarRoomList(0, j, k) = CLng("&H" + temp)
            Next k
        Next j
        
        temp = Mid(ptemp, 81, 2)
        mvarBuildingList(1) = CLng("&H" + temp)
        
        For j = 0 To 10
            For k = 0 To 1
                temp = Mid(ptemp, 83 + 4 * j + 2 * k, 2)
                mvarRoomList(1, j, k) = CLng("&H" + temp)
            Next k
        Next j
        
        temp = Mid(ptemp, 127, 2)
        mvarRoomList(1, 11, 0) = CLng("&H" + temp)
        
    End If
    
    temp = ""
    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
    
    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.readsub3(temp)
    
    If (ptemp = "") Or (Len(ptemp) <> 128) Then
        
        tread = False
        Err.Raise 60012, "regioncard.readsub", GetError(12)
    
    Else
        
        tread = True
        
        temp = Mid(ptemp, 33, 2)
        mvarRoomList(1, 11, 1) = CLng("&H" + temp)
        
        For j = 12 To 16
            For k = 0 To 1
                temp = Mid(ptemp, 35 + 4 * (j - 12) + 2 * k, 2)
                mvarRoomList(1, j, k) = CLng("&H" + temp)
            Next k
        Next j
        
        temp = Mid(ptemp, 57, 2)
        mvarBuildingList(2) = CLng("&H" + temp)
        
        For j = 0 To 16
            For k = 0 To 1
                temp = Mid(ptemp, 59 + 4 * j + 2 * k, 2)
                mvarRoomList(2, j, k) = CLng("&H" + temp)
            Next k
        Next j
        
                
    End If

End Function

Public Function sSetBuildingList(ByRef BuildingList() As Byte) As Boolean
    
    If LBound(BuildingList(), 1) < 0 Or UBound(BuildingList(), 1) > 2 Then
        sSetBuildingList = False
        Err.Raise 60011, "RegionCard.SetBuildingList", GetError(11)
        Exit Function
    End If
    
    Dim i As Integer
        
    For i = 0 To 2
        mvarBuildingList(i) = BuildingList(i)
    Next
    sSetBuildingList = True
End Function


Public Function sGetBuildingList(ByRef BuildingList() As Byte) As Boolean
    
    If LBound(BuildingList(), 1) < 0 Or UBound(BuildingList(), 1) > 2 Then
        sGetBuildingList = False
        Err.Raise 60011, "RegionCard.GetBuildingList", GetError(11)
        Exit Function
    End If
    
    Dim i As Integer
        
    For i = 0 To 2
        BuildingList(i) = mvarBuildingList(i)
    Next
    sGetBuildingList = True
End Function

Public Function sSetRoomList(ByRef Roomlist() As Byte) As Boolean
    
    If LBound(Roomlist(), 1) < 0 Or LBound(Roomlist, 2) < 0 And LBound(Roomlist, 3) < 0 _
        Or UBound(Roomlist, 1) > 2 Or UBound(Roomlist, 2) > 16 Or UBound(Roomlist, 3) > 1 Then
        sSetRoomList = False
        Err.Raise 60011, "RegionCard.SetRoomList", GetError(11)
        Exit Function
    End If
    
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    
    For i = 0 To 2
        For j = 0 To 16
            For k = 0 To 1
                mvarRoomList(i, j, k) = Roomlist(i, j, k)
            Next
        Next
    Next
    sSetRoomList = True
End Function


Public Function sGetRoomList(ByRef Roomlist() As Byte) As Boolean
    
    If LBound(Roomlist(), 1) < 0 Or LBound(Roomlist, 2) < 0 And LBound(Roomlist, 3) < 0 _
        Or UBound(Roomlist, 1) > 2 Or UBound(Roomlist, 2) > 16 Or UBound(Roomlist, 3) > 1 Then
        sGetRoomList = False
        Err.Raise 60011, "RegionCard.GetRoomList", GetError(11)
        Exit Function
    End If
    
    Dim i As Integer
    Dim j As Integer
    Dim k As Integer
    
    For i = 0 To 2
        For j = 0 To 16
            For k = 0 To 1
                Roomlist(i, j, k) = mvarRoomList(i, j, k)
            Next
        Next
    Next
    sGetRoomList = True
End Function



Public Property Let enddatetime(ByVal vData As Date)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.enddatetime = 5
    mvarenddatetime = vData
End Property


Public Property Get enddatetime() As Date
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.enddatetime
    enddatetime = mvarenddatetime
End Property



Public Property Let begindatetime(ByVal vData As Date)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.begindatetime = 5
    mvarbegindatetime = vData
End Property


Public Property Get begindatetime() As Date
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.begindatetime
    begindatetime = mvarbegindatetime
End Property



Public Property Let userid(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.userid = 5
    If vData > 65535 Or vData < 0 Then
        Err.Raise 60012, "regioncard.userid", GetError(12)
        Exit Property
    End If
    mvaruserid = vData
End Property


Public Property Get userid() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.userid
    userid = mvaruserid
End Property



Public Property Let operatorid(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.operatorid = 5
    If vData > 65535 Or vData < 0 Then
        Err.Raise 60012, "regioncard.operatorid", GetError(12)
        Exit Property
    End If
    mvaroperatorid = vData
End Property


Public Property Get operatorid() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.operatorid
    operatorid = mvaroperatorid
End Property

Public Property Let hotelpwd(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.hotelpwd = 5
    If vData > 65535 Or vData < 0 Then
        Err.Raise 60012, "regioncard.hotelpwd", GetError(12)
        Exit Property
    End If
    mvarhotelpwd = vData
End Property


Public Property Get hotelpwd() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.hotelpwd
    hotelpwd = mvarhotelpwd
End Property



Public Property Let hotelcode(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.hotelcode = 5
    If vData > 65535 Or vData < 0 Then
        Err.Raise 60012, "regioncard.hotelcode", GetError(12)
        Exit Property
    End If
    mvarhotelcode = vData
End Property


Public Property Get hotelcode() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.hotelcode
    hotelcode = mvarhotelcode
End Property



Public Property Let cardtype(ByVal vData As Byte)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.cardtype = 5
    mvarcardtype = vData
End Property


Public Property Get cardtype() As Byte
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.cardtype
    cardtype = mvarcardtype
End Property



Public Property Let cardpwd(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.cardpwd = 5
    If vData > 65534 Or vData < 1 Then
        Err.Raise 60012, "regioncard.cardpwd", GetError(12)
        Exit Property
    End If
    mvarcardpwd = vData
End Property


Public Property Get cardpwd() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.cardpwd
    cardpwd = mvarcardpwd
End Property



Public Property Let cardno(ByVal vData As Long)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.cardno = 5
    If vData > 65535 Or vData < 0 Then
        Err.Raise 60012, "regioncard.cardno", GetError(12)
        Exit Property
    End If
    mvarcardno = vData
End Property


Public Property Get cardno() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.cardno
    cardno = mvarcardno
End Property



Private Sub Class_Initialize()

    ReDim mvarRoomList(0 To 2, 0 To 16, 0 To 1)
    ReDim mvarBuildingList(0 To 2)
    
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -