示例#1
0
 private ExecutionResult TransferMoneyToAccount(FinanceDataToken token)
 {
     _moneyList[token.Name] -= token.Amount;
     if (string.IsNullOrWhiteSpace(token.Recipient))
     {
         return(new ExecutionResult(true, $"{token.Amount} was withdrawed from account"));
     }
     _moneyList[token.Recipient] += token.Amount;
     return(new ExecutionResult(true, CreateResultMessage(true, token)));
 }
示例#2
0
 private string CreateResultMessage(bool success, FinanceDataToken token)
 {
     if (success)
     {
         return
             ($"The amount of {token.Amount} was tranfferred from {token.Name} to {token.Recipient} On {DateTime.Now}");
     }
     else
     {
         return($"The amount of {token.Amount} failed to be tranfferred from {token.Name}");
     }
 }