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);
        }
        public static void Submissions(string date) // ASSIGNMENTS per STUDENTS PRINT (DATE CHECK)______________________________________
        {
            List <Assignment>    Assignments = ListProvider.CreateListAssignments();
            List <AssPerStudent> ApS         = new List <AssPerStudent>();

            ApS = AssPerStudent.CreateListsAssPerStudents();

            foreach (var item in ApS[0].Students)
            {
                item.Output();

                foreach (var ass in ApS[0].Assignments)
                {
                    if (ass.Title == item.Subject && ass.subDateTime.ToString("dd/MM/yyyy") == date)
                    {
                        ass.Output();
                    }
                }
            }
        }
        public static void PrintListsAssPerStudents() // PRINT ASSIGNMENTS per STUDENTS______________________________________
        {
            List <AssPerStudent> ApS = new List <AssPerStudent>();

            ApS = AssPerStudent.CreateListsAssPerStudents();


            foreach (var item in ApS[0].Students)
            {
                item.Output();

                foreach (var ass in ApS[0].Assignments)
                {
                    if (ass.Title == item.Subject)
                    {
                        ass.Output();
                    }
                }
            }
        }
Beispiel #4
0
        public static void DateCheckAss()
        {
            string            GivenDate   = "01/01/2019";
            List <Assignment> Assignments = ListProvider.CreateListAssignments();

            // USER DATE___________________________________________________________________________________________________________________________
            try
            {
                Console.WriteLine("Input Date in this Format (DD/MM/YYYY): ");
                GivenDate = Console.ReadLine();
                DateTime DateCheck = DateTime.ParseExact(GivenDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            catch (Exception)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Your Given Date has Bad Format, Please input: (DD/MM/YYYY)");
                Console.ForegroundColor = ConsoleColor.White;
            }
            DateTime DateConv = DateTime.ParseExact(GivenDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);

            // ASSIGNMENTS DUE DATES_______________________________________________________________________________________________________________


            DateTime temDate  = new DateTime(2019, 1, 1);
            string   tempD    = temDate.ToString("dd/MM/yyyy");
            DateTime temDate0 = DateTime.ParseExact(tempD, "dd/MM/yyyy", CultureInfo.InvariantCulture);

            DateTime temDate1 = DateTime.ParseExact(Assignments[0].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime temDate2 = DateTime.ParseExact(Assignments[1].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime temDate3 = DateTime.ParseExact(Assignments[2].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime temDate4 = DateTime.ParseExact(Assignments[3].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime temDate5 = DateTime.ParseExact(Assignments[4].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime temDate6 = DateTime.ParseExact(Assignments[5].subDateTime.ToString("dd/MM/yyyy"), "dd/MM/yyyy", CultureInfo.InvariantCulture);

            if (DateConv <= temDate0)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Your Given Date is Out of the Course Dates");
                Console.ForegroundColor = ConsoleColor.White;
            }
            else if (DateConv >= temDate0 && DateConv <= temDate1)
            {
                GivenDate = Assignments[0].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else if (DateConv >= temDate1 && DateConv <= temDate2)
            {
                GivenDate = Assignments[1].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else if (DateConv >= temDate2 && DateConv <= temDate3)
            {
                GivenDate = Assignments[2].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else if (DateConv >= temDate3 && DateConv <= temDate4)
            {
                GivenDate = Assignments[3].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else if (DateConv >= temDate4 && DateConv <= temDate5)
            {
                GivenDate = Assignments[4].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else if (DateConv >= temDate5 && DateConv <= temDate6)
            {
                GivenDate = Assignments[5].subDateTime.ToString("dd/MM/yyyy");
                AssPerStudent.Submissions(GivenDate);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Your Given Date is Out of the Assignments Submission Dates");
                Console.ForegroundColor = ConsoleColor.White;
            }
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            string one       = "1";
            string two       = "2";
            string three     = "3";
            string e         = "E";
            string userInput = null;
            string a         = "A";
            string c         = "C";
            string m         = "M";
            string t         = "T";
            string s         = "S";

            while (userInput != e)
            {
                // CHOOSE ONE OF THE 3 MAJOR PATHS
                Console.WriteLine("\nChoose Action: \n(1) INPUT MODE, \n(2) READ LISTS MODE, \n(3) DATE INPUT SEARCH, \n(E) EXIT ");
                userInput = Console.ReadLine();

                // PART A >>> USER INPUT DATA PART >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

                if (userInput == one)
                {
                    while (userInput != e)
                    {
                        Console.WriteLine("\nChoose Action: \n(C) COURSE INPUT, \n(S) STUDENT INPUT, \n(T) TRAINER INPUT, \n(A) ASSIGNMENT INPUT, \n(E) EXIT ");
                        userInput = Console.ReadLine();
                        //
                        if (userInput == c)
                        {
                            UserInputCourseData.UserInput();
                        }
                        else if (userInput == s)
                        {
                            UserInputStudentData.UserInput();
                        }
                        else if (userInput == t)
                        {
                            UserInputTrainerData.UserInput();
                        }
                        else if (userInput == a)
                        {
                            UserInputAssignmentData.UserInput();
                        }
                        else if (userInput == e) // Step Back Command____________________________________________________________________________
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("EXIT");
                            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;
                        }
                    }
                }

                // PART B >>> READ PREMADE LISTS  PART >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


                else if (userInput == two)
                {
                    while (userInput != e)
                    {
                        Console.WriteLine("\nChoose Action: \n(1) Lists, \n(S) Student per Course, \n(T) Trainers per Course, \n(A) Assignments per Course, \n(C) Assignements per Student, \n(M) Students in more Courses, \n(E) EXIT");
                        userInput = Console.ReadLine();

                        if (userInput == one)
                        {
                            PART_A.Navigation(); // Simple Initial Lists Display_______________________________________________________________
                        }
                        else if (userInput == s)
                        {
                            StudPerCourse.PrintListsStudentsPerCourse();
                        }
                        else if (userInput == t)
                        {
                            TrainPerCourse.PrintListsTrainersPerCourse();
                        }
                        else if (userInput == a)
                        {
                            AssPerCourse.PrintListsAssPerCourse();
                        }
                        else if (userInput == c)
                        {
                            AssPerStudent.PrintListsAssPerStudents();
                        }
                        else if (userInput == m)
                        {
                            StudentsAtBothCourses.CourseCheck(); // Students that have more than one Courses___________________________________
                        }
                        else if (userInput == e)                 // Step Back Command__________________________________________________________________________
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                            Console.WriteLine("EXIT");
                            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;
                        }
                    }
                }

                // PART C >>> USER INPUT DATE AND CHECK PART >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


                else if (userInput == three)
                {
                    DateCheck.DateCheckAss();
                }
                else if (userInput == e) // Coplete Exit________________________________________________________________________
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("EXIT");
                    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;
                }
            }
        }