Public Class objLocate
'This class is used to create objects
'that will store information based
'on what the user wishes to search for
'this class is the core of the searching
'functions. All the searching functions will
'only work if a object created from this class
'is passed to them as an arguement
Dim enumSearchFor As SearchFor 'An enumeration used to tell what the program
'the program should search for
Dim enumMachineUse As desMachineType 'An enumeration that tracks what type
'of machine to search for EX: workstation, Laptop, Pool Laptop ect.
Dim strSearchFor As String 'A string that holds the information usually
'stored in txtSearchFor [The textbox where the user types a search in]
Dim bolRegEx As Boolean 'Boolean used to keep track if the search is
'going to use the regular expression to search
Dim strMachineType As String 'A string that holds information on what
'model machine to search for EX: GX110 , GX400 , GX270 ect.
Dim enumSaveName As enumSaveName 'A enumeration that holds information on what name
'to use for the saved search
Dim strSaveName As String
Public ReadOnly Property SaveNameString() As String
Get
Return ConvertSaveNameEnum(enumSaveName)
End Get
End Property
Public WriteOnly Property SaveName() As enumSaveName
Set(ByVal Value As enumSaveName)
enumSaveName = Value
End Set
End Property
Public Property SearchMachineModel() As String
Get
Return strMachineType
End Get
Set(ByVal Value As String)
strMachineType = Value
End Set
End Property
Public Property SearchRegEx() As Boolean
Get
Return bolRegEx
End Get
Set(ByVal Value As Boolean)
bolRegEx = Value
End Set
End Property
Public Property SearchFor() As SearchFor
Get
Return enumSearchFor
End Get
Set(ByVal Value As SearchFor)
enumSearchFor = Value
End Set
End Property
Public Property SearchMachineUse() As desMachineType
Get
Return enumMachineUse
End Get
Set(ByVal Value As desMachineType)
enumMachineUse = Value
End Set
End Property
Public Property SearchString() As String
Get
Return strSearchFor
End Get
Set(ByVal Value As String)
strSearchFor = Value
End Set
End Property
Public Sub New(ByVal SearchFor As SearchFor, ByVal MachineUse As desMachineType, ByVal strSearchString As String, _
ByVal SaveNameEnum As enumSaveName, Optional ByVal bolReg As Boolean = True, Optional ByVal strType As String = "")
enumSearchFor = SearchFor
enumMachineUse = MachineUse
strSearchFor = strSearchString
bolRegEx = bolReg
strMachineType = strType
enumSaveName = SaveNameEnum
End Sub
Private Function ConvertSaveNameEnum(ByVal enumName As enumSaveName) As String
Select Case enumName
Case 1 : ConvertSaveNameEnum = "RegEx"
Case 2 : ConvertSaveNameEnum = "First Name"
Case 3 : ConvertSaveNameEnum = "Last Name"
Case 4 : ConvertSaveNameEnum = "Phone"
Case 5 : ConvertSaveNameEnum = "Location"
Case 6 : ConvertSaveNameEnum = "Model"
Case 7 : ConvertSaveNameEnum = "Dell Tag"
Case 8 : ConvertSaveNameEnum = "Useage"
Case 9 : ConvertSaveNameEnum = "Workstation"
Case 10 : ConvertSaveNameEnum = "HomeWorkstation"
Case 11 : ConvertSaveNameEnum = "Pool Laptop"
Case 12 : ConvertSaveNameEnum = "Laptop"
Case 13 : ConvertSaveNameEnum = "WoTo"
Case 14 : ConvertSaveNameEnum = "GX110"
Case 15 : ConvertSaveNameEnum = "GX400"
Case 16 : ConvertSaveNameEnum = "GX260"
Case 17 : ConvertSaveNameEnum = "GX270"
Case 18 : ConvertSaveNameEnum = "GX280"
Case 19 : ConvertSaveNameEnum = "SX280"
Case 20 : ConvertSaveNameEnum = "Machine"
Case 21 : ConvertSaveNameEnum = ""
End Select
End Function
End Class