示例#1
0
 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;
 }
示例#2
0
 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);
     }
 }
示例#3
0
 public void DeleteTask(CrudTaskItem taskItem, bool syncWithServer)
 {
     
     var task = syncWithServer ? taskRepository.GetBy(taskItem.SyncId) : taskRepository.GetBy(taskItem.Id);
     task.Delete(syncWithServer);
     taskRepository.Update(task);
     
 }
示例#4
0
 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;
 }
示例#5
0
        //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;
        }
示例#6
0
 public void DeleteTask(Action<Exception> action, CrudTaskItem taskItem)
 {
     try
     {
         DeleteTask(taskItem, false);
         action(null);
     }
     catch (Exception e)
     {
         action(e);
     }
 }
示例#7
0
 private void init()
 {
     DisplayName = "یادداشت ها و قرار ملاقات ها";
     TaskItem = new CrudTaskItem();
     TaskItemTypeList = new ObservableCollection<TaskTypeDTO>();
     TaskCategoryList = new ObservableCollection<CrudTaskCategory>();
 }