Ejemplo n.º 1
0
        private void RecordInvoicePaymentTransactions(List <int> txns, int paymentID, enums.paymentStat payStat)
        {
            using (var ctx = new AccountingLib.Models.AccContexts())
            {
                //Create Payment Action
                var payAction = new AccountingLib.Models.paymentAction()
                {
                    paymentID     = paymentID,
                    paymentStatID = (int)payStat
                };
                ctx.paymentAction.AddObject(payAction);
                ctx.SaveChanges();

                //Record Pyament Action TXNS
                foreach (var txn in txns)
                {
                    var newPayActionTxn = new paymentActionTransaction()
                    {
                        paymentActionID = payAction.ID,
                        transactionID   = txn
                    };
                    ctx.paymentActionTransaction.AddObject(newPayActionTxn);
                    ctx.SaveChanges();
                }
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the paymentAction EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTopaymentAction(paymentAction paymentAction)
 {
     base.AddObject("paymentAction", paymentAction);
 }
Ejemplo n.º 3
0
        private void RecordInvoicePaymentTransactions(List<int> txns, int paymentID , enums.paymentStat payStat)
        {
            using (var ctx = new AccountingLib.Models.AccContexts())
            {
                //Create Payment Action
                var payAction = new AccountingLib.Models.paymentAction()
                {
                    paymentID = paymentID,
                    paymentStatID = (int)payStat
                };
                ctx.paymentAction.AddObject(payAction);
                ctx.SaveChanges();

                //Record Pyament Action TXNS
                foreach (var txn in txns)
                {
                    var newPayActionTxn = new paymentActionTransaction()
                    {
                        paymentActionID = payAction.ID,
                        transactionID = txn
                    };
                    ctx.paymentActionTransaction.AddObject(newPayActionTxn);
                    ctx.SaveChanges();
                }
            }
        }
 /// <summary>
 /// Create a new paymentAction object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static paymentAction CreatepaymentAction(global::System.Int32 id)
 {
     paymentAction paymentAction = new paymentAction();
     paymentAction.ID = id;
     return paymentAction;
 }