Exemple #1
0
        public void Navigate()
        {
            while (userInput != e)
            {
                // NAVIGATION PANEL
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.WriteLine("<_____________Choose where would you like to Input Data to_________________>");
                Console.WriteLine("#==========================================================================#");
                Console.WriteLine($"|                        {"(1) INSERT STUDENT",-49} | " +
                                  $"\n|                        {"(2) INSERT TRAINER",-49} | " +
                                  $"\n|                        {"(3) INSERT ASSIGNMENT",-49} | " +
                                  $"\n|                        {"(4) INSERT COURSE",-49} | " +
                                  $"\n|                        {"(5) STUDENTS PER COURSE",-49} | " +
                                  $"\n|                        {"(6) TRAINERS PER COURSE",-49} | " +
                                  $"\n|                        {"(7) ASSIGNMENTS PER STUDENT PER COURSE",-49} | " +
                                  $"\n|                        {"(E) RETURN",-49} |");
                Console.WriteLine("#==========================================================================#");
                Console.ForegroundColor = ConsoleColor.White;


                userInput = Console.ReadLine();

                // Choice to INPUT DATA to
                if (userInput == one)
                {
                    sqlInsertToStudents IS1 = new sqlInsertToStudents();
                    IS1.InsertIntoStudent();
                }
                else if (userInput == two)
                {
                    sqlInsertTrainers IT1 = new sqlInsertTrainers();
                    IT1.InsertIntoTrainer();
                }
                else if (userInput == three)
                {
                    sqlInsertAsses IA1 = new sqlInsertAsses();
                    IA1.InsertIntoAss();
                }
                else if (userInput == four)
                {
                    sqlInsertCourses IC1 = new sqlInsertCourses();
                    IC1.InsertNewCourse();
                }
                else if (userInput == five)
                {
                    sqlInsertToCombinedTablesSC ICD01 = new sqlInsertToCombinedTablesSC();
                    ICD01.InsertIntoStudentPerCourse();
                }
                else if (userInput == six)
                {
                    sqlInsertToCombinedTablesTC ICD02 = new sqlInsertToCombinedTablesTC();
                    ICD02.InsertIntoTrainersPerCourse();
                }
                else if (userInput == seven)
                {
                    sqlInsertToCombinedTablesASC ICD03 = new sqlInsertToCombinedTablesASC();
                    ICD03.SelectSpecificAssPerStuPerCourse();
                }

                // Exit and Wrong Input Cases
                else if (userInput == e)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("EXIT");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.DarkRed;
                    Console.WriteLine("Unindentified Input, Please Choose Again");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            }
        }
Exemple #2
0
        public void SelectSpecificAssPerStuPerCourse()
        {
            // Bring the Table COURSES to see/choose a specific COURSE KEY
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("#==========================================================================#");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"|                            EXISTING COURSES                              |");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("#==========================================================================#");
            Console.ForegroundColor = ConsoleColor.White;
            sqlCourse MyC2 = new sqlCourse();

            MyC2.CourseSelectOutput();

            // Input Data
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"< TIP: Insert KEY of choosen COURSE from the Table above >");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Input Course Title: ");
            CourseTitle = Console.ReadLine();

            // Bring the STUDENTS in this COURSE
            StudentPerSpecificCourse();
            // Bring the ASSIGNMENTS in this COURSE
            AssesPerSpecificCourse();

            // NAVIGATION PANEL
            while (userInput != three)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("____________________________TYPE TO CONTINUE________________________________");
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("============================================================================");
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine($"| {"(1) INSERT STUDENT",-22} | {"(2) INSERT ASSIGNMENT",-22} | {"(3) CONTINUE",-22} |");
                Console.ForegroundColor = ConsoleColor.DarkRed;
                Console.WriteLine("============================================================================");
                Console.ForegroundColor = ConsoleColor.White;
                userInput = Console.ReadLine();

                if (userInput == one)
                {
                    sqlInsertToStudents IS1 = new sqlInsertToStudents();
                    IS1.InsertIntoStudent();
                }
                else if (userInput == two)
                {
                    sqlInsertAsses IA1 = new sqlInsertAsses();
                    IA1.InsertIntoAss();
                }
                // Exit and Wrong Input Cases
                else if (userInput == three)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("EXIT");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.DarkRed;
                    Console.WriteLine("Unindentified Input, Please Choose Again");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            }

            // Input Data
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"< TIP: Insert KEY of choosen STUDENT from the Table above >");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Input Student ID: ");
            Student_ID = Console.ReadLine();

            // Display Title after the Table STUDENT/COURSE
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("#==========================================================================#");
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"|                  ASSIGNMENTS FOR THE CHOOSEN STUDENT                     |");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("#==========================================================================#");
            Console.ForegroundColor = ConsoleColor.White;

            AssOfChoosenStudent();
        }