Example #1
0
        private ProductsReturn GetDeviatedPriceProductsBySearch(UserSelectedContext catalogInfo, string search, SearchInputModel searchModel, UserSelectedContext tempCatalogInfo)
        {
            ProductsReturn ret = _catalogRepository.GetProductNumbersBySearch(tempCatalogInfo, search, searchModel);

            // filter out just those with deviated prices
            FilterDeviatedPriceProducts(ret, catalogInfo);
            // now go back and fill out the rest of the product information on those with deviated prices
            ret = _catalogRepository.GetProductsByIds(catalogInfo.BranchId, ret.Products.Select(p => p.ItemNumber).ToList());
            // add facet for specialfilters to return and set count to number of products
            ret.Facets = new System.Dynamic.ExpandoObject();
            _catalogRepository.AddSpecialFiltersToFacets(ret.Facets, ret.Products.Count().ToString());
            return(ret);
        }