예제 #1
0
 // TODO : Duplicate code
 protected static PriceModel MapPrice(Product product)
 {
     return(new PriceModel
     {
         Display = PriceCalulator.Price(product.Price, product.VatRate),
         Catalog = PriceCalulator.Price(product.PriceCatalog ?? product.Price, product.VatRate),
         Recommended = PriceCalulator.Price(product.PriceRecommended ?? product.Price, product.VatRate),
         VatRate = product.VatRate,
         PricelistId = product.PriceListId,
         IsFromPrice = false
     });
 }
 protected override PriceModel ResolveCore(BasketItem basketItem)
 {
     return(new PriceModel
     {
         Display = PriceCalulator.Price(basketItem.Price, basketItem.VatRate),
         Catalog = PriceCalulator.Price(basketItem.PriceCatalog ?? basketItem.Price, basketItem.VatRate),
         Recommended = PriceCalulator.Price(basketItem.PriceRecommended ?? basketItem.Price, basketItem.VatRate),
         VatRate = basketItem.VatRate,
         PricelistId = basketItem.PriceListId,
         IsFromPrice = false
     });
 }
예제 #3
0
 public PriceModel Resolve(BasketItem source, BasketItemModel destination, PriceModel destMember, ResolutionContext context)
 {
     return(new PriceModel
     {
         Display = PriceCalulator.Price(source.PriceDisplay, source.VatRate),
         Catalog = PriceCalulator.Price(source.PriceCatalog ?? source.PriceOriginal, source.VatRate),
         Recommended = PriceCalulator.Price(source.PriceRecommended ?? source.PriceOriginal, source.VatRate),
         Original = PriceCalulator.Price(source.PriceOriginal, source.VatRate),
         VatRate = source.VatRate,
         PricelistId = source.PriceListId,
         IsFromPrice = false
     });
 }
예제 #4
0
 public PriceModel Resolve(ProductItem source, TDest destination, PriceModel destMember, ResolutionContext context)
 {
     return(new PriceModel
     {
         Display = PriceCalulator.Price(source.Price, source.VatRate),
         Catalog = PriceCalulator.Price(source.PriceCatalog ?? source.Price, source.VatRate),
         Recommended = PriceCalulator.Price(source.PriceRecommended ?? source.Price, source.VatRate),
         Original = PriceCalulator.Price(source.Price, source.VatRate),
         VatRate = source.VatRate,
         PricelistId = source.PriceListId.GetValueOrDefault(0),
         IsFromPrice = false
     });
 }
예제 #5
0
        protected static PriceModel MapPrice(ProductPrice price)
        {
            if (price == null)
            {
                return(new PriceModel());
            }

            return(new PriceModel
            {
                Display = PriceCalulator.Price(price.Value, price.VatRate),
                Catalog = PriceCalulator.Price(price.Catalog ?? price.Value, price.VatRate),
                Recommended = PriceCalulator.Price(price.Recommended ?? price.Value, price.VatRate),
                VatRate = price.VatRate,
                PricelistId = price.PriceListId,
                IsFromPrice = false
            });
        }
예제 #6
0
        protected static PriceModel MapPrice(ProductItem product)
        {
            if (product == null)
            {
                return(new PriceModel());
            }

            return(new PriceModel
            {
                Display = PriceCalulator.Price(product.Price, product.VatRate),
                Catalog = PriceCalulator.Price(product.PriceCatalog ?? product.Price, product.VatRate),
                Recommended = PriceCalulator.Price(product.PriceRecommended ?? product.Price, product.VatRate),
                VatRate = product.VatRate,
                PricelistId = product.PriceListId.GetValueOrDefault(0),
                IsFromPrice = false
            });
        }
예제 #7
0
        public PriceModel Resolve(VariantItem source, VariantModel destination, PriceModel destMember, ResolutionContext context)
        {
            if (source.Price == null)
            {
                return(new PriceModel());
            }

            var price = source.Price;

            return(new PriceModel
            {
                Display = PriceCalulator.Price(price.Value, price.VatRate),
                Catalog = PriceCalulator.Price(price.Catalog ?? price.Value, price.VatRate),
                Recommended = PriceCalulator.Price(price.Recommended ?? price.Value, price.VatRate),
                Original = PriceCalulator.Price(price.Value, price.VatRate),
                VatRate = price.VatRate,
                PricelistId = price.PriceListId,
                IsFromPrice = false
            });
        }