public JsonResult Delete(System.Int32 id) { RemoveRestrictionRequest request = new RemoveRestrictionRequest(); request.RestrictionId = id; RemoveRestrictionResponse response = _restrictionService.RemoveRestriction(request); return(Json(response)); }
public RemoveRestrictionResponse RemoveRestriction(RemoveRestrictionRequest request) { RemoveRestrictionResponse response = new RemoveRestrictionResponse(); response.Errors = new List <BusinessRule>(); try { if (_restrictionRepository.Remove(request.RestrictionId) > 0) { response.RestrictionDeleted = true; } } catch (Exception ex) { response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message)); } return(response); }