Пример #1
0
 public CommercialData AddLineItems(params CommercialLineItem[] items)
 {
     LineItems.AddRange(items);
     return(this);
 }
Пример #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;
 }
Пример #3
0
 public void AddLineItems(IEnumerable <InvoiceLine> invoiceLines) => LineItems.AddRange(invoiceLines ?? new List <InvoiceLine>());
Пример #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));
Пример #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);
        }