Esempio n. 1
0
 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 }));
     }
 }
Esempio n. 2
0
 // GET: Task/Edit/5
 public ActionResult Edit(int id)
 {
     Models.Task task = taskRepository.GetTask(id);
     return(View(task));
 }
Esempio n. 3
0
 // GET: Task/Delete/5
 public ActionResult Delete(int id)
 {
     Models.Task task = taskRepository.GetTask(id);
     taskRepository.DeleteTask(task);
     return(RedirectToAction("Index"));
 }
Esempio n. 4
0
 // GET: Task/Details/5
 public ViewResult Details(int id)
 {
     Models.Task task = taskRepository.GetTask(id);
     return(View(task));
 }