Example #1
0
        //Ask user number of entries, then creates object and calls method to fill data then stores to list
        private static void AddTrainer()
        {
            Console.WriteLine("How many entries would you like to make ? ");
            int times = InputMinMax(1, 10); //wanted to limit entries doesn't make sense for user to have int.Max entries

            //we can change max value anytime
            for (int i = 1; i <= times; i++)
            {
                Console.Clear();
                ShowData.ShowCourses(Courses);
                Trainer myTrainer = new Trainer();
                Console.WriteLine("Select the course to add the trainer (number). ");
                int num = InputMinMax(1, Courses.Count) - 1;
                myTrainer.FillData();

                if (Courses[num].CheckTrainer(myTrainer))
                {
                    EntryAlreadyExist();
                    PressKeyToContinue();
                }
                else
                {
                    Trainers.Add(myTrainer);
                    Courses[num].AddTrainer(myTrainer);
                    Console.Clear();
                    ShowData.ShowTrainers(Trainers);
                    PressKeyToContinue();
                }
            }
        }
Example #2
0
        //Ask user number of entries, then creates object and calls method to fill data then stores to list
        private static void AddCourses()
        {
            Console.WriteLine("How many entries would you like to make ?  ");
            int times = InputMinMax(1, 10); //wanted to limit entries doesn't make sense for user to have int.Max entries

            //we can change max value anytime
            for (int i = 1; i <= times; i++)
            {
                Course myCourse = new Course();
                myCourse.FillData();

                if (IfCourseExist(myCourse))
                {
                    EntryAlreadyExist();
                    PressKeyToContinue();
                }
                else
                {
                    Courses.Add(myCourse);
                    Console.Clear();
                    ShowData.ShowCourses(Courses);
                    PressKeyToContinue();
                }
            }
        }
Example #3
0
        //Dissplays application's course menu
        private static void CoursesMenu()
        {
            Console.Clear();
            WriteInColor(schoolName, ConsoleColor.Yellow);
            WriteInColor("\n\n1.", ConsoleColor.Green);
            WriteInColor(" Add Course\n", ConsoleColor.Cyan);
            WriteInColor("2.", ConsoleColor.Green);
            WriteInColor(" Add Assignement\n", ConsoleColor.Cyan);
            WriteInColor("3.", ConsoleColor.Green);
            WriteInColor(" Show Students per Course\n", ConsoleColor.Cyan);
            WriteInColor("4.", ConsoleColor.Green);
            WriteInColor(" Show Assignements due date\n", ConsoleColor.Cyan);
            WriteInColor("5.", ConsoleColor.Green);
            WriteInColor(" Display Data\n", ConsoleColor.Cyan);
            WriteInColor("6.", ConsoleColor.Green);
            WriteInColor(" Return\n", ConsoleColor.Red);
            Console.Write(Environment.NewLine);
            int selection = InputMinMax(1, 6);

            switch (selection)
            {
            case 1: AddCourses();
                CoursesMenu();
                break;

            case 2: AddAssignements();
                CoursesMenu();
                break;

            case 3:
                ShowData.ShowStudentsPerCourse(Courses);
                PressKeyToContinue();
                CoursesMenu();
                break;

            case 4:
                ShowData.ShowAssignementDueDate(Assignements);
                PressKeyToContinue();
                CoursesMenu();
                break;

            case 5: DisplaydataMenu();
                break;

            case 6: ShowMainMenu();
                break;

            default: InvalidSelection();
                CoursesMenu();
                break;
            }
        }
Example #4
0
        //Dissplays application's trainer menu
        private static void TrainerMenu()
        {
            Console.Clear();
            WriteInColor(schoolName, ConsoleColor.Yellow);
            WriteInColor("\n\n1.", ConsoleColor.Green);
            WriteInColor(" Add Trainer\n", ConsoleColor.Cyan);
            WriteInColor("2.", ConsoleColor.Green);
            WriteInColor(" Show Trainers per Course\n", ConsoleColor.Cyan);
            WriteInColor("3.", ConsoleColor.Green);
            WriteInColor(" Display Data\n", ConsoleColor.Cyan);
            WriteInColor("4.", ConsoleColor.Green);
            WriteInColor(" Return\n", ConsoleColor.Red);
            Console.Write(Environment.NewLine);
            int selection = InputMinMax(1, 4);

            switch (selection)
            {
            case 1: AddTrainer();
                TrainerMenu();
                break;

            case 2:
                ShowData.ShowTrainerPerCourse(Courses);
                PressKeyToContinue();
                TrainerMenu();
                break;

            case 3: DisplaydataMenu();
                break;

            case 4: ShowMainMenu();
                break;

            default:
                InvalidSelection();
                TrainerMenu();
                break;
            }
        }
Example #5
0
        //Ask user number of entries, then creates object and calls method to fill data then stores to list
        private static void AddAssignements()
        {
            Console.WriteLine("How many entries would you like to make ? ");
            int times = InputMinMax(1, 10); //wanted to limit entries doesn't make sense for user to have int.Max entries

            //we can change max value anytime
            for (int i = 1; i <= times; i++)
            {
                Console.Clear();
                ShowData.ShowCourses(Courses);
                Assignement myAssignement = new Assignement();
                Console.WriteLine("Select the course to add the assignement : ");
                int num = InputMinMax(1, Courses.Count) - 1;
                ShowData.ShowStudents(Students);
                Console.WriteLine("Select the student to add the assignement : ");
                int num1 = InputMinMax(1, Students.Count) - 1;
                myAssignement.FillData(Courses[num].StartDate, Courses[num].EndDate);

                //Checks if assignement and student exist in current course
                if (Courses[num].CheckAssignement(myAssignement) && Courses[num].CheckStudent(Students[num1]))
                {
                    EntryAlreadyExist();
                    PressKeyToContinue();
                }
                else
                {
                    Students[num1].AddAssignement(myAssignement);
                    Courses[num].AddAssignement(myAssignement);
                    myAssignement.Course = Courses[num];//We need course to access date for submisssion date
                    Assignements.Add(myAssignement);
                    Console.Clear();
                    ShowData.ShowAssignements(Assignements);
                    PressKeyToContinue();
                }
            }
        }
Example #6
0
        //Dissplays application's display data menu
        private static void DisplaydataMenu()
        {
            Console.Clear();
            WriteInColor(schoolName, ConsoleColor.Yellow);
            WriteInColor("\n\n1.", ConsoleColor.Green);
            WriteInColor(" Show Courses\n", ConsoleColor.Cyan);                           //show all information on course
            WriteInColor("2.", ConsoleColor.Green);
            WriteInColor(" Show Trainers\n", ConsoleColor.Cyan);                          //show all info on trainers
            WriteInColor("3.", ConsoleColor.Green);
            WriteInColor(" Show Students\n", ConsoleColor.Cyan);                          //show all info students
            WriteInColor("4.", ConsoleColor.Green);
            WriteInColor(" Show Assignements\n", ConsoleColor.Cyan);                      //show all assignement info
            WriteInColor("5.", ConsoleColor.Green);
            WriteInColor(" Show Trainers per Course\n", ConsoleColor.Cyan);               //show trainers per course
            WriteInColor("6.", ConsoleColor.Green);
            WriteInColor(" Show Students per Course\n", ConsoleColor.Cyan);               //show students per course
            WriteInColor("7.", ConsoleColor.Green);
            WriteInColor(" Show Assignement per Course\n", ConsoleColor.Cyan);            //show assignement per course
            WriteInColor("8.", ConsoleColor.Green);
            WriteInColor(" Show Assignements per Student\n", ConsoleColor.Cyan);          //show assignement per student
            WriteInColor("9.", ConsoleColor.Green);
            WriteInColor(" Show Student with more than one Course\n", ConsoleColor.Cyan); //show students with more than one course
            WriteInColor("10.", ConsoleColor.Green);
            WriteInColor(" Return\n", ConsoleColor.Red);
            Console.Write(Environment.NewLine);
            int selection = InputMinMax(1, 10);

            switch (selection)
            {
            case 1: ShowData.ShowCourses(Courses);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 2:
                ShowData.ShowTrainers(Trainers);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 3:
                ShowData.ShowStudents(Students);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 4:
                ShowData.ShowAssignements(Assignements);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 5:
                ShowData.ShowTrainerPerCourse(Courses);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 6:
                ShowData.ShowStudentsPerCourse(Courses);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 7:
                ShowData.ShowAssignementPerCourse(Courses);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 8:
                ShowData.ShowAssignementPerStudent(Students);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 9:
                ShowData.ShowStudentsWithManyCourses(Students);
                PressKeyToContinue();
                DisplaydataMenu();
                break;

            case 10: ShowMainMenu();
                break;

            default: InvalidSelection();
                DisplaydataMenu();
                break;
            }
        }