コード例 #1
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));
        }
コード例 #2
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);
        }