コード例 #1
0
        public static List <StudPerCourse> CreateListsStudentsPerCourse() // CREATE LIST, STUDENTS per COURSE______________________________________
        {
            List <Student> Mathites = ListProvider.CreateListsStudents();
            List <Course>  Mathima  = ListProvider.CreateListCourses();

            StudPerCourse SPC001 = new StudPerCourse(Mathima, Mathites);

            List <StudPerCourse> studentspermathima = new List <StudPerCourse>();

            studentspermathima.Add(SPC001);

            return(studentspermathima);
        }
コード例 #2
0
        public static List <AssPerStudent> CreateListsAssPerStudents() // CREATE LIST, ASSIGNMENTS per STUDENTS_____________________________________
        {
            List <Assignment> Assignments = ListProvider.CreateListAssignments();
            List <Student>    Students    = ListProvider.CreateListsStudents();


            AssPerStudent APS001 = new AssPerStudent(Students, Assignments);

            List <AssPerStudent> asignemntsperstudent = new List <AssPerStudent>();

            asignemntsperstudent.Add(APS001);

            return(asignemntsperstudent);
        }
コード例 #3
0
        public static void PrintListStudents()
        {
            // Output STUDENTS List______________________________________________________________________
            List <Student> students = new List <Student>();

            students = ListProvider.CreateListsStudents();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("-----------------------------------------------------------------------------------------");
            Console.WriteLine($" {"STUDENTS NAME",-15} {" ", -15} | {"SUBJECT",-10} | {"START DATE",-12} | {"TUITION FEES"} ");
            Console.WriteLine("-----------------------------------------------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.White;
            foreach (var item in students)
            {
                item.Output();
            }
            //-------------------------------------------------------------------------------------------
        }
コード例 #4
0
        public static void CourseCheck()
        {
            List <Student> students = ListProvider.CreateListsStudents();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("-----------------------------------------------------------------------------------------");
            Console.WriteLine($"STUDENTS IN MORE THAN ONE COURSES");
            Console.WriteLine("-----------------------------------------------------------------------------------------");
            Console.ForegroundColor = ConsoleColor.White;

            for (int i = 0; i < students.Count; i++)
            {
                for (int j = i + 1; j < students.Count; j++)
                {
                    if (students[i].Name == students[j].Name && students[i].Subject != students[j].Subject)
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine($" {students[i].Name,-10} {students[i].LastName, -15} | 1) {students[i].Subject, -8} | 2) {students[j].Subject,-8}");
                        Console.WriteLine("-----------------------------------------------------------------------------------------");
                        Console.ForegroundColor = ConsoleColor.White;
                    }
                }
            }
        }
コード例 #5
0
        public static void UserInput()
        {
            string e         = "E";
            string i         = "I";
            string userInput = null;

            List <Student> students = ListProvider.CreateListsStudents();

            while (userInput != e)
            {
                Console.WriteLine("\nChoose Action: \n(I) INPUT DATA, \n(E) BACK ");
                userInput = Console.ReadLine();
                if (userInput == i)
                {
                    string   tempName    = "Anonimos";
                    string   tempSurname = "Anonimopoulos";
                    string   tempSubject = "Unspecified";
                    DateTime tempDate    = DateTime.Now;
                    int      tempFees    = 2500;

                    // Input Set Up__________________________________________________
                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("Please Input Student Data");
                    Console.ForegroundColor = ConsoleColor.White;

                    // Input NAME_____________________________________________________
                    string tempName0;
                    Console.Write("Name:            ");
                    tempName0 = Console.ReadLine();
                    if (tempName0 == null)
                    {
                        tempName = "Anonimos";
                    }
                    tempName = tempName0;

                    // Input SURNAME__________________________________________________
                    string tempSurname0;
                    Console.Write("SurName:         ");
                    tempSurname0 = Console.ReadLine();
                    if (tempSurname0 == null)
                    {
                        tempSurname = "Anonimopoulos";
                    }
                    tempSurname = tempSurname0;

                    // Input SUBJECT__________________________________________________
                    string tempSubject0;
                    Console.Write("Subject:         ");
                    tempSubject0 = Console.ReadLine();
                    if (tempSubject0 == null)
                    {
                        tempSubject = "Unspecified";
                    }
                    tempSubject = tempSubject0;

                    // Input START DATE_______________________________________________
                    try
                    {
                        Console.WriteLine("Starting Date (DD/MM/YYYY): ");
                        string   Check     = Console.ReadLine();
                        DateTime DateCheck = DateTime.ParseExact(Check, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                        tempDate = DateCheck;
                    }
                    catch (Exception)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Your Given Date has Bad Format, Please input: (DD/MM/YYYY)");
                        Console.ForegroundColor = ConsoleColor.White;
                    }

                    // Input TUITION FEES_____________________________________________
                    try
                    {
                        Console.Write("Tuition Fees:    ");
                        tempFees = Int32.Parse(Console.ReadLine());
                        if (tempFees <= 0)
                        {
                            tempFees = 2500;
                        }
                    }
                    catch (Exception)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Fees must be a Number, Please Input a Number");
                        Console.ForegroundColor = ConsoleColor.White;
                    }

                    Student temp = new Student(tempName, tempSurname, tempSubject, tempDate, tempFees);
                    students.Add(temp);

                    foreach (var item in students)
                    {
                        item.Output();
                    }
                }
                else if (userInput == e)                                    // Step Back Command
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("BACK");
                    Console.ForegroundColor = ConsoleColor.White;
                }
                else                                                        // In the Case of false Data Input
                {
                    Console.ForegroundColor = ConsoleColor.DarkRed;
                    Console.WriteLine("Unindentified Input, Please Choose Again");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            }
        }