Пример #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
        private void ProcessChoice(string input)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Account notAccount = new Account();
            decimal amount     = 0;

            switch (input)
            {
            case "1":
                DepositWorkflow dep = new DepositWorkflow();
                dep.Execute(_currentAccount, amount);
                break;

            case "2":
                WithdrawlWorkflow withdrawl = new WithdrawlWorkflow();
                withdrawl.Execute(_currentAccount, "Please enter an amount to withdrawl", false, notAccount);
                break;

            case "3":
                TransferWorkflow transfer = new TransferWorkflow();
                transfer.Execute(_currentAccount, amount);
                break;

            case "0":
                DeleteWorkflow delete = new DeleteWorkflow();
                delete.Execute(_currentAccount);
                break;
            }
        }
 private void ProcessChoice(string choice)
 {
     switch (choice)
     {
     case "1":
         DepositWorkflow depositWorkflow = new DepositWorkflow();
         depositWorkflow.Execute(_currentAccount);
         break;
     }
 }
        private static void ProcessChoice(string choice, Account account)
        {
            switch (choice)
            {
            case "1":
                DepositWorkflow depositWorkflow = new DepositWorkflow();
                depositWorkflow.Execute(account);
                break;

            case "2":
                WithdrawWorkflow withdrawWorkflow = new WithdrawWorkflow();
                withdrawWorkflow.Execute(account);
                break;
            }
        }
Пример #5
0
 private void ProcessChoice(string choice)
 {
     switch (choice)
     {
         case "1":
             var depositWF = new DepositWorkflow();
             depositWF.Execute(_currentAccount);
             break;
         case "2":
             var withdrawWF = new WithdrawWorkflow();
             withdrawWF.Execute(_currentAccount);
             break;
         case "3":
             var transferWF = new TransferWorkflow();
             Console.WriteLine("Enter the account number to transfer to:  ");
             GetTransferAccount(Int32.Parse(Console.ReadLine()));
             transferWF.Execute(_currentAccount, _toTransferToAccout);
             break;
     }
 }
Пример #6
0
        public void ProcessChoice(string Choice)
        {
            switch (Choice)
            {
                case "1":
                    var depositWF = new DepositWorkflow();
                    depositWF.Execute(_currentAccount);
                    break;
                case "2":
                    WithdrawWorkflow wwf = new WithdrawWorkflow();
                    wwf.Execute(_currentAccount);
                    break;
                case "3":
                    Console.WriteLine("This feature is not implemented!");
                    Console.WriteLine("Press Enter to continue...");
                    Console.ReadLine();
                    break;
                default:
                    Console.WriteLine("Invalid Entry...");
                    Console.WriteLine("Press Enter to continue...");
                    Console.ReadLine();
                    break;
            }

            PrintAccountInformation(_currentAccount);
        }
Пример #7
0
        private void ProcessChoice(string input)
        {
            switch (input)
            {
                case "1":
                    var depositWorkflow = new DepositWorkflow();
                    depositWorkflow.Execute(_currentAccount);
                    break;

                case "2":
                    var withdrawalWorkflow = new WithdrawalWorkflow();
                    withdrawalWorkflow.Execute(_currentAccount);
                    break;

                case "3":
                    var transferWorkflow = new TransferWorkflow();
                    transferWorkflow.Execute(_currentAccount);
                    break;

            }
        }