public static PaymentItem[] CreatePaymentItems(this CalculatePaymentItemRequest[] items) { var input = items.ToArray(); var result = new PaymentItem[input.Count()]; using (var container = new TransactionModelContainer()) { for (int i = 0; i < result.Length; i++) { //int serviceCode = input[i].ServiceCode.ToInt(); result[i] = new PaymentItem( //input[i].ServiceCode.ToInt(), //container.ServiceCodes.FirstOrDefault(t => t.Code == serviceCode).Name, input[i].Quantity, input[i].UnitAmount, input[i].VatPercent, input[i].WithholdingTaxPercent, input[i].ServiceIsRevenue, input[i].IsLegalPerson, input[i].ItemDescription); } } return result; }
/// <summary> /// Create a new PaymentItem object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="qty">Initial value of the Qty property.</param> /// <param name="unitAmount">Initial value of the UnitAmount property.</param> /// <param name="serviceIsRevenue">Initial value of the ServiceIsRevenue property.</param> /// <param name="paymentId">Initial value of the PaymentId property.</param> /// <param name="withholdingTexPercent">Initial value of the WithholdingTexPercent property.</param> /// <param name="isLegalPerson">Initial value of the IsLegalPerson property.</param> /// <param name="vatPercent">Initial value of the VatPercent property.</param> public static PaymentItem CreatePaymentItem(global::System.Int64 id, global::System.Int32 qty, global::System.Decimal unitAmount, global::System.Boolean serviceIsRevenue, global::System.Int64 paymentId, global::System.Decimal withholdingTexPercent, global::System.Boolean isLegalPerson, global::System.Decimal vatPercent) { PaymentItem paymentItem = new PaymentItem(); paymentItem.Id = id; paymentItem.Qty = qty; paymentItem.UnitAmount = unitAmount; paymentItem.ServiceIsRevenue = serviceIsRevenue; paymentItem.PaymentId = paymentId; paymentItem.WithholdingTexPercent = withholdingTexPercent; paymentItem.IsLegalPerson = isLegalPerson; paymentItem.VatPercent = vatPercent; return paymentItem; }
/// <summary> /// Deprecated Method for adding a new object to the PaymentItems EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPaymentItems(PaymentItem paymentItem) { base.AddObject("PaymentItems", paymentItem); }
public void AddPaymentItem(PaymentItem item) { if (Installments.Count() <= 0 && PayInSlips.Count() <= 0) { PaymentItems.Add(item); } }