예제 #1
0
        private static bool ProcessChoice()
        {
            string input = Console.ReadLine();

            switch (input)
            {
            case "1":
                Console.WriteLine("List students");
                ListStudentWorkflow listWorkflow = new ListStudentWorkflow();
                listWorkflow.Execute();
                break;

            case "2":
                Console.WriteLine("Add student");
                AddStudentWorkflow addWorkflow = new AddStudentWorkflow();
                addWorkflow.Execute();
                break;

            case "3":
                Console.WriteLine("Remove student");
                RemoveStudentWorkflow removeWorkflow = new RemoveStudentWorkflow();
                removeWorkflow.Execute();
                break;

            case "4":
                Console.WriteLine("Edit student");
                EditStudentWorkflow editWorkflow = new EditStudentWorkflow();
                editWorkflow.Execute();
                break;

            case "Q":
                return(false);    //will make us leave the method

            default:
                Console.WriteLine("Invalid choice. Press any key to continue.");
                Console.ReadKey();
                break;
            }

            return(true);
        }
        private static bool ProcessChoice()
        {
            string input = Console.ReadLine();



            switch (input)
            {
            case "1":
                ListStudentWorkflow listWorkflow = new ListStudentWorkflow();
                listWorkflow.Execute();
                break;

            case "2":
                AddStudentWorkflow addWorkflow = new AddStudentWorkflow();
                addWorkflow.Execute();
                break;

            case "3":
                RemoveStudentWorkflow removeWorkflow = new RemoveStudentWorkflow();
                removeWorkflow.Execute();
                break;

            case "4":
                EditStudentWorkflow editWorkflow = new EditStudentWorkflow();
                editWorkflow.Execute();

                break;

            case "Q":
                return(false);

            default:
                Console.WriteLine("That is not a valid choice. Press any key to continue...");
                Console.ReadKey();
                break;
            }

            return(true);
        }