Ejemplo n.º 1
0
        static internal List <Trainer> ManuallyAssignTrainers(List <Trainer> trainers, string subject)
        {
            List <Trainer> courseTrainers = new List <Trainer>();
            bool           assigning      = true;
            List <Trainer> selections     = new List <Trainer>();

            foreach (var item in trainers)
            {
                if (item.Subject == subject)
                {
                    selections.Add(item);
                }
            }
            if (selections.Count > 0)
            {
                int i = 0;
                while (assigning)
                {
                    Console.WriteLine("Please assign a trainer for the course from the following list of available teachers:");
                    courseTrainers.Add(CommandPromtUtilities.SelectFromList(selections));
                    selections.Remove(courseTrainers[i]);
                    i++;
                    if (selections.Count > 0)
                    {
                        assigning = CommandPromtUtilities.YesOrNo("Would you like to add another trainer on the same class?");
                    }
                    else
                    {
                        assigning = false;
                    }
                }
            }
            return(courseTrainers);
        }
Ejemplo n.º 2
0
        static internal Student GetStudentDetails()
        {
            Student student = new Student();

            student.FirstName   = CommandPromtUtilities.AskDetails("First name");
            student.LastName    = CommandPromtUtilities.AskDetails("Last name");
            student.DateOfBirth = DateTime.Parse(CommandPromtUtilities.AskDetails("Date of birth"));
            student.TuitionFees = double.Parse(CommandPromtUtilities.AskDetails("Tuition fees"));
            return(student);
        }
Ejemplo n.º 3
0
        static internal Assignment GetAssignmentDetails()
        {
            Assignment assignment = new Assignment();

            assignment.Title       = CommandPromtUtilities.AskDetails("Assignment title");
            assignment.Description = CommandPromtUtilities.AskDetails("Assignment description");
            assignment.SubDateTime = DateTime.Parse(CommandPromtUtilities.AskDetails("Assignment submision date"));
            assignment.OralMark    = float.Parse(CommandPromtUtilities.AskDetails("Assignment oral mark"));
            assignment.TotalMark   = float.Parse(CommandPromtUtilities.AskDetails("Assignment total mark"));
            return(assignment);
        }
Ejemplo n.º 4
0
        static internal Trainer GetTrainerDetails()
        {
            List <string> subjects = new List <string> {
                "C#", "Java", "Python", "Javascript"
            };
            Trainer trainer = new Trainer();

            trainer.FirstName = CommandPromtUtilities.AskDetails("First name");
            trainer.LastName  = CommandPromtUtilities.AskDetails("Last name");
            trainer.Subject   = CommandPromtUtilities.AskDetails("Choose a subject from the following list", subjects);
            return(trainer);
        }
Ejemplo n.º 5
0
        static internal Course GetCourseDetails()
        {
            List <string> streams = new List <string> {
                "C#", "Java", "Javascript", "Python"
            };
            List <string> types = new List <string> {
                "Full Time", "Part Time"
            };
            Course course = new Course();
            string title  = CommandPromtUtilities.AskDetails("Course title");

            course.Stream    = CommandPromtUtilities.AskDetails("Choose the course's stream from the following list", streams);
            course.Type      = CommandPromtUtilities.AskDetails("Choose the course's type from the following list", types);
            course.Title     = title + " " + course.Type + " " + course.Stream;
            course.StartDate = DateTime.Parse(CommandPromtUtilities.AskDetails("Course start date"));
            course.EndDate   = DateTime.Parse(CommandPromtUtilities.AskDetails("Course end date"));
            return(course);
        }
Ejemplo n.º 6
0
        static internal void OutputMenu(List <Course> courses, List <Trainer> trainers, List <CourseClass> courseClasses)
        {
            int           answer;
            List <string> selections = new List <string>()
            {
                "Print a list of all the students", "Print a list of all the trainers", "Print a list of all the assignments", "Print a list of all the courses",
                "Print all the students per course", "Print all the trainers per course", "Print all the assignments per course", "Print all the assignments per student",
                "Print a list of students that belong to more than one courses",
                "Print list of students who need to submit one or more assignments on the same calendar week as the date input"
            };
            List <Assignment> allAssignents = new List <Assignment>();

            while (true)
            {
                Console.WriteLine("\nSelect an option from the following list:\n");
                answer = CommandPromtUtilities.SelectFromList(selections, true);
                switch (answer)
                {
                case 1:
                    Console.WriteLine("\n\t\t <Listing all enrolled students this semester>\n");
                    List <Student> allStudents = StudentData.MergeStudentLists(courseClasses);
                    StudentData.PrintList(allStudents);
                    break;

                case 2:
                    Console.WriteLine("\n\t\t <Listing all the school teachers>\n");
                    TrainerData.PrintList(trainers);
                    break;

                case 3:
                    Console.WriteLine("\n\t\t <Listing all the assignments of this semester>\n");
                    foreach (var item in courseClasses)
                    {
                        foreach (var item2 in item.Assignments)
                        {
                            allAssignents.Add(item2);
                        }
                    }
                    AssignmentData.PrintList(allAssignents);
                    break;

                case 4:
                    Console.WriteLine("\n\t\t<Listing all the active courses of this semester>\n");
                    CourseData.PrintList(courses);
                    break;

                case 5:
                    Console.WriteLine("\n\t\t<Listing all the students in each course>\n");
                    foreach (var item in courseClasses)
                    {
                        Console.WriteLine("\n\t\t" + item.Title);
                        StudentData.PrintList(item.Students);
                    }
                    break;

                case 6:
                    Console.WriteLine("\n\t\t<Listing all the trainers in each course>\n");
                    foreach (var item in courseClasses)
                    {
                        Console.WriteLine("\n\t\t" + item.Title);
                        TrainerData.PrintList(item.Trainers);
                    }
                    break;

                case 7:
                    Console.WriteLine("\n\t\t<Listing all the assignments in each course>\n");
                    foreach (var item in courseClasses)
                    {
                        Console.WriteLine("\n\t\t" + item.Title);
                        AssignmentData.PrintList(item.Assignments);
                    }
                    break;

                case 8:
                    Console.WriteLine("\n\t\t<Listing all the assignments each student has per course>\n");
                    foreach (var item in courseClasses)
                    {
                        Console.WriteLine("\n\t\t" + item.Title);
                        foreach (var item2 in item.Students)
                        {
                            Console.WriteLine("\n\n" + item2 + "\n\n");
                            AssignmentData.PrintList(item.Assignments);
                        }
                    }
                    break;

                case 9:
                    Console.WriteLine("\n\t\t<Listing students who have enrolled on more than one course>\n");
                    List <Student> multipleCourseStudents = StudentData.MultipleCourseStudents(courseClasses);
                    StudentData.PrintList(multipleCourseStudents);
                    break;

                case 10:
                    DateTime[]     weekToOutput           = CommandPromtUtilities.WeekToCheck();
                    List <Student> studentsWithAssignment = StudentData.GetStudentsWithAssignment(courseClasses, weekToOutput);
                    StudentData.PrintList(studentsWithAssignment);
                    break;

                default:
                    break;
                }
            }
        }