public Task EditTask(TaskAbs editedTask) { var task = this.FindTaskById(editedTask.Id); task.Content = editedTask.Content; task.LevelOfImportance = editedTask.LevelOfImportance; task.Type = editedTask.Type; this.Context.SaveChanges(); return(task); }
public IActionResult EditTask(TaskAbs task, int taskId) { task.Id = taskId; this.taskService.EditTask(task); if (task.Type == Constants.IndividualTaskType) { return(RedirectToAction("IndividualTasks", "Task", new { area = "Teamleader" })); } return(RedirectToAction("GroupTasks", "Task", new { area = "Teamleader" })); }
public IActionResult Edit(int taskId) { var task = this.taskService.FindTaskById(taskId); var taskView = new TaskAbs() { Id = taskId, Content = task.Content, LevelOfImportance = task.LevelOfImportance, Type = task.Type }; return(View(taskView)); }
public Task CreateTask(TaskAbs task) { var newTask = new Task() { Content = task.Content, LevelOfImportance = task.LevelOfImportance, Type = task.Type, isCompleted = false }; this.Context.Tasks.Add(newTask); this.Context.SaveChanges(); return(newTask); }
public IActionResult Create(TaskAbs task) { this.taskService.CreateTask(task); return(RedirectToAction("CreateTask", "Task", new { area = "Teamleader" })); }