示例#1
0
文件: Menu.cs 项目: kjakoby/SGRepo
        public static void Start()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("SG Bank Application");
                Console.WriteLine("-------------------------");
                Console.WriteLine("1. Lookup an Account");
                Console.WriteLine("2.Deposit");
                Console.WriteLine("3.Withdraw");

                Console.WriteLine("\nQ to quit");
                Console.Write("\nEnter selection: ");

                string userInput = Console.ReadLine();
                switch (userInput)
                {
                case "1":
                    AccountLookupWorkflow lookupWorkflow = new AccountLookupWorkflow();
                    lookupWorkflow.Execute();
                    break;

                case "2":
                    DepositWorkflow depositWorkflow = new DepositWorkflow();
                    depositWorkflow.Execute();
                    break;

                case "3":
                    break;

                case "Q":
                    return;
                }
            }
        }
示例#2
0
        public static void Start()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("SG Bank Application");
                Console.WriteLine(ConsoleIO.DividingBar);
                Console.WriteLine("1. Lookup an Account");
                Console.WriteLine("2. Deposit");
                Console.WriteLine("3. Withdraw");
                Console.WriteLine("4. List all Accounts");
                Console.WriteLine("5. Add new Account");

                Console.WriteLine("\nQ - To Quit");
                Console.Write("\nEnter Selection: ");

                string userInput = Console.ReadLine().ToUpper();

                switch (userInput)
                {
                case "1":
                    AccountLookupWorkflow lookupFlow = new AccountLookupWorkflow();
                    lookupFlow.Execute();
                    break;

                case "2":
                    DepositWorkflow depositFlow = new DepositWorkflow();
                    depositFlow.Execute();
                    break;

                case "3":
                    WithdrawWorkflow withdrawFlow = new WithdrawWorkflow();
                    withdrawFlow.Execute();
                    break;

                case "4":
                    AccountLookupAllWorkflow lookupAllFlow = new AccountLookupAllWorkflow();
                    lookupAllFlow.Execute();
                    break;

                case "5":
                    AddAccountWorkflow addFlow = new AddAccountWorkflow();
                    addFlow.Execute();
                    break;

                case "Q":
                    return;
                }
            }
        }
示例#3
0
        public static void Start()
        {
            Console.Clear();
            while (true)
            {
                Console.WriteLine("SG Bank Application");
                Console.WriteLine("---------------------------------");
                Console.WriteLine("1. Lookup an Account");
                Console.WriteLine("2. Deposit");
                Console.WriteLine("3. Withdraw");
                Console.WriteLine("\nQ to quit");
                Console.Write("\nEnter selection:  ");

                string userinput = Console.ReadLine().ToLower();

                switch (userinput)
                {
                case "1":
                    AccountLookupWorkflow lookupWorkflow = new AccountLookupWorkflow();
                    lookupWorkflow.Execute();
                    break;

                case "2":
                    DepositWorkflow depositWorkflow = new DepositWorkflow();
                    depositWorkflow.Execute();
                    break;

                case "3":
                    WithdrawalWorkflow withdrawalWorkflow = new WithdrawalWorkflow();
                    withdrawalWorkflow.Execute();
                    break;

                case "q":
                    return;

                default:
                    Console.WriteLine("Invalid selection. Try again...");
                    break;
                }
            }
        }
示例#4
0
        public static void Start()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("====================");
                Console.WriteLine("SG BANK APPLICATION");
                Console.WriteLine("--------------------");
                Console.WriteLine("1. Lookup an Account");
                Console.WriteLine("2. Deposit");
                Console.WriteLine("3. Withdraw");
                Console.WriteLine("Q. Quit");
                Console.WriteLine("====================");
                Console.Write("\nEnter selection: ");

                string userInput = Console.ReadLine().ToUpper();

                switch (userInput)
                {
                case "1":
                    AccountLookupWorkflow lookupWorkflow = new AccountLookupWorkflow();
                    lookupWorkflow.Execute();
                    break;

                case "2":
                    DepositWorkflow depositWorkflow = new DepositWorkflow();
                    depositWorkflow.Execute();
                    break;

                case "3":
                    WithdrawWorkflow withdrawWorkflow = new WithdrawWorkflow();
                    withdrawWorkflow.Execute();
                    break;

                case "Q":
                    return;
                }
            }
        }
示例#5
0
        public static void Start()//Static only one state
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine("SG Bank Application");
                Console.WriteLine("==========================");
                Console.WriteLine("1. Lookup Account");
                Console.WriteLine("2. Deposit");
                Console.WriteLine("3. Withdraw");

                Console.WriteLine("\nQ to quit");
                Console.WriteLine("\\nEnter selection: ");

                string input = Console.ReadLine();

                switch (input)
                {
                case "1":
                    AccountLookupWorkflow lookupWorkflow = new AccountLookupWorkflow();
                    lookupWorkflow.Execute();
                    break;

                case "2":
                    DepositWorkflow depositWorkflow = new DepositWorkflow();
                    depositWorkflow.Execute();
                    break;

                case "3":
                    WithdrawWorkflow withdrawWorkflow = new WithdrawWorkflow();
                    withdrawWorkflow.Execute();
                    break;

                case "Q":
                    return;
                }
            }
        }