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