Пример #1
0
 public void Take(int sum)
 {
     if (this.sum >= sum)
     {
         this.sum -= sum;
         MoneyTaken?.Invoke($"Sum get from account {sum}");
     }
     else
     {
         MoneyTaken?.Invoke("Not enought money on the conto");
     }
 }
Пример #2
0
 public void Take(int sum)
 {
     if (this.sum >= sum)
     {
         this.sum -= sum;
         MoneyTaken?.Invoke(this, new AccountEventArgs($"You've taken {sum} from your account", sum));
     }
     else
     {
         MoneyTaken?.Invoke(this, new AccountEventArgs($"You've have not enough money on the conto. Current sum on conto is {sum}", sum));
     }
 }