Exemplo n.º 1
0
        public GetProductPricesResponse GetProductPrices()
        {
            GetProductPricesResponse response = new GetProductPricesResponse();

            try
            {
                IEnumerable <ProductPriceView> productPrices = _productPriceRepository.FindAll().Where(x => x.Product.Discontinued == false)
                                                               .OrderBy(o => o.SortOrder)
                                                               .ConvertToProductPriceViews();

                response.ProductPriceViews = productPrices;
            }
            catch (Exception ex)
            {
            }

            return(response);
        }
Exemplo n.º 2
0
        public GetProductPricesResponse GetProductPrices(Guid productID)
        {
            GetProductPricesResponse response = new GetProductPricesResponse();

            try
            {
                Infrastructure.Querying.Query query = new Infrastructure.Querying.Query();

                Criterion criterion = new Criterion("Product.ID", productID, CriteriaOperator.Equal);
                query.Add(criterion);

                IEnumerable <ProductPriceView> productPrices = _productPriceRepository.FindBy(query)
                                                               .OrderBy(o => o.SortOrder)
                                                               .ConvertToProductPriceViews();

                response.ProductPriceViews = productPrices;
            }
            catch (Exception ex)
            {
                throw;
            }

            return(response);
        }