Show / Hide Table of Contents

Class TargetsAgent

Proxy class for the Targets Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Inheritance
object
TargetsAgent
Implements
ITargetsAgent
IAgent
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOfficeCRMServices
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class TargetsAgent : ITargetsAgent, IAgent

Constructors

TargetsAgent(ITargetAssignmentImplementation, ITargetDimensionImplementation, ITargetGroupImplementation, ITargetRevisionImplementation, ITargetRevisionHistoryImplementation, ISoRequestItemsAccessor)

Declaration
public TargetsAgent(ITargetAssignmentImplementation targetAssignmentImplementation, ITargetDimensionImplementation targetDimensionImplementation, ITargetGroupImplementation targetGroupImplementation, ITargetRevisionImplementation targetRevisionImplementation, ITargetRevisionHistoryImplementation targetRevisionHistoryImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type Name Description
ITargetAssignmentImplementation targetAssignmentImplementation
ITargetDimensionImplementation targetDimensionImplementation
ITargetGroupImplementation targetGroupImplementation
ITargetRevisionImplementation targetRevisionImplementation
ITargetRevisionHistoryImplementation targetRevisionHistoryImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor

TargetsAgent(ITargetAssignmentImplementation, ITargetDimensionImplementation, ITargetGroupImplementation, ITargetRevisionImplementation, ITargetRevisionHistoryImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)

Declaration
public TargetsAgent(ITargetAssignmentImplementation targetAssignmentImplementation, ITargetDimensionImplementation targetDimensionImplementation, ITargetGroupImplementation targetGroupImplementation, ITargetRevisionImplementation targetRevisionImplementation, ITargetRevisionHistoryImplementation targetRevisionHistoryImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
Type Name Description
ITargetAssignmentImplementation targetAssignmentImplementation
ITargetDimensionImplementation targetDimensionImplementation
ITargetGroupImplementation targetGroupImplementation
ITargetRevisionImplementation targetRevisionImplementation
ITargetRevisionHistoryImplementation targetRevisionHistoryImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor
SuperOffice.Data.IDebugUser debugUser
SuperOffice.Diagnostics.IServiceCallsRepository serviceCallsRepository
SuperOffice.Configuration.ConfigFile.IScriptingConfiguration scriptingConfiguration
SuperOffice.Configuration.ConfigFile.IOnlineConfiguration onlineConfiguration

Methods

CreateDefaultTargetAssignmentAsync(CancellationToken)

Loading default values into a new TargetAssignment.

Declaration
public Task<TargetAssignment> CreateDefaultTargetAssignmentAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

New TargetAssignment with default values

CreateDefaultTargetAssignmentForCompanyAsync(CancellationToken)

Returns a default target assignment for the owner company.

Declaration
public Task<TargetAssignment> CreateDefaultTargetAssignmentForCompanyAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignment for the owner company.

CreateDefaultTargetAssignmentForCompanyWithDimensionAsync(int, CancellationToken)

Returns a default target assignment for the owner company, for the specified dimension.

Declaration
public Task<TargetAssignment[]> CreateDefaultTargetAssignmentForCompanyWithDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignments for the owner company.

CreateDefaultTargetAssignmentForCompanyWithYearAndDimensionAsync(int, int, CancellationToken)

Returns a default target assignment for the owner company, for the specified year and dimension.

Declaration
public Task<TargetAssignment[]> CreateDefaultTargetAssignmentForCompanyWithYearAndDimensionAsync(int year, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int year

The year from which to retrieve dimension data.

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignments for the owner company.

CreateDefaultTargetAssignmentForUserGroupAsync(int, CancellationToken)

Returns a default target assignment for the specified usergroup.

Declaration
public Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupAsync(int userGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignment for the specified usergroup.

CreateDefaultTargetAssignmentForUserGroupWithDimensionAsync(int, int, CancellationToken)

Returns a default target assignment for the specified usergroup, for the specified dimension.

Declaration
public Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupWithDimensionAsync(int userGroupId, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignment for the specified usergroup.

CreateDefaultTargetAssignmentForUserGroupWithYearAndDimensionAsync(int, int, int, CancellationToken)

Returns a default target assignment for the specified usergroup, for the specified year and dimension.

Declaration
public Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupWithYearAndDimensionAsync(int userGroupId, int year, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

int year

The year from which to retrieve dimension data.

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Default target assignment for the specified usergroup.

CreateDefaultTargetDimensionAsync(CancellationToken)

Loading default values into a new TargetDimension.

Declaration
public Task<TargetDimension> CreateDefaultTargetDimensionAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetDimension

New TargetDimension with default values

CreateDefaultTargetGroupAsync(CancellationToken)

Loading default values into a new TargetGroup.

Declaration
public Task<TargetGroup> CreateDefaultTargetGroupAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetGroup

New TargetGroup with default values

CreateDefaultTargetRevisionAsync(CancellationToken)

Loading default values into a new TargetRevision.

Declaration
public Task<TargetRevision> CreateDefaultTargetRevisionAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetRevision

New TargetRevision with default values

CreateDefaultTargetRevisionHistoryAsync(CancellationToken)

Loading default values into a new TargetRevisionHistory.

Declaration
public Task<TargetRevisionHistory> CreateDefaultTargetRevisionHistoryAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetRevisionHistory

New TargetRevisionHistory with default values

DeleteTargetDimensionAsync(int, CancellationToken)

Deletes the TargetDimension

Declaration
public Task DeleteTargetDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The identity of the TargetDimension

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

DeleteTargetGroupAsync(int, CancellationToken)

Deletes the TargetGroup

Declaration
public Task DeleteTargetGroupAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The identity of the TargetGroup

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

ExportTargetGroupToExcelAsync(int, CancellationToken)

Renders the given targetgroup to excel, and returns the path to the temporary file.

Declaration
public Task<ExportArchiveResult> ExportTargetGroupToExcelAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The id of the targetgroup to be rendered to excel.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskExportArchiveResult

GetTargetAssignmentForYearAndDimensionAsync(int, TargetEntityType, TargetLevel, int, int, CancellationToken)

Returns the target assignment for the specified year, entity type and dimension.

Declaration
public Task<TargetAssignment> GetTargetAssignmentForYearAndDimensionAsync(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id, int dimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

SuperOffice.Data.TargetEntityType entityType

Targeted entity type

SuperOffice.Data.TargetLevel targetLevel

The level of target the id is referring to.

int id

Contact, UserGroup or Associate id.

int dimensionId

Id of dimension.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Target assignment for a specified entity for year and entity type. Null if not found.

GetTargetAssignmentForYearAsync(int, TargetEntityType, TargetLevel, int, CancellationToken)

Returns the target assignment for the specified year and entity type.

Declaration
public Task<TargetAssignment> GetTargetAssignmentForYearAsync(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

SuperOffice.Data.TargetEntityType entityType

Targeted entity type

SuperOffice.Data.TargetLevel targetLevel

The level of target the id is referring to.

int id

Contact, UserGroup or Associate id.

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetAssignment

Target assignment for a specified entity for year and entity type. Null if not found.

GetTargetDimensionAsync(int, CancellationToken)

Gets a TargetDimension object.

Declaration
public Task<TargetDimension> GetTargetDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The identifier of the TargetDimension object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetDimension

A single TargetDimension

GetTargetDimensionsForEntityTypeAsync(TargetEntityType, CancellationToken)

Returns the target dimensions for the given entity type.

Declaration
public Task<TargetDimension[]> GetTargetDimensionsForEntityTypeAsync(TargetEntityType entityType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SuperOffice.Data.TargetEntityType entityType

Targeted entity type

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetDimension

Target dimensions for year and entity type.

GetTargetGroupAsync(int, CancellationToken)

Gets a TargetGroup object.

Declaration
public Task<TargetGroup> GetTargetGroupAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The identifier of the TargetGroup object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetGroup

A single TargetGroup

GetTargetGroupForYearAndDimensionAsync(int, int, CancellationToken)

Returns the target group for the specified year and dimension.

Declaration
public Task<TargetGroup> GetTargetGroupForYearAndDimensionAsync(int targetYear, int dimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

int dimensionId

Targeted dimension Id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetGroup

Target Group for year and dimension.

GetTargetGroupForYearAsync(int, TargetEntityType, CancellationToken)

Returns the target group for the specified year and entity type.

Declaration
public Task<TargetGroup> GetTargetGroupForYearAsync(int targetYear, TargetEntityType entityType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

SuperOffice.Data.TargetEntityType entityType

Targeted entity type

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetGroup

Target Group for year and entity type.

GetTargetGroupIdsAsync(int, CancellationToken)

Returns ids of the target groups that use this dimension.

Declaration
public Task<int[]> GetTargetGroupIdsAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The target dimension id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Taskint

Target group ids.

GetTargetRevisionHistoryAsync(int, CancellationToken)

Returns the revision history for a given TargetAssignmentInfo in chronological order.

Declaration
public Task<TargetRevisionHistory> GetTargetRevisionHistoryAsync(int targetAssignmentInfoId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetAssignmentInfoId

Target assignment info id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetRevisionHistory

Target revision history for the given TargetAssignmentInfo

SaveTargetDimensionAsync(TargetDimension, CancellationToken)

Updates the existing TargetDimension or creates a new TargetDimension if the id parameter is 0.

Declaration
public Task<TargetDimension> SaveTargetDimensionAsync(TargetDimension targetDimension, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TargetDimension targetDimension

The TargetDimension that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetDimension

New or updated TargetDimension

SaveTargetGroupAsync(TargetGroup, CancellationToken)

Updates the existing TargetGroup or creates a new TargetGroup if the id parameter is 0.

Declaration
public Task<TargetGroup> SaveTargetGroupAsync(TargetGroup targetGroup, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TargetGroup targetGroup

The TargetGroup that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskTargetGroup

New or updated TargetGroup

Implements

ITargetsAgent
IAgent
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top