コード例 #1
0
ファイル: Invoice.cs プロジェクト: weedkiller/partition1
        private void RecordInvoiceTransaction(List <int> transactions, enums.invoiceStat invoiceStat)
        {
            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    //create invoice Action
                    var invAction = new AccountingLib.Models.invoiceAction()
                    {
                        invoiceID     = this.invoiceID,
                        invoiceStatID = (int)invoiceStat
                    };
                    ctx.invoiceAction.AddObject(invAction);
                    ctx.SaveChanges();


                    //create invoice Transactions and invoice action Transactions
                    foreach (var item in transactions)
                    {
                        var invActionTrans = new AccountingLib.Models.invoiceActionTransaction()
                        {
                            invoiceActionID = invAction.ID,
                            transactionID   = item
                        };
                        ctx.invoiceActionTransaction.AddObject(invActionTrans);

                        ctx.SaveChanges();
                    }

                    ts.Complete();
                }
        }
コード例 #2
0
ファイル: Invoice.cs プロジェクト: weedkiller/partition1
        public void New(int issuerEntityID, int receiverEntityID, int currencyID)
        {
            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    var newInvoice = new AccountingLib.Models.invoice()
                    {
                        issuerEntityID   = issuerEntityID,
                        receiverEntityID = receiverEntityID,
                        currencyID       = currencyID
                    };
                    ctx.invoice.AddObject(newInvoice);
                    ctx.SaveChanges();

                    //create invoice Action
                    var invAction = new AccountingLib.Models.invoiceAction()
                    {
                        invoiceID     = newInvoice.ID,
                        invoiceStatID = (int)enums.invoiceStat.Generated
                    };
                    ctx.invoiceAction.AddObject(invAction);
                    ctx.SaveChanges();

                    this.loadInvoiceByInvoiceID(newInvoice.ID);

                    ts.Complete();
                }
        }
コード例 #3
0
ファイル: Invoice.cs プロジェクト: saeidghoreshi/partition1
        private void RecordInvoiceTransaction(List<int> transactions, enums.invoiceStat invoiceStat)
        {
            using (var ctx = new AccContexts())
            using (var ts = new TransactionScope())
            {
                //create invoice Action
                var invAction = new AccountingLib.Models.invoiceAction()
                {
                    invoiceID = this.invoiceID,
                    invoiceStatID = (int)invoiceStat
                };
                ctx.invoiceAction.AddObject(invAction);
                ctx.SaveChanges();

                //create invoice Transactions and invoice action Transactions
                foreach (var item in transactions)
                {
                    var invActionTrans = new AccountingLib.Models.invoiceActionTransaction()
                    {
                        invoiceActionID = invAction.ID,
                        transactionID = item
                    };
                    ctx.invoiceActionTransaction.AddObject(invActionTrans);

                    ctx.SaveChanges();
                }

                ts.Complete();

            }
        }
コード例 #4
0
ファイル: Invoice.cs プロジェクト: saeidghoreshi/partition1
        public void New(int issuerEntityID,int receiverEntityID, int currencyID)
        {
            using (var ctx = new AccContexts())
            using (var ts = new TransactionScope())
            {
                var newInvoice = new AccountingLib.Models.invoice()
                {
                    issuerEntityID = issuerEntityID,
                    receiverEntityID = receiverEntityID,
                    currencyID=currencyID
                };
                ctx.invoice.AddObject(newInvoice);
                ctx.SaveChanges();

                //create invoice Action
                var invAction = new AccountingLib.Models.invoiceAction()
                {
                    invoiceID = newInvoice.ID,
                    invoiceStatID = (int)enums.invoiceStat.Generated
                };
                ctx.invoiceAction.AddObject(invAction);
                ctx.SaveChanges();

                this.loadInvoiceByInvoiceID(newInvoice.ID);

                ts.Complete();
            }
        }
コード例 #5
0
 /// <summary>
 /// Create a new invoiceAction object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static invoiceAction CreateinvoiceAction(global::System.Int32 id)
 {
     invoiceAction invoiceAction = new invoiceAction();
     invoiceAction.ID = id;
     return invoiceAction;
 }
コード例 #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the invoiceAction EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToinvoiceAction(invoiceAction invoiceAction)
 {
     base.AddObject("invoiceAction", invoiceAction);
 }