public IActionResult CreateNewTask(Task newTask) { newTask.OpeningDate = DateTimeOffset.Now; db.Tasks.Add(newTask); db.SaveChanges(); return(Json(newTask)); }
public IActionResult CompleteTask(Task task) { var findedTask = db.Tasks.Find(task.Id); if (findedTask != null) { findedTask.TaskStatus = TaskStatus.Complete; findedTask.ClosingDate = DateTimeOffset.Now; db.SaveChanges(); } return(Json(task)); }