Exemplo n.º 1
0
 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!");
     }
 }
Exemplo n.º 2
0
 public void RemoveAccount(Account account)
 {
     this.Accounts.Remove(account);
 }
Exemplo n.º 3
0
 public void AddAccount(Account account)
 {
     this.Accounts.Add(account);
 }
Exemplo n.º 4
0
 public void RemoveAccount(Account account)
 {
     this.bankAccounts.Remove(account.Coustomer.Name);
 }