Beispiel #1
0
        public List <ProductModelForBranchCatalog> GetProducts(int selectedCategory, int selectedSubCategory, int?selectedBrand)
        {
            RetailerProductSelectedFilter filters = new RetailerProductSelectedFilter
            {
                SelectedCategory    = selectedCategory,
                SelectedSubCategory = selectedSubCategory,
                SelectedBrand       = selectedBrand
            };

            return(_unitOfWork.ProductRepository.GetProducts(filters, 1));
        }
Beispiel #2
0
        public List <ProductModel> GetPagingProducts(int selectedCategory, int selectedSubCategory, int?selectedBrand, int pageNo, int PageSize)
        {
            RetailerProductSelectedFilter filters = new RetailerProductSelectedFilter
            {
                SelectedCategory    = selectedCategory,
                SelectedSubCategory = selectedSubCategory,
                SelectedBrand       = selectedBrand
            };

            return(_unitOfWork.ProductRepository.GetPagingProducts(filters, pageNo, PageSize));
        }
Beispiel #3
0
        public static List <ProductModel> GetPagingProducts(this IGenericRepository <Product> productRepository, RetailerProductSelectedFilter filter, int pageNo, int PageSize)
        {
            IPagedList <Product> productsPaging = null;
            var products = productRepository.Find(x => x.IsDeleted != true &&
                                                  x.Category == filter.SelectedSubCategory && (filter.SelectedBrand != null ? x.Manufacturer == filter.SelectedBrand : x.Manufacturer != null)
                                                  , y => y.PricingCollection).ToList();

            products.ForEach(x => x.PricingCollection = x.PricingCollection.Where(y => y.IsDeleted != true).ToList());

            productsPaging = products.OrderBy(x => x.ProductId).ToPagedList <Product>(pageNo, PageSize);
            List <ProductModel> productModelList = new List <ProductModel>();

            Mapper.Map <IEnumerable <Product>,
                        IEnumerable <ProductModel> >(productsPaging, productModelList);

            return(productModelList);
        }
Beispiel #4
0
        public static List <ProductModelForBranchCatalog> GetProducts(this IGenericRepository <Product> productRepository, RetailerProductSelectedFilter filter, int branchId)
        {
            var products = productRepository.Find(x => x.IsDeleted != true &&
                                                  x.Category == filter.SelectedSubCategory && (filter.SelectedBrand != null ? x.Manufacturer == filter.SelectedBrand : x.Manufacturer != null)
                                                  , y => y.PricingCollection).ToList <Product>();

            List <ProductModelForBranchCatalog> productModelList = new List <ProductModelForBranchCatalog>();

            Mapper.Map <IEnumerable <Product>,
                        IEnumerable <ProductModelForBranchCatalog> >(products, productModelList);

            productModelList.ForEach(x => x.FlagExist = x.BranchList.Contains(branchId));

            return(productModelList);
        }