public ActionResult AddTask(TaskModel model) { _tasksRepo.Add(new Task { Name = model.Name, Description = model.Description, StartDate = model.StartDate, Duration = model.Duration, Status = model.Status }); return RedirectToAction("ShowTable"); }
public ActionResult EditStatus(TaskModel model) { try { var task = _tasksRepo.FindBy(t => t.Id == model.Id); task.Status = model.Status; _tasksRepo.Update(task); return Json(new {success = true, results = "ok"}); } catch (Exception e) { return Json(new {success = false, results = e.Message}); } }