Skip to content

ObjectServices

ObjectServices is a public class in SAIF.Business that groups shared helper methods for portal-request setup, user/security lookup, translations, state validation, and general value conversion.

Purpose

  • Creates portal and data-request objects for callers working with IDataPortalInfo.
  • Retrieves user department, location, fax, and phone details through clsAccountMaintProxy.
  • Provides shared helpers for translations, authorization checks, resource-access checks, and state validation.
  • Converts database values and retrieves the BDS reporting date used by downstream workflows.

Context

  • Namespace: SAIF.Business
  • Assembly/package: SAIF.Business

Public members

Member Signature Purpose
CreateDataPortalRequest Public Shared Sub CreateDataPortalRequest(ByRef inDPI As IDataPortalInfo, ByRef inPR As IPortalRequest, ByRef inDR As IDataRequest) Instantiates a new portal request and its first data request for the supplied portal context.
GetUserInfoDepartmentLocation Public Shared Sub GetUserInfoDepartmentLocation(ByVal inUserID As String, ByRef inDepartment As String, ByRef inLocation As String) Retrieves a user's department and location values from account-maintenance user info.
GetUserInfoFax Public Shared Function GetUserInfoFax(ByVal inUserID As String) As clsPhone Retrieves a user's fax number and returns it in a clsPhone object.
GetUserInfoPhone Public Shared Function GetUserInfoPhone(ByVal inUserID As String) As clsPhone Retrieves a user's telephone number and returns it in a clsPhone object.
DBValueToString Public Shared Function DBValueToString(ByVal inValue As Object) As String Converts a non-DBNull object to String and otherwise returns String.Empty.
GetTranslation Public Shared Function GetTranslation(ByVal inDataPortalInfo As IDataPortalInfo, _ ByVal inLookupKey As String, _ Optional ByVal inGender As clsLanguageTranslation.LanguageGender = clsLanguageTranslation.LanguageGender.Masculine, _ Optional ByVal inLanguage As clsLanguageTranslation.SupportedLanguages = clsLanguageTranslation.SupportedLanguages.Spanish) As String Retrieves a translated value for the supplied lookup key, language, and gender.
IsAuthorized Public Shared Function IsAuthorized(ByVal inResource As String) As Boolean Checks whether the current security principal is authorized for the named resource.
IsValidState Public Shared Function IsValidState(ByVal inDataPortalInfo As IDataPortalInfo, ByVal inStateCode As String) As Boolean Queries ALL_STATES to determine whether the supplied state code exists.
HasResourceAccess Public Overloads Shared Function HasResourceAccess(ByVal inMailid As String, ByVal inResource As String) As Boolean Checks cached internal resource access for the supplied mail ID and resource.
HasResourceAccessExternal Public Overloads Shared Function HasResourceAccessExternal(ByVal inMailid As String, ByVal inResource As String) As Boolean Checks cached external resource access for the supplied mail ID and resource.
GetBDSValueDate Public Shared Function GetBDSValueDate(ByVal inDPI As IDataPortalInfo) As Date Calls the cp_report_date stored procedure and returns the reporting date value.

Behavioral notes

  • The XML documentation on CreateDataPortalRequest states that the shortcut method should no longer be called and recommends using inDPI.NewPortalRequest and PR.NewRequest directly.
  • GetUserInfoFax and GetUserInfoPhone swallow exceptions and return a clsPhone object even when user lookup fails.
  • GetTranslation uppercases the lookup key before requesting the translation object.
  • IsValidState runs Select Count(*) from ALL_STATES where State = :StateCode and returns True only when the count is greater than zero.

Constraints and usage notes

  • All members are Shared; the class acts as a stateless utility surface.
  • GetTranslation defaults to masculine Spanish translation when optional parameters are omitted.
  • Authorization, resource-access, translation, and portal-query methods depend on working security, language, and data-portal infrastructure.

Sources

  • Business\SAIF.Business\ObjectServices.vb