Пример #1
0
 void IAccount.TransferMoney(double money, IAccount recepient)
 {
     if (money > _Money)
     {
         throw new NotEnoughMoneyException();
     }
     recepient.AddMoney(money);
     _Money -= money;
 }
Пример #2
0
 void IAccount.TransferMoney(double money, IAccount recepient)
 {
     if (_Money - (money + money * CreditComission / 100) < CreditLimit)
     {
         throw new CreditLimitException();
     }
     recepient.AddMoney(money);
     if (_Money < 0)
     {
         _Money -= money * CreditComission / 100;
     }
     _Money -= money;
 }
Пример #3
0
 void IAccount.TransferMoney(double money, IAccount recepient)
 {
     if (money < _Money)
     {
         throw new NotEnoughMoneyException();
     }
     if (DateTime.Now < DepositTime)
     {
         throw new NotTimeSonException();
     }
     recepient.AddMoney(money);
     _Money -= money;
 }