Esempio n. 1
0
        public ActionResult Products(string active, string inactive, int categoryID, int?pagesize, int?orderby, string viewmode)
        {
            // TODO: needed later for ajax based filtering... see example below
            //System.Threading.Thread.Sleep(3000);

            var context = new FilterProductContext()
            {
                ParentCategoryID = categoryID,
                CategoryIds      = new List <int> {
                    categoryID
                },
                Criteria = _filterService.Deserialize(active),
                OrderBy  = orderby,
            };

            context.Criteria.AddRange(_filterService.Deserialize(inactive));

            //var query = _filterService.ProductFilter(context);
            //var products = new PagedList<Product>(query, 0, pagesize ?? 4);

            //ProductListModel model = new ProductListModel {
            //	PagingFilteringContext = new CatalogPagingFilteringModel()
            //};

            //model.Products = PrepareProductOverviewModels(products).ToList();
            //model.PagingFilteringContext.LoadPagedList(products);

            //string htmlProducts = this.RenderPartialViewToString("~/Views/Catalog/_ProductBoxContainer.cshtml", model);

            //return Json(new {
            //	products = htmlProducts
            //});

            return(null);
        }
Esempio n. 2
0
        public ActionResult Products(string filter, int categoryID, string path, int?pagesize, int?orderby, string viewmode)
        {
            var context = new FilterProductContext()
            {
                Filter           = filter,
                ParentCategoryID = categoryID,
                CategoryIds      = new List <int> {
                    categoryID
                },
                Path     = path,
                PageSize = pagesize ?? 12,
                ViewMode = viewmode,
                OrderBy  = orderby,
                Criteria = _filterService.Deserialize(filter)
            };

            _filterService.ProductFilterable(context);

            return(PartialView(new ProductFilterModel {
                Context = context
            }));
        }