예제 #1
0
        public ActionResult Index()
        {
            HomePageView homePageView = new HomePageView();

            homePageView.Categories    = base.GetCategories();
            homePageView.BasketSummary = base.GetBasketSummaryView();

            GetFeaturedProductsResponse response = _productCatalogueService.GetFeaturedProducts();

            homePageView.Products = response.Products;

            return(View(homePageView));
        }
예제 #2
0
        public ActionResult Index(int Id = 0)
        {
            HomePageView homePageView = new HomePageView();

            homePageView.Categories = base.GetAllCategoriesHavingAccess(Id);
            GetFeaturedProductResponse response = new GetFeaturedProductResponse();

            response = _productCatalogService.GetFeaturedProducts(new GetFeaturedProductRequest {
                RetailerId = Id
            });
            homePageView.Products = response.Products;
            return(View("Index", homePageView));
        }
예제 #3
0
        public GetFeaturedProductsResponse GetFeaturedProducts()
        {
            lock (_getTopSellingProductsLock)
            {
                var response     = new GetFeaturedProductsResponse();
                var productViews = _cachStorage.Retrieve <IEnumerable <FeaturedProductDto> >(CacheKeys.TopSellingProducts.ToString());

                if (productViews == null)
                {
                    response = _realProductCatalogueService.GetFeaturedProducts();
                    _cachStorage.Store(CacheKeys.TopSellingProducts.ToString(), response.Products);
                }
                else
                {
                    response.Products = productViews;
                }

                return(response);
            }
        }