示例#1
0
 public COMPTA_ChartOfAccounts CreateAccountingAccount(COMPTA_ChartOfAccounts accountingAccountToAdd)
 {
     using (SUPERPEntities context = new SUPERPEntities(false))
     {
         var accountingAccount = context.COMPTA_ChartOfAccounts.Add(accountingAccountToAdd);
         context.SaveChanges();
         return(accountingAccount);
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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);
            }
        }