public CrudTaskItem Update(CrudTaskItem taskItem) { var taskCommand = RMSMapper.Map<CrudTaskItem, UpdateTaskCommand>(taskItem); taskCommand.AppType = AppType.WebApp; var task = taskService.UpdateTask(taskCommand); var res = RMSMapper.Map<Task, CrudTaskItem>(task); return res; }
public void CreateTask(Action<CrudTaskItem, Exception> action, CrudTaskItem taskItem) { try { var res = CreateTask(taskItem,false); action(res, null); } catch (Exception e) { action(default(CrudTaskItem), e); } }
public void DeleteTask(CrudTaskItem taskItem, bool syncWithServer) { var task = syncWithServer ? taskRepository.GetBy(taskItem.SyncId) : taskRepository.GetBy(taskItem.Id); task.Delete(syncWithServer); taskRepository.Update(task); }
public CrudTaskItem UpdateTask(CrudTaskItem taskItem, bool syncWithServer) { var category = taskRepository.GetCategoryBy(taskItem.CategoryId); var task = syncWithServer ? taskRepository.GetBy(taskItem.SyncId) : taskRepository.GetBy(taskItem.Id); task.Update(taskItem.Title, taskItem.StartDate, taskItem.StartTime, taskItem.EndTime, taskItem.WorkProgressPercent, category,syncWithServer); taskRepository.Update(task); var res = RMSMapper.Map<Task, CrudTaskItem>(task); return res; }
//Sync section public CrudTaskItem CreateTask(CrudTaskItem taskItem, bool syncWithServer) { var category = taskRepository.GetCategoryBy(taskItem.CategoryId); var task = new Task(taskItem.Title, taskItem.WorkProgressPercent, taskItem.StartDate, taskItem.StartTime, taskItem.EndTime, category, (EntityActionType)taskItem.ActionType, taskItem.SyncId, syncWithServer); taskRepository.CreatTask(task); var res = RMSMapper.Map<Task, CrudTaskItem>(task); return res; }
public void DeleteTask(Action<Exception> action, CrudTaskItem taskItem) { try { DeleteTask(taskItem, false); action(null); } catch (Exception e) { action(e); } }
private void init() { DisplayName = "یادداشت ها و قرار ملاقات ها"; TaskItem = new CrudTaskItem(); TaskItemTypeList = new ObservableCollection<TaskTypeDTO>(); TaskCategoryList = new ObservableCollection<CrudTaskCategory>(); }