コード例 #1
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            if (id > 0 && ModelState.IsValid)
            {
                Cdao.DeleteConductor(id);
                return(RedirectToAction("Index"));
            }

            else
            {
                return(View());
            }
        }
コード例 #2
0
 public ActionResult DeleteConductor(int id, FormCollection collection)
 {
     try
     {
         if (conductorDAO.DeleteConductor(id))
         {
             return(RedirectToAction("IndexH"));
         }
         else
         {
             return(View("ErrorConductor"));
         }
     }
     catch
     {
         return(View("ErrorConductor"));
     }
 }