コード例 #1
0
        public Object SaveChartOfAccount(dynamic data)
        {
            ChartsOfAccount chartofaccount = JsonConvert.DeserializeObject <ChartsOfAccount>(data.ToString());

            _chartofaccountLogic.AddorUpdate(chartofaccount);

            return(new
            {
                success = true,
                ChartsAccount = new { Record = chartofaccount, TotalRecords = 1 }
            });
        }
コード例 #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 ChartsOfAccount AddorUpdate(ChartsOfAccount account)
 {
     _accountRepository.AddOrUpdate(account);
     _accountRepository.SaveChanges();
     return(account);
 }