예제 #1
0
 public Transaction(decimal amount , account acc)
 {
     using (var ctx = new accountingEntities())
     {
         TXN = new transaction
         {
             accountID = acc.ID,
             amount = amount
         };
         ctx.transactions.AddObject(TXN);
         ctx.SaveChanges();
     }
 }
 /// <summary>
 /// Create a new transaction object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static transaction Createtransaction(global::System.Int32 id)
 {
     transaction transaction = new transaction();
     transaction.ID = id;
     return transaction;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the transactions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotransactions(transaction transaction)
 {
     base.AddObject("transactions", transaction);
 }