public COMPTA_ChartOfAccounts CreateAccountingAccount(COMPTA_ChartOfAccounts accountingAccountToAdd) { using (SUPERPEntities context = new SUPERPEntities(false)) { var accountingAccount = context.COMPTA_ChartOfAccounts.Add(accountingAccountToAdd); context.SaveChanges(); return(accountingAccount); } }
public static ChartsOfAccount ToChartsOfAccount(this COMPTA_ChartOfAccounts _class) { ChartsOfAccount result = new ChartsOfAccount(); if (_class == null) { return(null); } result.id = _class.id; result.name = _class.name; result.class_id = _class.class_id; result.account_number = _class.account_number; return(result); }
public COMPTA_ChartOfAccounts EditAccountingAccount(COMPTA_ChartOfAccounts accountingAccountToEdit) { using (SUPERPEntities context = new SUPERPEntities(false)) { var accountingAccount = context.COMPTA_ChartOfAccounts.Find(accountingAccountToEdit.id); if (accountingAccount == null) { return(null); } accountingAccount = accountingAccountToEdit; context.SaveChanges(); return(accountingAccount); } }