Exemplo n.º 1
0
 public CommercialData AddLineItems(params CommercialLineItem[] items)
 {
     LineItems.AddRange(items);
     return(this);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Additional operations to be performed when cloning an instance of <see cref="Order"/> to an instance of <see cref="PSOrder" />.
 /// </summary>
 /// <param name="order">The order being cloned.</param>
 private void CloneAdditionalOperations(Order order)
 {
     LineItems.AddRange(order.LineItems.Select(o => new PSOrderLineItem(o)));
     OrderId = order.Id;
 }
Exemplo n.º 3
0
 public void AddLineItems(IEnumerable <InvoiceLine> invoiceLines) => LineItems.AddRange(invoiceLines ?? new List <InvoiceLine>());
Exemplo n.º 4
0
 /// <summary>
 /// AppendInvoices appends the items from the sourceInvoice to the current invoice
 /// </summary>
 /// <param name="sourceInvoices">Invoice to merge from</param>
 public void AppendInvoices(IEnumerable <Invoice> sourceInvoices) =>
 LineItems.AddRange(sourceInvoices == null ? new List <InvoiceLine>() : sourceInvoices.SelectMany(i => i.LineItems));
Exemplo n.º 5
0
        /// <summary>
        /// MergeInvoices appends the items from the sourceInvoice to the current invoice
        /// </summary>
        /// <param name="invoiceToMerge">Invoice to merge from</param>
        public void MergeInvoices(Invoice invoiceToMerge)
        {
            var copyOfInvoiceToMerge = invoiceToMerge.Clone();

            LineItems.AddRange(copyOfInvoiceToMerge.LineItems);
        }