Exemple #1
0
 public static void AddTransaction(Budget_Transactions transaction)
 {
     try
     {
         using (var context = new CarloniusEntities())
         {
             context.Budget_Transactions.Add(transaction);
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         HandleException(ex, "AddTransaction");
     }
 }
Exemple #2
0
 public static void UpdateTransaction(Budget_Transactions transaction)
 {
     try
     {
         using (var context = new CarloniusEntities())
         {
             context.Budget_Transactions.Attach(transaction);
             context.Entry(transaction).State = System.Data.Entity.EntityState.Modified;
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         HandleException(ex, "UpdateTransaction");
     }
 }