public ActionResult Delete(int id, AdminUnit unit) { try { _adminUnitService.DeleteAdminUnit(unit); return(RedirectToAction("Index")); } catch { return(View("Delete")); } }
public ActionResult AdminUnit_Destroy(AdminUnitViewModel adminUnitViewModel) { var au = _adminUnitService.FindById(adminUnitViewModel.AdminUnitID); try { _adminUnitService.DeleteAdminUnit(au); return(RedirectToAction("Index")); } catch (Exception e) { ModelState.AddModelError("Errors", @"Unable to delete FDP"); } return(Json(ModelState.ToDataSourceResult())); }