public ChartOfAccount(ChartOfAccount chartOfAccount) { if (chartOfAccount == null) { throw new ArgumentNullException(nameof(chartOfAccount)); } ChartOfAccountId = chartOfAccount.ChartOfAccountId; CompanyId = chartOfAccount.CompanyId; AccountNo = chartOfAccount.AccountNo; AccountType = chartOfAccount.AccountType; AccountName = chartOfAccount.AccountName; BalanceType = chartOfAccount.BalanceType; BankAccountFlag = chartOfAccount.BankAccountFlag; }
public void SetChartOfAccount(ChartOfAccount chartOfAccount) { if (chartOfAccount == null) { throw new ArgumentNullException(nameof(chartOfAccount)); } var existingAccount = GLAccounts.FirstOrDefault(a => a.AccountNo == chartOfAccount.AccountNo); if (existingAccount != null) { GLAccounts.Remove(existingAccount); } GLAccounts.Add(chartOfAccount); }