예제 #1
0
 public ActionResult Delete(int id, AdminUnit unit)
 {
     try
     {
         _adminUnitService.DeleteAdminUnit(unit);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("Delete"));
     }
 }
예제 #2
0
        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()));
        }