예제 #1
0
        public static void Start()
        {
            string choice     = "";
            string userchoice = "";

            try
            {
                do
                {
                    MainMenu();
                    choice = UserChoice();
                    switch (choice)
                    {
                    case "1":
                        InputMenu();
                        userchoice = UserChoice();
                        switch (userchoice)
                        {
                        case "1":
                            string x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllCourses, CreateCourse());
                                Console.Write("Type anything to input another course or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "2":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllTrainers, CreateTrainer());
                                Console.Write("Type anything to input another trainer or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }

                            break;

                        case "3":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllStudents, CreateStudent());
                                Console.Write("Type anything to input another student or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "4":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllAssignments, CreateAssignment());
                                Console.Write("Type anything to input another assignment or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "5":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllStudentPerCourse, CreateStudentPerCourse(ListDatabase.AllCourses));
                                Console.Write("Type anything to input another course with students or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "6":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllTrainersPerCourse, CreateTrainerPerCourse(ListDatabase.AllCourses));
                                Console.Write("Type anything to input another course with trainers or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "7":
                            x = "";
                            while (x != "e")
                            {
                                AddToAList(ListDatabase.AllAssignmentsPerCourse, CreateAssignmentPerCourse(ListDatabase.AllCourses));
                                Console.Write("Type anything to input another course with assignments or 'e'/'E' to exit: ");
                                x = Console.ReadLine().ToLower();
                            }
                            break;

                        case "8":
                            int loops;
                            Console.Write("How many students enrolled in courses with assignments you want to enter?: ");
                            while (!Int32.TryParse(Console.ReadLine(), out loops) && loops < 0)
                            {
                                Console.Write("Enter a positive number: ");
                            }
                            for (int i = 0; i < loops; i++)
                            {
                                CreateStudentAssignments();
                            }
                            break;

                        default:
                            Console.WriteLine("Invalid Option.");
                            break;
                        }
                        break;

                    case "2":
                        Synthetic_Data.ShowALLSeeds();
                        FindStudentsWithMulCourses(Synthetic_Data.StudentAssignments);
                        PrintResultsofFindDates();
                        break;

                    case "3":
                        ShowEverything();
                        break;

                    case "4":
                        break;

                    default:
                        Console.WriteLine("Invalid option");
                        break;
                    }
                } while (choice != "4");
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong.Try again.");
            }
        }
예제 #2
0
 static void Main(string[] args)
 {
     Synthetic_Data.SeedDb();
     CommonTools.Start();
 }