public string WithdrawCash(Transaction transaction) { var amount = transaction.Amount * ExchangeHelper.CurrencyExchange().GetValueOrDefault(transaction.Currency.ToString()); if (!CheckBalance(amount)) { return("Withdraw amount exceeds account balance."); } Account.Balance -= amount; return(string.Empty); }
public void DepositCash(Transaction transaction) { var amount = transaction.Amount * ExchangeHelper.CurrencyExchange().GetValueOrDefault(transaction.Currency.ToString()); Account.Balance += amount; }