Class FavouriteAgent
Proxy class for the Favourite Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class FavouriteAgent : IFavouriteAgent, IAgent
Constructors
FavouriteAgent(IFavouriteImplementation, ISoRequestItemsAccessor)
Proxy class for the Favourite Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public FavouriteAgent(IFavouriteImplementation favouriteImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IFavouriteImplementation | favouriteImplementation | |
ISoRequestItemsAccessor | accessor |
FavouriteAgent(IFavouriteImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the Favourite Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public FavouriteAgent(IFavouriteImplementation favouriteImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type | Name | Description |
---|---|---|
IFavouriteImplementation | favouriteImplementation | |
ISoRequestItemsAccessor | accessor | |
IDebugUser | debugUser | |
IServiceCallsRepository | serviceCallsRepository |
Methods
AddFavouriteAsync(string, int, int, string, CancellationToken)
Add a record in a table as a favourite for an associate
Declaration
public Task AddFavouriteAsync(string tableName, int recordId, int associateId, string extraInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | recordId | Id of a record in your specified table (tableName) |
int | associateId | Id of a current user |
string | extraInfo | Any extra information |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
AddFavouritesAsync(string, int[], int, string, CancellationToken)
Add a list of record ids as favourites for an associate
Declaration
public Task AddFavouritesAsync(string tableName, int[] recordIds, int associateId, string extraInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int[] | recordIds | Ids of records in your specified table (tableName). Corresponding rows will be added as Favourites. |
int | associateId | Id of a current user |
string | extraInfo | Any extra information |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
AddTicketsToFavouritesByProviderAsync(string, ArchiveRestrictionInfo[], int, string, CancellationToken)
Add a list of tickets as favourites that are given by the ticket provider.
Declaration
public Task AddTicketsToFavouritesByProviderAsync(string providerName, ArchiveRestrictionInfo[] restrictions, int associateId, string extraInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of a ticket provider |
ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
int | associateId | Id of a current user |
string | extraInfo | Any extra information |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
GetFavouritesAsync(string, int, CancellationToken)
Get all favourites for a table and associate
Declaration
public Task<Favourite[]> GetFavouritesAsync(string tableName, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Favourite[]> | Requested favourites for a table and associate |
IsFavouriteAsync(string, int, int, CancellationToken)
Checks if a record in a table is a favourite for an associate
Declaration
public Task<bool> IsFavouriteAsync(string tableName, int recordId, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | recordId | Id of a record in your specified table (tableName) |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<bool> | Is Favourite? |
RemoveAllFavouritesAsync(string, int, CancellationToken)
Remove all favourites for a table and associate
Declaration
public Task RemoveAllFavouritesAsync(string tableName, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
RemoveFavouriteAsync(string, int, int, CancellationToken)
Remove favourite for a table, record id and associate
Declaration
public Task RemoveFavouriteAsync(string tableName, int recordId, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | recordId | Id of a record in your specified table (tableName) |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
RemoveFavouritesAsync(string, int[], int, CancellationToken)
Remove a list of record ids from favourites for an associate
Declaration
public Task RemoveFavouritesAsync(string tableName, int[] recordIds, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int[] | recordIds | Ids of records in your specified table (tableName). Corresponding rows will be removed from Favourites. |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
RemoveFavouritesByIdAsync(int[], CancellationToken)
Remove favourite using favourite id
Declaration
public Task RemoveFavouritesByIdAsync(int[] favouriteIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | favouriteIds | Ids of favourite rows to delete |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
RemoveTicketsFromFavouritesByProviderAsync(string, ArchiveRestrictionInfo[], int, CancellationToken)
Remove a list of tickets from favourites that are given by the ticket provider.
Declaration
public Task RemoveTicketsFromFavouritesByProviderAsync(string providerName, ArchiveRestrictionInfo[] restrictions, int associateId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | providerName | Name of a ticket provider |
ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
int | associateId | Id of a current user |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
ToggleFavouriteAsync(string, int, int, string, CancellationToken)
Toggle a record in a table as a favourite for an associate
Declaration
public Task<bool> ToggleFavouriteAsync(string tableName, int recordId, int associateId, string extraInfo, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | Table name, transformed to and from numeric table id by the service layer. |
int | recordId | Id of a record in your specified table (tableName) |
int | associateId | Id of a current user |
string | extraInfo | Any extra information |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<bool> | Return the new value, true if added, false if removed |