public void CreateTaskStatus(Model.TaskStatus TaskStatus) { Model.TaskStatus Exists = TaskStatusRepository.Get(x => x.Status == TaskStatus.Status).FirstOrDefault(); if (Exists != null) { throw new Exception("Status already Exists!"); } TaskStatusRepository.Add(TaskStatus); SaveTaskStatus(); }
public List <TaskViewModel> CloseTask(int ID) { Model.Task Task = TaskRepository.GetByID(ID); Task.User = null; Task.AssignedUser = null; Task.TaskStatus = null; Task.TaskStatusID = TaskStatusRepository.Get(x => x.Status == "Closed").FirstOrDefault().ID; TaskRepository.Edit(Task.ID, Task); SaveTask(); List <TaskViewModel> AllTasks = GetTasks(); return(AllTasks); }