Imports Microsoft.VisualBasic
Public Class SessionHandler
Private Shared _UserName As String = ""
Private Shared _UserLevel As String = "0"
Private Shared _SignInStatus As String = "False"
Private Shared _BorrowerNumber As String = ""
Private Shared _BorrowerBarcode As String = ""
Private Shared _BorrowerType As String = ""
Private Shared _BorrowerPin As String = ""
Public Shared Sub Clear()
SessionHandler.UserName = ""
SessionHandler.UserLevel = "0"
SessionHandler.SignInStatus = "False"
SessionHandler.BorrowerNumber = ""
SessionHandler.BorrowerBarcode = ""
SessionHandler.BorrowerType = ""
SessionHandler.BorrowerPin = ""
End Sub
Public Shared Property UserName As String
Get
Return HttpContext.Current.Session("Username")
'If (HttpContext.Current.Session(SessionHandler._UserName) Is Nothing) Then
'Return String.Empty
'Else
'Return HttpContext.Current.Session(SessionHandler._UserName).ToString
'End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("Username") = value
' HttpContext.Current.Session(SessionHandler._UserName) = value
End Set
End Property
Public Shared Property UserLevel As String
Get
Return HttpContext.Current.Session("UserLevel")
' If (HttpContext.Current.Session(SessionHandler._UserLevel) Is Nothing) Then
' Return "0"
' Else
' Return HttpContext.Current.Session(SessionHandler._UserLevel).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("UserLevel") = value
'HttpContext.Current.Session(SessionHandler._UserLevel) = value
End Set
End Property
Public Shared Property SignInStatus As String
Get
Return HttpContext.Current.Session("SignInStatus")
' If (HttpContext.Current.Session(SessionHandler._SignInStatus) Is Nothing) Then
' Return "False"
' Else
' Return HttpContext.Current.Session(SessionHandler._SignInStatus).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("SignInStatus") = value
'HttpContext.Current.Session(SessionHandler._SignInStatus) = value
End Set
End Property
Public Shared Property BorrowerNumber As String
Get
Return HttpContext.Current.Session("BorrowerNumber")
' If (HttpContext.Current.Session(SessionHandler._BorrowerNumber) Is Nothing) Then
' Return String.Empty
' Else
' Return HttpContext.Current.Session(SessionHandler._BorrowerNumber).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("BorrowerNumber") = value
' HttpContext.Current.Session(SessionHandler._BorrowerNumber) = value
End Set
End Property
Public Shared Property BorrowerBarcode As String
Get
Return HttpContext.Current.Session("BorrowerBarcode")
' If (HttpContext.Current.Session(SessionHandler._BorrowerBarcode) Is Nothing) Then
' Return String.Empty
' Else
' Return HttpContext.Current.Session(SessionHandler._BorrowerBarcode).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("BorrowerBarcode") = value
' HttpContext.Current.Session(SessionHandler._BorrowerBarcode) = value
End Set
End Property
Public Shared Property BorrowerType As String
Get
Return HttpContext.Current.Session("BorrowerType")
' If (HttpContext.Current.Session(SessionHandler._BorrowerType) Is Nothing) Then
' Return String.Empty
' Else
' Return HttpContext.Current.Session(SessionHandler._BorrowerType).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("BorrowerType") = value
' HttpContext.Current.Session(SessionHandler._BorrowerType) = value
End Set
End Property
Public Shared Property BorrowerPin As String
Get
Return HttpContext.Current.Session("BorrowerPin")
' If (HttpContext.Current.Session(SessionHandler._BorrowerPin) Is Nothing) Then
' Return String.Empty
' Else
' Return HttpContext.Current.Session(SessionHandler._BorrowerPin).ToString
' End If
End Get
Set(ByVal value As String)
HttpContext.Current.Session("BorrowerPin") = value
' HttpContext.Current.Session(SessionHandler._BorrowerPin) = value
End Set
End Property
End Class
|