Interface IProjectAgent
Interface for the Project Agent Collection of all services that works with Project data.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Project Agent", "Interface for the Project Agent. Collection of all services that works with Project data.")]
public interface IProjectAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ProjectAgent agent = new ProjectAgent())
{
// call methods on agent here...
}
}
Methods
AddProjectMembersAsync(int, ProjectMember[], CancellationToken)
Add multiple project members to a project
Declaration
Task AddProjectMembersAsync(int projectEntityId, ProjectMember[] projectMembers, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEntityId | Project to add members to |
ProjectMember[] | projectMembers | Project members to add |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
CreateDefaultProjectEntityAsync(CancellationToken)
Loading default values into a new ProjectEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<ProjectEntity> CreateDefaultProjectEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEntity> | New ProjectEntity with default values |
CreateDefaultProjectEventEntityAsync(CancellationToken)
Loading default values into a new ProjectEventEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<ProjectEventEntity> CreateDefaultProjectEventEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEventEntity> | New ProjectEventEntity with default values |
CreateDefaultProjectMemberAsync(CancellationToken)
Loading default values into a new ProjectMember. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<ProjectMember> CreateDefaultProjectMemberAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember> | New ProjectMember with default values |
CreateNewEntryAsync(DuplicateEntry, CancellationToken)
Creates a new project based on external duplicate
Declaration
Task<int> CreateNewEntryAsync(DuplicateEntry duplicate, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DuplicateEntry | duplicate | The duplicate to create a new entry based upon |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | The database identity of the newly created entry |
DeleteProjectEntityAsync(int, CancellationToken)
Deletes the ProjectEntity
Declaration
Task DeleteProjectEntityAsync(int projectEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEntityId | The identity of the ProjectEntity |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteProjectEventEntityAsync(int, CancellationToken)
Deletes the ProjectEventEntity
Declaration
Task DeleteProjectEventEntityAsync(int projectEventEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEventEntityId | The identity of the ProjectEventEntity |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteProjectEventEntityFromProjectIdAsync(int, CancellationToken)
Delete a project event based on a project id. Does not delete the project, but does delete the published and ExternalEvent and AudienceVisibility records.
Declaration
Task DeleteProjectEventEntityFromProjectIdAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the external event to delete. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | Nothing |
DeleteProjectMemberAsync(int, CancellationToken)
Deletes the ProjectMember
Declaration
Task DeleteProjectMemberAsync(int projectMemberId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectMemberId | The identity of the ProjectMember |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteProjectMemberByIdsAsync(int[], CancellationToken)
Deletes projectmembers rows.
Declaration
Task DeleteProjectMemberByIdsAsync(int[] projectMemberIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectMemberIds | An Array of projectmember ids. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteProjectMembersAsync(int, int[], CancellationToken)
Delete the given project members from a project
Declaration
Task DeleteProjectMembersAsync(int projectEntityId, int[] memberIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEntityId | Project to remove members from |
int[] | memberIds | Project member ids |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
GetDuplicateRulesAsync(CancellationToken)
Retrieve all available duplicate rules for project
Declaration
Task<DuplicateRule[]> GetDuplicateRulesAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DuplicateRule[]> | All available duplicate rules |
GetDuplicatesAsync(string, CancellationToken)
Get duplicates(exact or similar in the database) based on the name
Declaration
Task<DuplicateEntry[]> GetDuplicatesAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name used for lookup |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DuplicateEntry[]> | Any records matching the specified name |
GetMyMemberProjectsAsync(CancellationToken)
Returning the projects where an user is project member.
Declaration
Task<Project[]> GetMyMemberProjectsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | The list of projects. |
GetMyProjectEventsAsync(CancellationToken)
Gets all project events that belongs to the currently logged on user. The list of events are filtered by the Audience Visibility restrictions set when the project event is created.
Declaration
Task<ProjectEvent[]> GetMyProjectEventsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEvent[]> | Array of project events |
GetMyProjectsAsync(bool, CancellationToken)
Returning the projects belonging to an associate. If memberProjects is false only the projects where the associate is project responsible is returned, otherwise both the projects where the associate is project responsible and project member is returned.
Declaration
Task<Project[]> GetMyProjectsAsync(bool includeMemberProjects, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
bool | includeMemberProjects | True to include projects where the user is project member. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | The list of projects |
GetMyPublishedProjectsAsync(CancellationToken)
Get published projects from the logged in user.
Declaration
Task<Project[]> GetMyPublishedProjectsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | Projects |
GetNextMilestoneAsync(int, CancellationToken)
Next upcoming milestone appointment
Declaration
Task<Appointment> GetNextMilestoneAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | Project id - primary key |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Appointment> | Upcoming milestone appointment |
GetNextProjectStatusAsync(int, CancellationToken)
Interface for the Project Agent Collection of all services that works with Project data.
Declaration
Task<int> GetNextProjectStatusAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> |
GetProjectAsync(int, CancellationToken)
Gets a Project object.
Declaration
Task<Project> GetProjectAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The identifier of the Project object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project> | Project |
GetProjectEntityAsync(int, CancellationToken)
Gets a ProjectEntity object.
Declaration
Task<ProjectEntity> GetProjectEntityAsync(int projectEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEntityId | The identifier of the ProjectEntity object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEntity> | ProjectEntity |
GetProjectEventAsync(int, CancellationToken)
Gets a ProjectEvent object.
Declaration
Task<ProjectEvent> GetProjectEventAsync(int projectEventId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEventId | The identifier of the ProjectEvent object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEvent> | ProjectEvent |
GetProjectEventEntityAsync(int, CancellationToken)
Gets a ProjectEventEntity object.
Declaration
Task<ProjectEventEntity> GetProjectEventEntityAsync(int projectEventEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectEventEntityId | The identifier of the ProjectEventEntity object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEventEntity> | ProjectEventEntity |
GetProjectEventEntityFromProjectIdAsync(int, CancellationToken)
Get a ProjectEventEntity based on a projectId.
Declaration
Task<ProjectEventEntity> GetProjectEventEntityFromProjectIdAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The projectId to get a ProjectEventEntity for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEventEntity> | ProjectEventEntity |
GetProjectEventListAsync(int[], CancellationToken)
Gets an array of ProjectEvent objects.
Declaration
Task<ProjectEvent[]> GetProjectEventListAsync(int[] projectEventIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectEventIds | The identifiers of the ProjectEvent object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEvent[]> | Array of ProjectEvent objects |
GetProjectEventOnPersonAsync(int, int, CancellationToken)
Gets a ProjectEvent object from a project and a person.
Declaration
Task<ProjectEvent> GetProjectEventOnPersonAsync(int projectId, int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project Id |
int | personId | Id of the person the project events belong to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEvent> |
GetProjectEventsOnPersonAsync(int, CancellationToken)
Gets all project events that belongs to the person specified. The list of events are filtered by the Audience Visibility restrictions set when the project event is created.
Declaration
Task<ProjectEvent[]> GetProjectEventsOnPersonAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | Id of the person the project events belong to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEvent[]> | Array of project events |
GetProjectImageAsync(int, CancellationToken)
Returns the project image that is displayed in the CRM application.
Declaration
Task<Image> GetProjectImageAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the project the image belongs to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetProjectListAsync(int[], CancellationToken)
Gets an array of Project objects.
Declaration
Task<Project[]> GetProjectListAsync(int[] projectIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectIds | The identifiers of the Project object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | Array of Project objects |
GetProjectMemberAsync(int, CancellationToken)
Gets a ProjectMember object.
Declaration
Task<ProjectMember> GetProjectMemberAsync(int projectMemberId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectMemberId | The identifier of the ProjectMember object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember> | ProjectMember |
GetProjectMembersAsync(int, CancellationToken)
Returns an array of project members
Declaration
Task<ProjectMember[]> GetProjectMembersAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember[]> | An array of project members |
GetProjectMembersByIdAsync(int[], CancellationToken)
Returns an array of project members
Declaration
Task<ProjectMember[]> GetProjectMembersByIdAsync(int[] projectMemberIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectMemberIds | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember[]> | An array of project members |
GetProjectsFromContactAsync(int, CancellationToken)
Returns all projects where the given contact has projectmembers.
Declaration
Task<Project[]> GetProjectsFromContactAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The contact id |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | ProjectListEntity |
GetProjectsFromPersonAsync(int, CancellationToken)
Return all projects where the person is project member.
Declaration
Task<Project[]> GetProjectsFromPersonAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | ProjectListEntity |
GetPublishedProjectAsync(int, CancellationToken)
Get published project by project id.
Declaration
Task<Project> GetPublishedProjectAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project> | Project |
GetPublishedProjectsAsync(int[], CancellationToken)
Get published projects by project ids.
Declaration
Task<Project[]> GetPublishedProjectsAsync(int[] projectIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectIds | The array of project ids |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | Projects |
GetPublishedProjectsOnPersonIdAsync(int, CancellationToken)
Get published projects where person is a member
Declaration
Task<Project[]> GetPublishedProjectsOnPersonIdAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Project[]> | Array of project |
HasGuideActivitiesAsync(int, CancellationToken)
Interface for the Project Agent Collection of all services that works with Project data.
Declaration
Task<bool> HasGuideActivitiesAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> |
HasGuideAsync(int, CancellationToken)
Does this project have a guide associated with its project type?
Declaration
Task<bool> HasGuideAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | Project id |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | True if the project has a guide |
IsNumberValidAsync(int, string, CancellationToken)
Checks if the number is unique or required. The setting is configured from admin under system options.
Declaration
Task<bool> IsNumberValidAsync(int contactId, string number, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The Project id |
string | number | The number to check for uniqueness and validity |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | True if the number is valid |
MergeAsync(int, int, bool, CancellationToken)
Merge two projects into one, removing the source project in the process
Declaration
Task MergeAsync(int sourceProjectId, int destinationProjectId, bool replaceEmptyFieldsOnDestination, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | sourceProjectId | Id of source project for merge. This project is removed after the merge is completed. |
int | destinationProjectId | Id of destination project to merge to. This project is updated with info from the source. |
bool | replaceEmptyFieldsOnDestination | Fill in empty fields on destination from source? |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
OfferAutoNextStatusOnApppointmentCompletedAsync(int, CancellationToken)
Interface for the Project Agent Collection of all services that works with Project data.
Declaration
Task<bool> OfferAutoNextStatusOnApppointmentCompletedAsync(int appointmentId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | appointmentId | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> |
SaveProjectEntityAsync(ProjectEntity, CancellationToken)
Updates the existing ProjectEntity or creates a new ProjectEntity if the id parameter is empty
Declaration
Task<ProjectEntity> SaveProjectEntityAsync(ProjectEntity projectEntity, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProjectEntity | projectEntity | The ProjectEntity that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEntity> | New or updated ProjectEntity |
SaveProjectEventEntityAsync(ProjectEventEntity, CancellationToken)
Updates the existing ProjectEventEntity or creates a new ProjectEventEntity if the id parameter is empty
Declaration
Task<ProjectEventEntity> SaveProjectEventEntityAsync(ProjectEventEntity projectEventEntity, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProjectEventEntity | projectEventEntity | The ProjectEventEntity that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectEventEntity> | New or updated ProjectEventEntity |
SaveProjectMemberAsync(ProjectMember, CancellationToken)
Updates the existing ProjectMember or creates a new ProjectMember if the id parameter is empty
Declaration
Task<ProjectMember> SaveProjectMemberAsync(ProjectMember projectMember, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProjectMember | projectMember | The ProjectMember that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember> | New or updated ProjectMember |
SaveProjectMembersFunctionAndCommentAsync(int[], int, string, CancellationToken)
Saves role and comment on an array of projectmembers represented by ids
Declaration
Task SaveProjectMembersFunctionAndCommentAsync(int[] projectMemberIds, int roleId, string comment, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | projectMemberIds | |
int | roleId | |
string | comment | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SetDuplicateRulesStatusAsync(DuplicateRule[], CancellationToken)
Set which duplicate rules should be active or not
Declaration
Task SetDuplicateRulesStatusAsync(DuplicateRule[] rules, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DuplicateRule[] | rules | Duplicate rules to update active status for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SetProjectImageAsync(int, Image, CancellationToken)
Stores the project image that is displayed in the CRM application.
Declaration
Task SetProjectImageAsync(int projectId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the project the image belongs to. |
Image | image | The image that is stored on the project (System.Drawing.Image) |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
UpdateProjectMemberAsync(ProjectMember, CancellationToken)
Updates a ProjectMember row.
Declaration
Task<ProjectMember> UpdateProjectMemberAsync(ProjectMember projectMember, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProjectMember | projectMember | ProjectMember to update |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ProjectMember> | The Updated ProjectMember |
UpdateProjectMembersAsync(int, ProjectMember[], CancellationToken)
Update existing project members. Not creating new (only projectmember_id > 0 accepted)
Declaration
Task UpdateProjectMembersAsync(int projectId, ProjectMember[] projectMembers, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | Project of which members will be updated |
ProjectMember[] | projectMembers | Project members to update |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | This method has no return value |
ValidateProjectEntityAsync(ProjectEntity, CancellationToken)
Check that entity is ready for saving, return error messages by field.
Declaration
Task<StringDictionary> ValidateProjectEntityAsync(ProjectEntity projectEntity, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ProjectEntity | projectEntity | Entity to be checked for errors. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<StringDictionary> | Error messages tagged by field. |