TimePunch Project Service
This service contains methods in order to work with the projects of TimePunch.
CreateProject
This method creates a new project and returns it. The project is saved directly in the database when it is created and filled with the default values.
ProjectDto CreateProject(
out TpFault fault,
TpAuthentication authentication,
string projectId,
string projectDescription,
string projectCode,
Guid? copyFromProject);
Needed Permission | projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectId | Unique identifier of the project | |
projectDescription | Short description of the project | |
projectCode | Unique identifier that can be used by a barcode reader | |
Guid? | Id of the project that shall be used as a template, or NULL. | |
Return value | Returns the created project |
DeleteProject
This method deletes the given project physically in the database. But this can only be done, if the project is not referenced by any time-entries. If the project is referenced it’s recommended to do a soft-delete. That means to set the delete flag in the project entity.
void DeleteProject(
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permission | projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectId | Id of the project that shall be deleted |
ExportProjectUserRelations
This method exports the employee-specific settings for one or more projects.
List<ProjectUserRelationDto> ExportProjectUserRelations(
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto projectSearch);
Needed Permission | projects@export | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
searchCriteria | Criteria that are used for searching the projects. | |
Return value | Collection of project related user data |
GetProjectUsers
This method returns a list of TimePunch profiles that are able to book on certain projects
List<ProjectUserDto> GetProjectUsers(
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds);
Needed Permission | projects@report | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectIds | Collection of project ids to load the project relevant times | |
Return value | List of project / user combinations that are allowed to book the relevant project ids. It also contains the scheduled work and the pool type (Shared / Private) |
GetTotalProjectTimes
This method is used to retrieve the current project times for the given projects and employees.
List<ProjectTimeDto> GetTotalProjectTimes(
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds,
Guid[] userIds);
Needed Permission | UserIds == null ? projects@access : projects@report | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectIds | Collection of project ids to load the project relevant times | |
userIds | User ids of all users for which the project data shall be loaded, or null to load the data for the current user. |
ImportProjects
This method imports a list of projects. In contrast to the Save method, it is not the project IDs that are used for identification, but the project name.
void ImportProjects(
out TpFault fault,
TpAuthentication authentication,
List<ProjectDto> projects);
Needed Permission | projects@import | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projects | Collection of projects to import |
ImportProjectTasks
This method imports a list of project-specific activities. The activities are identified by the description text and not by the task ID.
void ImportProjectTasks(
out TpFault fault,
TpAuthentication authentication,
List<ProjectTaskDto> projectTasks);
Needed Permission | projects@import | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectTasks | Collection of project dependend tasks to import |
ImportProjectUserRelations
This method imports the employee assignments to a project. In contrast to the SaveProjectUserRelations method, the employees are not assigned to the logon name via the technical ID, but via the logon name.
void ImportProjectUserRelations(
out TpFault fault,
TpAuthentication authentication,
List<ProjectUserRelationDto> userRelations);
Needed Permission | projects@import | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userRelations | Collection of project user relations tasks to import |
LoadProject
This method loads the project with the given project id.
ProjectDto LoadProject(
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectId | Id of the project to load | |
Return value | The loaded project data |
LoadProjectUserRelations
This method loads the employee-specific settings of a project for all authorized employees.
List<ProjectUserRelationDto> LoadProjectUserRelations(
out TpFault fault,
TpAuthentication authentication,
Guid projectId);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectId | Id of the project to load | |
Return value | Collection of user specific project data |
MarkProjectsAsDone
This method sets the delete-flag in the project and marks the project therefore as finished. That means it’s not allowed to book new time-entries to the project. But existing time-entries stay as they are.
void MarkProjectsAsDone(
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds);
Needed Permission | projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectIds | Collection of project ids to set the soft delete flag |
SaveProject
This method stores the project in the database.
ProjectDto SaveProject(
out TpFault fault,
TpAuthentication authentication,
ProjectDto project);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
project | Project data that shall be stored | |
Return value | The stored project data will be returned |
SaveProjectUserRelations
This method updates the employee assignment in the projects.
void SaveProjectUserRelations(
out TpFault fault,
TpAuthentication authentication,
List<ProjectUserRelationSaveDto> userRelations);
Needed Permission | projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
userRelations | List of user and project related data. |
SearchAuthorizedProjects
This method searches for projects in which the employee is authorized, using the specified search criteria. The found projects are returned. Authorized projects are all projects assigned to the employee.
List<ProjectDto> SearchAuthorizedProjects(
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
searchCriteria | Criteria that are used for searching the projects. | |
Return value | Collection of found projects |
SearchReportingProjects
This method searches for projects where the employee is authorized to run reports. The projects found are returned. All projects are returned for which the employee himself, or one of the employees assigned to the groups, is authorized.
List<ProjectDto> SearchReportingProjects(
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
searchCriteria | Criteria that are used for searching the projects. | |
Return value | Collection of found projects |
SearchProjects
This method searches all available projects with the given search criteria. The found projects will be returned.
List<ProjectDto> SearchProjects(
out TpFault fault,
TpAuthentication authentication,
ProjectSearchDto searchCriteria);
Needed Permission | projects@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
searchCriteria | Criteria that are used for searching the projects. | |
Return value | Collection of found projects |
SetProjectLifeCycle
This method sets the current lifecycle of one or more projects. The lifecycle specifies how the project can be used in TimePunch.
public enum ProjectLifeCycle
{
/// Life cycle is undefined
Undefined,
/// The project can be changed, but not booked
Planning,
/// The project can be changed and booked
Active,
/// The project can not be changed, not booked, but reported
Done,
/// The project can not be changed, not booked and is not visible for reporting
Deleted,
}
void SetProjectLifeCycle(
out TpFault fault,
TpAuthentication authentication,
Guid[] projectIds,
ProjectLifeCycle projectLifeCycle);
Needed Permission | projects@manage | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projectIds | Collection of project ids for that the life cycle shall be changed. | |
projectLifeCylce | The new life cycle to set |