Esempio n. 1
0
 public COMPTA_ClassOfAccounts CreateAccountingClass(COMPTA_ClassOfAccounts accountingClassToAdd)
 {
     using(SUPERPEntities context = new SUPERPEntities(false))
     {
         var accountingClass = context.COMPTA_ClassOfAccounts.Add(accountingClassToAdd);
         context.SaveChanges();
         return accountingClass;
     }
 }
Esempio n. 2
0
        public COMPTA_ClassOfAccounts EditAccountingClass(COMPTA_ClassOfAccounts accountingClassToEdit)
        {
            using(SUPERPEntities context = new SUPERPEntities(false))
            {
                var accountingClass = context.COMPTA_ClassOfAccounts.Find(accountingClassToEdit.id);

                if (accountingClass == null)
                    return null;

                accountingClass = accountingClassToEdit;
                context.SaveChanges();
                return accountingClass;
            }
        }