public void Execute(Account account, string message, bool transfer, Account transferAccount, bool deleting = false) { decimal amount; if (deleting == false) { amount = UserPrompts.GetDecimalFromUser(message); } else { amount = account.Balance; } var manager = new AccountManager(); var response = manager.Withdrawl(amount, account); if (response.Success) { AccountScreens.WithdrawlDetails(response.Data); if (transfer == true) { DepositWorkflow depositTransfer = new DepositWorkflow(); depositTransfer.Execute(transferAccount, amount); } } else { AccountScreens.WorkflowErrorScreen(response.Message); } }
public void Execute() { Console.Clear(); CreateAndSaveAccount(); Console.Clear(); Console.WriteLine("Here are your new account details: \n"); AccountScreens.PrintAccountDetails(_currentAccount); AccountOptionsMenu.DisplayLookupMenu(_currentAccount); Console.ReadLine(); }
private void DisplayAccountInformation(int accountNumber) { var manager = new AccountManager(); var result = manager.GetAccount(accountNumber); Console.Clear(); if (result.Success) { _currentAccount = result.Data; AccountScreens.PrintAccountDetailsView(_currentAccount); DisplayLookupMethod(); } }
public void Execute(Account account) { decimal amount = UserPrompts.GetDecimalFromUser("Please provide a deposit amount:"); var manager = new AccountManager(); var response = manager.Deposit(amount, account); if (response.Success) { AccountScreens.DepositDetails(response.Data); } else { AccountScreens.WorkflowErrorScreen(response.Message); } }
private void DisplayAccountInformation(int accountNumber) { var manager = new AccountManager(); var result = manager.GetAccount(accountNumber); Console.Clear(); if (result.Success) { _currentAccount = result.Data; AccountScreens.PrintAccountDetails(_currentAccount); AccountOptionsMenu.DisplayLookupMenu(_currentAccount); } else { AccountScreens.WorkflowErrorScreen(result.Message); } }
public void Execute(Account account, decimal amount) { Console.ForegroundColor = ConsoleColor.White; if (amount <= 0) { amount = UserPrompts.GetDecimalFromUser("Please enter a deposit amount."); } var manager = new AccountManager(); var response = manager.Deposit(amount, account); if (response.Success) { AccountScreens.DepositDetails(response.Data); } else { AccountScreens.WorkflowErrorScreen(response.Message); } }
public void Execute() { Console.Clear(); Account newAccount = new Account(); newAccount.FirstName = UserPrompts.GetStringFromUser("Enter the First Name of the new account holder:"); newAccount.LastName = UserPrompts.GetStringFromUser("Enter the Last Name of the new account holder:"); newAccount.Balance = UserPrompts.GetDecimalFromUser("How much would you like to deposit to start the account?"); AccountManager manager = new AccountManager(); newAccount.AccountNumber = manager.GenerateNewAccountNumber(); manager.SaveNewAccount(newAccount); Console.Clear(); Console.WriteLine("Here are your new account details: \n"); AccountScreens.PrintAccountDetails(newAccount); Console.ReadLine(); }
public void Execute(Account account) { Console.Clear(); decimal amount = UserPrompts.GetDecimalFromUser($"Make a deposit to Account #{account.AccountNumber}" + $"\n===============================================================" + $"\nCurrent Account Balance: {account.Balance:C}" + $"\nHow much would you like to deposit? Please enter decimal amount."); var manager = new AccountManager(); var response = manager.Deposit(amount, account); if (response.Success) { AccountScreens.DepositDetails(response.Data); } else { AccountScreens.WorkflowErrorScreen(response.Message); } }
public void Execute(Account currentAccount) { Console.Clear(); decimal amount = UserPrompts.GetDecimalFromUser($"Make a withdrawal from Account #{currentAccount.AccountNumber}" + $"\n===============================================================" + $"\nCurrent Account Balance: {currentAccount.Balance:C}" + $"\nHow much would you like to withdraw? Please enter decimal amount."); AccountManager manager = new AccountManager(); var response = manager.Withdraw(amount, currentAccount); if (response.Success) { AccountScreens.WithdrawalDetails(response.Data); } else { AccountScreens.WorkflowErrorScreen(response.Message); } }
public void Refresh() { UpdateAccountScreen(_selectedAccountScreen ?? (_selectedAccountScreen = AccountScreens.FirstOrDefault())); }