public void Execute() { var transactionPrice = _account.TransactionStrategy.GetTransactionFee(); var amountToDeposit = _amount - transactionPrice; _account.Balance += amountToDeposit; Console.WriteLine(_translator.GetTranslation("TransactionPrice") + transactionPrice); if (_account.Balance >= 10000.00) { _account.TransactionStrategy = new ProAccountStrategy(); } else { _account.TransactionStrategy = new NormalAccountStrategy(); } IsCompleted = true; }
public void Execute() { var transactionPrice = _fromAccount.TransactionStrategy.GetTransactionFee(); var totalPrice = _amount + transactionPrice; Console.WriteLine(_translator.GetTranslation("TransactionPrice") + transactionPrice); if (_fromAccount.Balance >= totalPrice) { _fromAccount.Balance -= totalPrice; _toAccount.Balance += _amount; } if (_fromAccount.Balance >= 10000.00) { _fromAccount.TransactionStrategy = new ProAccountStrategy(); } else { _fromAccount.TransactionStrategy = new NormalAccountStrategy(); } IsCompleted = true; }