Пример #1
0
 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;
 }
Пример #2
0
        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));
        }