Ejemplo n.º 1
0
 private LineItemModel MapToModel(Mediachase.Commerce.Orders.LineItem item)
 {
     return(new LineItemModel()
     {
         ArticleNumber = item.GetStringValue(Constants.Metadata.LineItem.ArticleNumber),
         CatalogEntryId = item.Code,
         Color = item.GetStringValue(Constants.Metadata.LineItem.Color),
         Description = item.GetStringValue(Constants.Metadata.LineItem.Description),
         Discounts = MapDiscounts(item.Discounts),
         DisplayName = item.DisplayName,
         ExtendedPrice = item.ExtendedPrice,
         LineItemDiscountAmount = item.LineItemDiscountAmount,
         OrderLevelDiscountAmount = item.OrderLevelDiscountAmount,
         Quantity = (int)item.Quantity,
         Size = item.GetStringValue(Constants.Metadata.LineItem.Size),
         WarehouseCode = item.WarehouseCode
     });
 }
Ejemplo n.º 2
0
 public LineItem(Mediachase.Commerce.Orders.LineItem lineItem, string language)
 {
     Code                       = lineItem.Code;
     Name                       = lineItem.GetStringValue(Constants.Metadata.LineItem.DisplayName);
     ArticleNumber              = lineItem.GetStringValue(Constants.Metadata.LineItem.ArticleNumber);
     ImageUrl                   = lineItem.GetString(Constants.Metadata.LineItem.ImageUrl);
     Color                      = lineItem.GetStringValue(Constants.Metadata.LineItem.Color);
     ColorImageUrl              = lineItem.GetStringValue(Constants.Metadata.LineItem.ColorImageUrl);
     Description                = lineItem.GetStringValue(Constants.Metadata.LineItem.Description);
     Size                       = lineItem.GetStringValue(Constants.Metadata.LineItem.Size);
     WineRegion                 = lineItem.GetStringValue(Constants.Metadata.LineItem.WineRegion);
     PlacedPrice                = lineItem.PlacedPrice;
     LineItemTotal              = lineItem.Quantity * lineItem.PlacedPrice;
     LineItemDiscount           = lineItem.LineItemDiscountAmount;
     LineItemOrderLevelDiscount = lineItem.OrderLevelDiscountAmount;
     Quantity                   = Convert.ToInt32(lineItem.Quantity);
     Url                  = lineItem.GetEntryLink(language);
     Discounts            = lineItem.Discounts.Cast <Discount>().Select(x => new DiscountItem(x)).ToList();
     IsInventoryAllocated = lineItem.IsInventoryAllocated;
 }