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