public static void GetAccountBalance(string userNameInput) { var transactionLogic = new TransactionLogic(); var getBalance = transactionLogic.GetBalance(userNameInput); string accountBalanceMessage = "Your current account balance is $" + getBalance; LoggedInScreen(userNameInput, accountBalanceMessage); }
public static void DisplayTransactions(string userNameInput) { TransactionLogic transLogic = new TransactionLogic(); var transList = transLogic.GetTransactionList(userNameInput); var transactionTable = ASCIILogic.TransactionTable(transList); LoggedInScreen(userNameInput, transactionTable); }
public static void TransferFunds(string userNameInput) { var transactionLogic = new TransactionLogic(); Console.WriteLine("which friend would you like to send money to?"); var friendList = transactionLogic.GetFriendList(userNameInput); foreach (var friend in friendList) { Console.WriteLine(friend); } var friendName = Console.ReadLine(); string amountToSend = ""; if (friendList.IndexOf(friendName) != -1) { Console.WriteLine("Wonderful! How much would you like to send?"); amountToSend = Console.ReadLine(); decimal parsedSendAmount; if (!decimal.TryParse(amountToSend, out parsedSendAmount)) { LoggedInScreen(userNameInput, "Amount deposited must be a decimal"); return; } var newDepositLogic = new DepositLogic(); newDepositLogic.CreateDeposit(userNameInput, "Online Transfer", parsedSendAmount, friendName); var newWithdrawlLogic = new WithdrawlLogic(); newWithdrawlLogic.CreateWithdrawl(friendName, "Online Transfer", parsedSendAmount, userNameInput); } else { LoggedInScreen(userNameInput, "Type friend name exactly to send funds"); return; } LoggedInScreen(userNameInput, "Successfully sent " + amountToSend + " to " + friendName); }