Interface IAssociateService
Used to get or edit associate information. To create or upgrade associates see WriteApplication(Application, Boolean).
Namespace: DirectScale.Disco.Extension.Services
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public interface IAssociateService
Methods
FindAssociate(String)
Returns the top 50 items.
Declaration
Task<FindAssociateResult[]> FindAssociate(string searchTerm)
Parameters
Type | Name | Description |
---|---|---|
System.String | searchTerm |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<FindAssociateResult[]> |
GetAssociate(Int32)
Returns the associate's details by associateId
.
Declaration
Task<Associate> GetAssociate(int associateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | The associate's Id. This is the DB recordnumber. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Associate> | Associate's information. |
Remarks
Don't call in a loop, use GetAssociates(Int32[]) for bulk reads.
See Also
GetAssociateByBackOfficeId(String)
Returns the associate's details by backofficeId
.
Declaration
Task<Associate> GetAssociateByBackOfficeId(string backofficeId)
Parameters
Type | Name | Description |
---|---|---|
System.String | backofficeId | The unique display id. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Associate> | Associate's information. |
See Also
GetAssociates(Int32[])
Read multiple associates at once by their associateIds
.
Declaration
Task<IReadOnlyDictionary<int, Associate>> GetAssociates(int[] associateIds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | associateIds | The associate ids to read. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<System.Int32, Associate>> | Associate information by id. Associate ids not found will have a key present in the dictionary, but the value will be null/ |
Remarks
More efficient than GetAssociate(Int32).
See Also
GetAssociateTypeName(Int32)
Gets the text description of the associateType
id.
Declaration
Task<string> GetAssociateTypeName(int associateType)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateType | The type id. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | The name associate with the corresponding |
Remarks
Associate types are configured through a admin settings page.
Examples
GetAssociateTypeName(1): "Distributor", GetAssociateTypeName(1): "Retail cutomer"
GetLocalization(Int32)
Gets Localization information used to display pages to user correctly.
Declaration
Task<Localization> GetLocalization(int associateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | The associate. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Localization> | Associate's prefered language. |
GetProfileImageURL(Int32)
Get's url to associate's profile image.
Declaration
Task<string> GetProfileImageURL(int associateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | Associate. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Relative route to image. |
GetRetailAssociateTypes()
Gets all associate types that are retail only customers.
Declaration
Task<int[]> GetRetailAssociateTypes()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32[]> |
Remarks
Retail customers are those that purchase products, but don't participate in sales and commissions.
GetSocialInfo(Int32)
Get the associateId
's social account handles.
Declaration
Task<SocialInfo> GetSocialInfo(int associateId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | The associate. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SocialInfo> | Their social media information. |
SetAssociateStatus(Int32, Int32)
Changes an associate's status to statusId
.
Declaration
Task SetAssociateStatus(int associateId, int statusId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | associateId | Associate to change. |
System.Int32 | statusId | The new status id. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Remarks
See "Configure Associate Statuses" admin page for details.
See Also
UpdateAssociate(Associate)
Modify the values of an existing associate.
Declaration
Task UpdateAssociate(Associate associate)
Parameters
Type | Name | Description |
---|---|---|
Associate | associate |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Remarks
Not all values can be changed, see Associate property remarks for details.
Note: If an associate is upgrading from a retail customer, WriteApplication(Application, Boolean) will ususally need to be called.