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
CreateDataPortalRequeststates that the shortcut method should no longer be called and recommends usinginDPI.NewPortalRequestandPR.NewRequestdirectly. GetUserInfoFaxandGetUserInfoPhoneswallow exceptions and return aclsPhoneobject even when user lookup fails.GetTranslationuppercases the lookup key before requesting the translation object.IsValidStaterunsSelect Count(*) from ALL_STATES where State = :StateCodeand returnsTrueonly when the count is greater than zero.
Constraints and usage notes¶
- All members are
Shared; the class acts as a stateless utility surface. GetTranslationdefaults 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