예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CatalogItemWithPriceModel"/> class.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="price">The price.</param>
 /// <param name="availability">The availability.</param>
 public CatalogItemWithPriceModel(ItemModel item, PriceModel price, ItemAvailabilityModel availability)
 {
     _item         = item;
     _price        = price;
     _availability = availability;
     _itemReviews  = new ReviewTotals {
         ItemId = item.ItemId
     };
 }
예제 #2
0
 /// <summary>
 /// Creates the price model.
 /// </summary>
 /// <param name="list">The list.</param>
 /// <param name="sale">The sale.</param>
 /// <param name="currency">The currency.</param>
 /// <returns>price model</returns>
 public static PriceModel CreatePriceModel(decimal list, decimal? sale, string currency)
 {
     var priceModel = new PriceModel {ListPrice = list, SalePrice = sale ?? list, Currency = currency};
     if (priceModel.ListPrice != null)
     {
         priceModel.ListPriceFormatted = StoreHelper.FormatCurrency(priceModel.ListPrice.Value, priceModel.Currency);
     }
     if (priceModel.SalePrice != null)
     {
         priceModel.SalePriceFormatted = StoreHelper.FormatCurrency(priceModel.SalePrice.Value, priceModel.Currency);
     }
     return priceModel;
 }
예제 #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CatalogItemWithPriceModel"/> class.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <param name="price">The price.</param>
		/// <param name="availability">The availability.</param>
        public CatalogItemWithPriceModel(ItemModel item, PriceModel price, ItemAvailabilityModel availability)
        {
            _item = item;
            _price = price;
            _availability = availability;
		    _itemReviews = new ReviewTotals {ItemId = item.ItemId};
        }
예제 #4
0
		/// <summary>
		/// Initializes a new instance of the <see cref="AssociatedCatalogItemWithPriceModel"/> class.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <param name="price">The price.</param>
		/// <param name="availability">The availability.</param>
		/// <param name="associationType">Type of the association.</param>
        public AssociatedCatalogItemWithPriceModel(ItemModel item, PriceModel price, ItemAvailabilityModel availability,
                                                   string associationType) :
            base(item, price, availability)
        {
            _associationType = associationType;
        }
예제 #5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CatalogItemWithPriceModel"/> class.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <param name="price">The price.</param>
		/// <param name="availability">The availability.</param>
        public CatalogItemWithPriceModel(ItemModel item, PriceModel price, ItemAvailabilityModel availability)
        {
            _item = item;
            _price = price;
            _availability = availability;
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssociatedCatalogItemWithPriceModel"/> class.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="price">The price.</param>
 /// <param name="availability">The availability.</param>
 /// <param name="associationType">Type of the association.</param>
 public AssociatedCatalogItemWithPriceModel(ItemModel item, PriceModel price, ItemAvailabilityModel availability,
                                            string associationType) :
     base(item, price, availability)
 {
     _associationType = associationType;
 }