public ActionResult Filter([SessionModelBinder(FilterKey)] FilterOptions options)
        {
            var filter = new ProductFilter(_dc);

            filter.Init(options);

            return(View("AjaxFilterCollection", filter));
        }
示例#2
0
        public ActionResult Grid([SessionModelBinder(FilterKey)] FilterOptions options)
        {
            var filter = new ProductFilter(_dc);

            var query = _dc.Products.OrderBy(x => x.ID).AsQueryable();

            query = filter.Init(options).ApplyFilters(query);

            return(View("Products", query));
        }
        public ActionResult Filter([SessionModelBinder(ProductGridKey)] ActionGridOptions options)
        {
            var filter = new ProductFilter(_dc)
            {
                UpdateTargetId = ProductGridKey
            };

            filter.Init(options);

            return(View("FilterCollection", filter));
        }
        public ActionResult Grid([SessionModelBinder(ProductGridKey)] ActionGridOptions options)
        {
            var filter = new ProductFilter(_dc);

            var query = _dc.Products.Where(ProductSpecification.Search(options.SearchString).Predicate).OrderBy(x => x.ID).AsQueryable();

            query = filter.Init(options).ApplyFilters(query);

            var model = new ProductGridModel(ProductGridKey);

            return(View(new ActionGridView <Product>(model, query).Init(options)));
        }