public void AddLineItem(Entity.OrderLineItem lineItem) { var historyLine = new UserOrderHistoryLine(); historyLine.Name = lineItem.Product.Name; historyLine.AmountCharged = lineItem.AmountCharged; historyLine.Quantity = lineItem.Quantity; historyLine.ImageName = lineItem.Product.ImageName; this.LineItems.Add(historyLine); }
/// <summary> /// Adds a new item detail line. /// </summary> /// <param name="orderLine">The order line to be added.</param> public void AddDetailItem(Entity.OrderLineItem orderLine) { if (this.Items == null) { this.Items = new List <StoreOrderDetailItem>(); } var detailItem = new StoreOrderDetailItem(); detailItem.Name = orderLine.Product.Name; detailItem.Quantity = orderLine.Quantity; detailItem.Price = orderLine.AmountCharged; this.TotalPrice += orderLine.AmountCharged ?? 0.0; this.TotalItems += orderLine.Quantity; this.Items.Add(detailItem); }