public void Create(TaskModel task) { using (_repository = _getRepository()) { _repository.Insert(task); _repository.Save(); } }
public void Update(TaskModel task) { using (_repository = _getRepository()) { TaskModel toUpdate = _repository.Get(item => item.Id == task.Id).First(); toUpdate.Name = task.Name; toUpdate.Description = task.Description; toUpdate.TimeEstimate = task.TimeEstimate; toUpdate.StartDate = task.StartDate; toUpdate.FinishDate = task.FinishDate; toUpdate.Filepath = task.Filepath; toUpdate.Version = task.Version; toUpdate.ProjectId = task.ProjectId; toUpdate.AssignedPersonId = task.AssignedPersonId; toUpdate.AssigningPersonId = task.AssigningPersonId; toUpdate.CategoryId = task.CategoryId; toUpdate.StatusId = task.StatusId; toUpdate.PriorityId = task.PriorityId; toUpdate.TypeId = task.TypeId; _repository.Update(toUpdate); _repository.Save(); } }
public bool CreateTask(TaskModel task) { _tasksService.Create(task); //TODO: return result return true; }