Ejemplo n.º 1
0
        public DataGridPagingResult <IEnumerable <ProductDto> > GetProducts(ProductRequestDto theParams)
        {
            var result = ProductService.GetProducts(theParams.KeyWord, theParams.Store, theParams.ProductBrand, theParams.Categories);

            if (theParams.Categories.Contains(-10))
            {
                var bundlingResult = BundlingService.GetBundings(theParams.Store, theParams.KeyWord, theParams.ProductBrand);
                if (bundlingResult != null && bundlingResult.Count() > 0)
                {
                    result = result.Concat(bundlingResult);
                }
            }

            return(new DataGridPagingResult <IEnumerable <ProductDto> >()
            {
                Result = result.Skip((theParams.PageIndex - 1) * theParams.PageSize).Take(theParams.PageSize),
                Total = result.Count()
            });
        }