public void Reset() { if (WorkItem == null) { return; } if (WorkItem.Status == WorkItemStatusEnum.Deleted) { return; } WorkItemUpdateResponse response = null; Platform.GetService <IWorkItemService>(s => response = s.Update(new WorkItemUpdateRequest { Status = WorkItemStatusEnum.Pending, ProcessTime = Platform.Time, Identifier = WorkItem.Identifier })); // TODO (CR Jun 2012): The passed-in WorkItem contract should not be updated; // it should be done by the service and a new instance returned, or something should be returned by this // method to let the caller decide what to do. if (response.Item == null) { WorkItem.Status = WorkItemStatusEnum.Deleted; } else { WorkItem = response.Item; } }
public void Delete() { if (WorkItem == null) { return; } if (WorkItem.Status == WorkItemStatusEnum.Deleted) { return; } WorkItemUpdateResponse response = null; Platform.GetService <IWorkItemService>(s => response = s.Update(new WorkItemUpdateRequest { Delete = true, // TODO (Marmot) - This delete flag could be removed, and we could just use the status Identifier = WorkItem.Identifier })); // TODO (CR Jun 2012): The passed-in WorkItem contract should not be updated; // it should be done by the service and a new instance returned, or something should be returned by this // method to let the caller decide what to do. if (response.Item == null) { WorkItem.Status = WorkItemStatusEnum.Deleted; } else { WorkItem = response.Item; } }