日期:2009-08-06  浏览次数:20426 次

Imports System
Imports System.Data
Imports System.Configuration
Public Class ttuser
'****************************************************************************

'
' TTUser Class
'
' The TTUser class represents a Time Tracker user, including their unique
' userID and UserName. Custom role information retrieved from the database
' is also stored in the TTUser class.
'
'****************************************************************************


Public Const UserRoleNone As String = "0"
Public Const UserRoleAdministrator As String = "1"
Public Const UserRoleProjectManager As String = "2"
Public Const UserRoleConsultant As String = "3"
Public Const UserRoleAdminPMgr As String = UserRoleAdministrator + "," + UserRoleProjectManager
Public Const UserRolePMgrConsultant As String = UserRoleProjectManager + "," + UserRoleConsultant

Private _displayName As String = String.Empty
Private _firstName As String = String.Empty
Private _lastName As String = String.Empty
Private _password As String = String.Empty
Private _role As String = UserRoleNone
Private _roleName As String
Private _userID As Integer
Private _userName As String

Public Sub New()
End Sub 'New

Public Sub New(ByVal UserName As String)
_userName = UserName
End Sub 'New

Public Sub New(ByVal UserID As Integer, ByVal UserName As String, ByVal Name As String, ByVal Role As String)
_userID = UserID
_userName = UserName
_displayName = Name
_role = Role
End Sub 'New

Public Property DisplayName() As String
Get
Return _displayName
End Get
Set(ByVal Value As String)
_displayName = Value
End Set
End Property

Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal Value As String)
_firstName = Value
End Set
End Property

Public Property LastName() As String
Get
Return _lastName
End Get
Set(ByVal Value As String)
_lastName = Value
End Set
End Property

Public Property Name() As String
Get
Return _displayName
End Get
Set(ByVal Value As String)
_displayName = Value
End Set
End Property

Public Property Password() As String
Get
Return _password
End Get
Set(ByVal Value As String)
_password = Value
End Set
End Property

Public Property Role() As String
Get
Return _role
End Get
Set(ByVal Value As String)
_role = Value
End Set
End Property

Public Property RoleName() As String
Get
Return _roleName
End Get
Set(ByVal Value As String)
_roleName = Value
End Set
End Property

Public Property UserID() As Integer
Get
Return _userID
End Get
Set(ByVal Value As Integer)
_userID = Value
End Set
End Property

Public Property UserName() As String
Get