Beispiel #1
0
        public static Trainers_Course CourseTrainers(List <Course> courses, List <Trainer> trainers)
        {
            Console.WriteLine("Continue with trainers and courses.");
            Console.WriteLine("Choose a course from the list below by typing it's number");
            CourseTitles(courses);
            Console.WriteLine();
            Console.Write("Enter the number of the course: ");
            Course courseselected = courses[Convert.ToInt32(Console.ReadLine()) - 1];

            Console.WriteLine();
            Console.WriteLine("Choose trainers from the list below by typing it's number");
            TrainerTitles(trainers);
            Console.WriteLine();
            Console.Write("Enter the number of the trainer/trainers with a comma (,) between: ");
            string Choice = Console.ReadLine();

            Choice = Choice.Replace(",", "");
            int[] Choices = new int[Choice.Length];

            for (int i = 0; i < Choice.Length; i++)
            {
                Choices[i] = Convert.ToInt32(Choice[i] - '0');
            }


            List <Trainer> listoftrainers_Chosen = new List <Trainer>();

            foreach (var item in Choices)
            {
                listoftrainers_Chosen.Add(trainers[item - 1]);
            }

            Trainers_Course TC1 = new Trainers_Course(listoftrainers_Chosen, courseselected);

            return(TC1);
        }
Beispiel #2
0
        public List <Trainers_Course> DatabaseTrainersCourse(List <Trainer> trainers, List <Course> courses)
        {
            List <Trainer> TrainersListC = new List <Trainer>();

            TrainersListC.Add(trainers[0]); TrainersListC.Add(trainers[1]);
            List <Trainer> TrainersListJ = new List <Trainer>();

            TrainersListJ.Add(trainers[2]); TrainersListJ.Add(trainers[3]);
            List <Trainer> TrainersListP = new List <Trainer>();

            TrainersListP.Add(trainers[4]);

            Trainers_Course        TC1 = new Trainers_Course(TrainersListC, courses[0]);
            Trainers_Course        TC2 = new Trainers_Course(TrainersListC, courses[1]);
            Trainers_Course        TC3 = new Trainers_Course(TrainersListJ, courses[2]);
            Trainers_Course        TC4 = new Trainers_Course(TrainersListJ, courses[3]);
            Trainers_Course        TC5 = new Trainers_Course(TrainersListP, courses[4]);
            List <Trainers_Course> listoftrainers_courses = new List <Trainers_Course>();

            listoftrainers_courses.Add(TC1); listoftrainers_courses.Add(TC2); listoftrainers_courses.Add(TC3);
            listoftrainers_courses.Add(TC4); listoftrainers_courses.Add(TC5);

            return(listoftrainers_courses);
        }