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 } }); }
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 ChartsOfAccount AddorUpdate(ChartsOfAccount account) { _accountRepository.AddOrUpdate(account); _accountRepository.SaveChanges(); return(account); }