public JsonResult GetRestriction(System.Int32 id) { DataTableViewModel data1; GetRestrictionRequest request = new GetRestrictionRequest(); request.RestrictionId = id; DetailRestriction_RestrictionDetailView data = _restrictionService.GetRestriction(request).Restriction.ConvertToDetailRestriction_RestrictionDetailView(); return(Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult GetDetail(System.Int32 id) { RestrictionDetailView vm = new RestrictionDetailView(); GetRestrictionRequest request = new GetRestrictionRequest(); request.RestrictionId = id; GetRestrictionResponse response = _restrictionService.GetRestriction(request); if (response.RestrictionFound) { vm = response.Restriction.ConvertToRestrictionDetailView(); } return(Json(vm, JsonRequestBehavior.AllowGet)); }
public JsonResult Update(RestrictionDetailView vm) { GetRestrictionRequest request = new GetRestrictionRequest(); request.RestrictionId = vm.RestrictionId; ModifyRestrictionRequest updateRequest = _restrictionService.GetRestriction(request).Restriction.ConvertToModifyRestrictionRequest(); updateRequest.RestrictionId = vm.RestrictionId; updateRequest.RestrictionName = vm.RestrictionName; updateRequest.RequirePermission = vm.RequirePermission; updateRequest.RestrictionDescription = vm.RestrictionDescription; ModifyRestrictionResponse response = _restrictionService.ModifyRestriction(updateRequest); return(Json(response)); }
public GetRestrictionResponse GetRestriction(GetRestrictionRequest request) { GetRestrictionResponse response = new GetRestrictionResponse(); Restriction restriction = _restrictionRepository .FindBy(request.RestrictionId); if (restriction != null) { response.RestrictionFound = true; response.Restriction = restriction.ConvertToRestrictionView(); } else { response.RestrictionFound = false; } return(response); }