Пример #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     // Exception handling
     try
     {
         string delete = _mechanicManager.DeleteMechanic(id);
         Log.Info("Mechanic deleted Successffuly");
         return(RedirectToAction("Index"));
     }
     // Catch the exception
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
         ModelState.AddModelError("", "Error in product deleting");
     }
     return(RedirectToAction("Index"));
 }
Пример #2
0
 public ActionResult DeleteMechanic(int id)
 {
     _MechanicManager.DeleteMechanic(id);
     return(RedirectToAction("ListMechanic"));
 }
        public IHttpActionResult Delete(int MechanicId)
        {
            var response = _IMechanicManager.DeleteMechanic(MechanicId);

            return(Ok(response));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            string delete = _mechanicManager.DeleteMechanic(id);

            return(RedirectToAction("Index"));
        }