Search Results for

    Show / Hide Table of Contents

    Class AssociateService

    Inheritance
    System.Object
    AssociateService
    Implements
    IAssociateService
    Namespace: DirectScale.Disco.Extension.Services
    Assembly: DirectScale.Disco.Extension.Abstractions.dll
    Syntax
    public class AssociateService : Object, IAssociateService

    Constructors

    AssociateService(IApiService)

    Declaration
    public AssociateService(IApiService apiService)
    Parameters
    Type Name Description
    IApiService apiService

    Methods

    FindAssociate(String)

    Returns the top 50 items.

    Declaration
    public 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
    public 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
    GetAssociates(Int32[])
    AssociateId

    GetAssociateByBackOfficeId(String)

    Returns the associate's details by backofficeId.

    Declaration
    public 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
    GetAssociate(Int32)
    GetAssociates(Int32[])
    BackOfficeId

    GetAssociates(Int32[])

    Read multiple associates at once by their associateIds.

    Declaration
    public 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
    AssociateId

    GetAssociateTypeName(Int32)

    Gets the text description of the associateType id.

    Declaration
    public 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 associateType id.

    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
    public 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
    public 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
    public 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
    public 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
    public 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
    StatusId

    UpdateAssociate(Associate)

    Modify the values of an existing associate.

    Declaration
    public 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.

    Implements

    IAssociateService
    In This Article
    Back to top Copyright © 2022 DirectScale
    Generated by DocFX