public ActionResult Delete(int id, FormCollection collection) { if (id > 0 && ModelState.IsValid) { Rdao.DeleteRoute(id); return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Delete(int id, FormCollection collection) { try { if (routeDAO.DeleteRoute(id)) { return(RedirectToAction("Index")); } else { return(View("Delete")); } } catch { return(View()); } }
public ActionResult DeleteRoute(int id, Route route) { try { if (routeDAO.DeleteRoute(id)) { return(RedirectToAction("GetAllRoutes")); } else { return(View("DeleteRoute")); } } catch { return(View("DeleteRoute")); } }
// ROUTE DELETE's PROCESS public ActionResult RouteDelete(int id) => IsLoggedIn() && RouteDAO.DeleteRoute(id) ? Content("OK") : Content("Error");