private void AddNewAccount(Account newAccount) { foreach (Account account in this.accounts) { if (account.Customer.ID == newAccount.Customer.ID) { throw new InvalidOperationException("Cannot have two customers with the same ID!"); } } this.accounts.Add(newAccount); }
public void RemoveAccount(Account account) { this.accounts.Remove(account); }
public void AddAccount(Account newAccount) { AddNewAccount(newAccount); }