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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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);
        }