示例#1
0
        public ActionResult HomepageProducts(int? productThumbPictureSize)
        {
            var model = new HomePageProductsModel()
            {
                UseSmallProductBox = _catalogSettings.UseSmallProductBoxOnHomePage
            };
            model.Products = _productService.GetAllProductsDisplayedOnHomePage()
                .Select(x => PrepareProductOverviewModel(x, !_catalogSettings.UseSmallProductBoxOnHomePage, true, productThumbPictureSize))
                .ToList();

            return PartialView(model);
        }
        public ActionResult HomepageProducts(int? productThumbPictureSize)
        {
            var products = _productService.GetAllProductsDisplayedOnHomePage();
            //ACL
            products = products.Where(p => _aclService.Authorize(p)).ToList();

            var model = new HomePageProductsModel()
            {
                UseSmallProductBox = _catalogSettings.UseSmallProductBoxOnHomePage,
                Products = PrepareProductOverviewModels(products,
                    !_catalogSettings.UseSmallProductBoxOnHomePage, true, productThumbPictureSize)
                    .ToList()
            };

            return PartialView(model);
        }