public ActionResult Search(StoreSearchViewModel ssvm, Int32 pageNumber = 1)
        {
            IEnumerable <Product> results;

            if (ssvm.Location != 0)
            {
                var catFilter = new Func <Product, Boolean>(p => p.CategoryID == ssvm.Location);

                results = _prodService.GetAll().Where(catFilter);
            }
            else
            {
                results = _prodService.GetAll();
            }

            if (!String.IsNullOrEmpty(ssvm.Term))
            {
                results = results.Where(p => p.Name.Contains(ssvm.Term));
            }

            var srvm = new SearchResultsViewModel();

            srvm.ssvm = ssvm;

            srvm.Products = Mapper.Map <List <ProductViewModel> >(results).ToPagedList(pageNumber, 9);

            ssvm.SearchLocations = this.searchLocations();

            return(View("SearchResults", srvm));
        }
        public ActionResult _SearchPartial()
        {
            //var vm = new LeafCategoryDetailsViewModel();
            var ssvm = new StoreSearchViewModel();

            ssvm.SearchLocations = this.searchLocations();


            return(PartialView("_SearchPartial", ssvm));
        }
示例#3
0
        private void ButtonStorageInventroyExportFunction_Click(object sender, RoutedEventArgs e)
        {
            var storeSearchViewModel = new StoreSearchViewModel();

            storeSearchViewModel.InventoryCheckSheetClick();
        }