public ActionResult Delete(int id, FormCollection collection)
        {
            if (id > 0 && ModelState.IsValid)
            {
                Rdao.DeleteRoute(id);
                return(RedirectToAction("Index"));
            }

            else
            {
                return(View());
            }
        }
Beispiel #2
0
 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"));
     }
 }
Beispiel #4
0
 // ROUTE DELETE's PROCESS
 public ActionResult RouteDelete(int id) => IsLoggedIn() && RouteDAO.DeleteRoute(id) ? Content("OK") : Content("Error");