private Account _getAccountByNumber(string pNumber, int pCurrencyId) { Account a = new Account(); foreach (Account account in _accounts) { if (account.Number == pNumber && account.CurrencyId == pCurrencyId) a = account; } return a;//_accounts.FirstOrDefault(item => item.Number.Equals(pNumber) && item.CurrencyId == pCurrencyId); }
public void AddAccount(Account account) { _accounts.Add(account); }
private List<Account> _CopyEachAccount(List<Account> pAccounts) { List < Account > newAccounts = new List<Account>(); foreach (Account account in pAccounts) { Account newAccount = new Account(); newAccount = account.Copy(); //newAccount.Balance = 0; //newAccount.StockBalance = 0; newAccounts.Add(newAccount); } return newAccounts; }