Ejemplo n.º 1
0
        public void Process(WebRequest webRequest)
        {
            int categoryId = ActionArguments.CategoryId.ExtractFrom(webRequest.QueryArguments);

            Category category = _productService.GetCategoryBy(categoryId);

            _storage.Add(ViewStorageKeys.Category, category);
        }
        public override void Handle(WebRequest request)
        {
            if (_route.Matches(request))
            {
                IEnumerable <Category> categories = _productService.GetAllCategories();
                _viewStorage.Add(ViewStorageKeys.Categories, categories);

                IEnumerable <Product> products = _productService.GetBestSellingProducts();
                _viewStorage.Add(ViewStorageKeys.Products, products);

                _pageNavigator.NavigateTo(PageDirectory.Home);
            }
            else
            {
                base._nextHandler.Handle(request);
            }
        }
        public override void Handle(WebRequest request)
        {
            if (_route.Matches(request))
            {
                int productId = ActionArguments.ProductId.ExtractFrom(request.QueryArguments);

                IEnumerable <Category> categories = _productService.GetAllCategories();
                _viewStorage.Add(ViewStorageKeys.Categories, categories);

                Product product = _productService.GetProductBy(productId);
                _viewStorage.Add(ViewStorageKeys.Product, product);

                _pageNavigator.NavigateTo(PageDirectory.ProductDetail);
            }
            else
            {
                base._nextHandler.Handle(request);
            }
        }
        public override void Handle(WebRequest request)
        {
            if (_route.Matches(request))
            {
                int categoryId = ActionArguments.CategoryId.ExtractFrom(request.QueryArguments);

                IEnumerable <Category> categories = _productService.GetAllCategories();
                _viewStorage.Add(ViewStorageKeys.Categories, categories);

                Category category = _productService.GetCategoryBy(categoryId);
                _viewStorage.Add(ViewStorageKeys.Category, category);

                IEnumerable <Product> products = _productService.GetAllProductsIn(categoryId);
                _viewStorage.Add(ViewStorageKeys.Products, products);

                _pageNavigator.NavigateTo(PageDirectory.CategoryProducts);
            }
            else
            {
                base._nextHandler.Handle(request);
            }
        }
        public void Process(WebRequest webRequest)
        {
            int categoryId = ActionArguments.CategoryId.ExtractFrom(webRequest.QueryArguments);

            _storage.Add(ViewStorageKeys.Products, _productService.GetAllProductsIn(categoryId));
        }
 public void Process(WebRequest webRequest)
 {
     _storage.Add(ViewStorageKeys.Categories, _productService.GetAllCategories());
 }
Ejemplo n.º 7
0
        public void Process(WebRequest webRequest)
        {
            int productId = ActionArguments.ProductId.ExtractFrom(webRequest.QueryArguments);

            _storage.Add(ViewStorageKeys.Product, _productService.GetProductBy(productId));
        }
Ejemplo n.º 8
0
 public void Process(WebRequest webRequest)
 {
     _storage.Add(ViewStorageKeys.Products, _productService.GetBestSellingProducts());
 }