public void AddAccount(Account account) { bool addAcount = true; foreach (var item in this.BankAccounts) { if (item.Key == account.Coustomer.Name && item.Value.GetType().Name == account.GetType().Name) { addAcount = false; break; } } if (addAcount) { this.bankAccounts.Add(account.Coustomer.Name, account); } else { Console.WriteLine("This account already exists!"); } }
public void RemoveAccount(Account account) { this.Accounts.Remove(account); }
public void AddAccount(Account account) { this.Accounts.Add(account); }
public void RemoveAccount(Account account) { this.bankAccounts.Remove(account.Coustomer.Name); }