コード例 #1
0
        public HttpResponseMessage GetSizes(HttpRequestMessage request)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                var model = _productQuantityService.GetListSize();

                List <SizeViewModel> modelVm = Mapper.Map <List <Size>, List <SizeViewModel> >(model);

                response = request.CreateResponse(HttpStatusCode.OK, modelVm);

                return response;
            }));
        }
コード例 #2
0
        public HttpResponseMessage GetSizes(HttpRequestMessage request, string filter)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                var model = _productQuantityService.GetListSize(filter);

                var modelVm = Mapper.Map <IEnumerable <Size>, IEnumerable <SizeViewModel> >(model);

                response = request.CreateResponse(HttpStatusCode.OK, modelVm);

                return response;
            }));
        }
コード例 #3
0
        public ActionResult _MenuLeft()
        {
            var shopVm     = new ShopViewModel();
            var color      = _productQuantityService.GetListColor(null);
            var size       = _productQuantityService.GetListSize(null);
            var category   = _productCategoryService.GetAll();
            var colorVm    = Mapper.Map <IEnumerable <Color>, IEnumerable <ColorViewModel> >(color);
            var sizeVm     = Mapper.Map <IEnumerable <Size>, IEnumerable <SizeViewModel> >(size);
            var categoryVm = Mapper.Map <IEnumerable <ProductCategory>, IEnumerable <ProductCategoryViewModel> >(category);

            shopVm.Colors          = colorVm;
            shopVm.Sizes           = sizeVm;
            shopVm.ProductCategory = categoryVm;
            return(PartialView(shopVm));
        }
コード例 #4
0
 public IActionResult GetSize()
 {
     return(new OkObjectResult(_productQuantityService.GetListSize()));
 }