SHARE
TWEET

Untitled

a guest Jun 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class ZKEMEventsClass
  2.  
  3.     Public CZKEM2 As New zkemkeeper.CZKEM
  4.     Public MyNewWrapperClass As MyWrapperClass
  5.  
  6.     Public Sub AddBioHandler(iDevice As String, iIP As String, iPort As Integer)
  7.         If CZKEM2.Connect_Net(iIP, iPort) Then
  8.             If CZKEM2.RegEvent(1, 65535) = True Then
  9.  
  10.                 MyNewWrapperClass = New MyWrapperClass(iDevice, CZKEM2)
  11.  
  12.                 AddHandler MyNewWrapperClass.AttEventWrapper, AddressOf LogRaised
  13.  
  14.             Else
  15.                 MsgBox("Error Registering Events")
  16.             End If
  17.         Else
  18.             MsgBox("Error Connecting to Device")
  19.         End If
  20.  
  21.     End Sub
  22.  
  23.  
  24.     Public Sub RemoveBioHandler(iDevice As String, CZKEM As zkemkeeper.CZKEM)
  25.         '----------------------------------------------------------
  26.         'RemoveHandler MyNewWrapperClass.AttEventWrapper, AddressOf LogRaised
  27.         'I DONT KNOW IF I SHOULD REMOVE THE HANDLER HERE
  28.         '----------------------------------------------------------
  29.     End Sub
  30.  
  31.     Public Sub LogRaised(ByVal SenderName As String, ByVal sEnrollNumber As String, ByVal iIsInValid As Integer, ByVal iAttState As Integer, ByVal iVerifyMethod As Integer, ByVal iYear As Integer, ByVal iMonth As Integer, ByVal iDay As Integer, ByVal iHour As Integer, ByVal iMinute As Integer, ByVal iSecond As Integer, ByVal iWorkCode As Integer)
  32.         MsgBox("Raised event details here... [EnrollID, Year, Month, Day]...")
  33.     End Sub
  34. End Class
  35.      
  36. Sub ConnectToDevice()
  37.         Dim iIP As String
  38.         Dim iDevice As String
  39.         Dim iPort As Integer
  40.         For x = 1 To 2
  41.             Select Case x
  42.                 Case 1
  43.                     iIP = "122.3.47.43"
  44.                     iDevice = "Device 1"
  45.                 Case 2
  46.                     iIP = "192.168.10.201"
  47.                     iDevice = "Device 2"
  48.             End Select
  49.  
  50.  
  51.             'This is the section where I create new instance of my ZKEMEventsClass
  52.             Dim NewConnect As New ZKEMEventsClass
  53.             NewConnect.AddBioHandler(iDevice, iIP, iPort)
  54.  
  55.         Next
  56. End Sub
  57.  
  58. Sub DisconnectFromDevice()
  59.         'THIS IS WHERE I ENTER MY RemoveHandler CODES BUT NOT WORKING
  60.         Dim NewConnect as New ZKEMEventsClass
  61.         NewConnect.RemoveBioHandler(iDevice, iIP, iPort)
  62. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top