Пример #1
0
 public IActionResult CreateNewTask(Task newTask)
 {
     newTask.OpeningDate = DateTimeOffset.Now;
     db.Tasks.Add(newTask);
     db.SaveChanges();
     return(Json(newTask));
 }
Пример #2
0
        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));
        }