Guest User

Untitled

a guest
Feb 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Public Sub New(ByVal Staff_ID As Integer, Optional ByVal Type As StaffHelperType = StaffHelperType.LoggedInUser)
  2.  
  3. Dim dt As DataTable = ReadStaffMembers()
  4.  
  5. Dim row() As DataRow = dt.Select(AE.Utility.Query.BuildComparisonClause("Staff_Member_ID", Staff_ID))
  6.  
  7. 'TODO: SF 5/5/06 Need to re-evaluate this solution to the staff caching problem
  8. 'If no staff member was found, flush out the staff tables from cache and look again
  9. If row.Length = 0 Then
  10.  
  11. 'EventLog.WriteEntry("FileCaching", String.Concat(HttpRuntime.AppDomainAppVirtualPath, " calling StaffHelper.ResetStaffCache from StaffHelper.New(", Staff_ID.ToString, ", ", Type.ToString, ")"), EventLogEntryType.Warning)
  12.  
  13. ResetStaffCache()
  14.  
  15. dt = ReadStaffMembers()
  16.  
  17. row = dt.Select(AE.Utility.Query.BuildComparisonClause("Staff_Member_ID", Staff_ID))
  18.  
  19. End If
  20.  
  21. 'Return the first record that matches
  22. If row.Length > 0 Then
  23.  
  24. 'Use the PrepareRecordHashtable routine to create our hashtable so dbnulls are handled properly
  25. _StaffMember = AE.Utility.Convert.ToHashtable(row(0))
  26.  
  27. End If
  28.  
  29. 'Create the object instance name
  30. CreateObjectInstanceName(Type)
  31.  
  32. 'Find the access level that the staff member has and initialze the private variable for the readonly property StatewideAccessLevel
  33. _StatewideAccessLevel = CInt(CType(SecurityParameters("Participant"), Hashtable)("Statewide Access Level"))
  34.  
  35. End Sub
Add Comment
Please, Sign In to add comment