/// <summary>
 /// Create a new sysAction object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static sysAction CreatesysAction(global::System.Int32 id)
 {
     sysAction sysAction = new sysAction();
     sysAction.ID = id;
     return sysAction;
 }
예제 #2
0
        public void New(invoice inv)
        {
            INV = inv;

            using (var ctx = new accountingEntities())
            using (var ts = new TransactionScope())
            {
                //Entity
                var e = new entity{entityTypeID = (int)projectEnums.entityType.invoice};
                ctx.entities.AddObject(e);

                //New Invoice
                var newInvoice = new invoice()
                {
                    currencyID = inv.currencyID,
                    ID=e.ID
                };

                //sys Action
                var sysaction = new sysAction{sysActionTypeID=(int)projectEnums.sysAction.invoice};
                ctx.sysActions.AddObject(sysaction);

                //sys Action Invoice
                var sysActionInvoice = new invoiceAction
                {
                    ID = sysaction.ID,
                    invoiceStatusID= (int)projectEnums.invoiceStatus.Generated,
                    name="Invoice Generated at "+DateTime.Now.ToLongTimeString()
                };
                ctx.invoiceActions.AddObject(sysActionInvoice);

                ctx.SaveChanges();
                ts.Complete();
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the sysActions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTosysActions(sysAction sysAction)
 {
     base.AddObject("sysActions", sysAction);
 }