public ActionResult Search(String searchTitle) { Models.Task task = taskRepository.SearchTask(searchTitle); if (task is null) { TempData["ErrorMsg"] = "No Result Found"; return(RedirectToAction("Index")); } else { return(RedirectToAction("details", new { id = task.Id })); } }
// GET: Task/Edit/5 public ActionResult Edit(int id) { Models.Task task = taskRepository.GetTask(id); return(View(task)); }
// GET: Task/Delete/5 public ActionResult Delete(int id) { Models.Task task = taskRepository.GetTask(id); taskRepository.DeleteTask(task); return(RedirectToAction("Index")); }
// GET: Task/Details/5 public ViewResult Details(int id) { Models.Task task = taskRepository.GetTask(id); return(View(task)); }