Пример #1
0
        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);
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
        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);
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
        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();
        }
Пример #8
0
        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);
            }
        }
Пример #10
0
 public void Refresh()
 {
     UpdateAccountScreen(_selectedAccountScreen ?? (_selectedAccountScreen = AccountScreens.FirstOrDefault()));
 }