TimePunch Async Sync Service
This service offers methods for the asynchronous import of time entries or projects. The asynchronous import has the advantage that the client can be informed about the current state of the import via the offered call back service. This can be very useful with big and long running imports.
ApplyStaticData
This method imports the given projects and merges it with the already existing.
void ApplyStaticData(
TpAuthentication authentication,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permission | projects@download | |
---|---|---|
Name | Modifier | Description |
authentication | User authentication | |
projects | Collection of projects that shall be imported. | |
commonTasks | Collection of common tasks that shall be imported. | |
customers | Collection of customers that shall be imported. |
ApplyTimeEntries
This method imports the given time-entries, projects as well as tasks and merges it with the already existing.
void ApplyTimeEntries(
TpAuthentication authentication,
IEnumerable<TimeEntrySaveDto> timeEntries,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permission | projects@download | |
---|---|---|
Name | Modifier | Description |
authentication | User authentication | |
timeEntries | Collection of time entries to impoert | |
projects | Collection of projects that are referenced by the time entries. | |
commonTasks | Collection of common tasks that are referenced by the time entries. | |
customers | Collection of customers that that are referenced by the time entries. |
ITpSyncCallbackService
In order to use the call back service, the ITpSyncCallbackService Interface of the client needs to be implemented.
Code Snippet
[ServiceContract]
public interface ITpSyncCallbackService
{
/// <summary>
/// Informs the Client that the current sync failed with an exception
/// </summary>
/// <param name="fault">The fault.</param>
[OperationContract (IsOneWay=true)]
void SyncFailed(TpFault fault);
/// <summary>
/// Informs the Client that the current sync succeeded properly
/// </summary>
[OperationContract(IsOneWay = true)]
void SyncSucceeded();
/// <summary>
/// Informs the Client about the progress of the sync process
/// </summary>
[OperationContract(IsOneWay = true)]
void SyncProgress(int percent);
}