/// <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 }; }
/// <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; }
/// <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}; }
/// <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; }
/// <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; }