public static void SeedTrainersPerCourse()
        {
            TrainerPerCourse t1 = new TrainerPerCourse();
            TrainerPerCourse t2 = new TrainerPerCourse();

            t1.course.Title      = "CB7";
            t1.course.Stream     = "Full time";
            t1.course.Type       = "Java";
            t1.course.Start_Date = Convert.ToDateTime("1/1/2017");
            t1.course.End_Date   = Convert.ToDateTime("1/4/2017");
            CommonTools.AddToAList(CourseList, t1.course);
            Trainer tr1 = new Trainer();

            tr1.FirstName = "Mixalis";
            tr1.LastName  = "Gkiokos";
            tr1.Subject   = "Java";
            Trainer tr2 = new Trainer();

            tr2.FirstName = "Mirella";
            tr2.LastName  = "Bertou";
            tr2.Subject   = "SQL";
            CommonTools.AddToAList(Trainers, tr1);
            CommonTools.AddToAList(Trainers, tr2);
            CommonTools.AddToAList(t1.TrainersPerCourse, tr1);
            CommonTools.AddToAList(t1.TrainersPerCourse, tr2);
            CommonTools.AddToAList(TrainersPerCourse, t1);


            t2.course.Title      = "CB7";
            t2.course.Stream     = "Part time";
            t2.course.Type       = "Java";
            t2.course.Start_Date = Convert.ToDateTime("1/1/2017");
            t2.course.End_Date   = Convert.ToDateTime("1/6/2017");
            CommonTools.AddToAList(CourseList, t2.course);

            Trainer tr3 = new Trainer();

            tr3.FirstName = "Vasilis";
            tr3.LastName  = "Regkinas";
            tr3.Subject   = "CSS";
            Trainer tr4 = new Trainer();

            tr4.FirstName = "Sofia";
            tr4.LastName  = "Kontou";
            tr4.Subject   = "JavaScript";
            CommonTools.AddToAList(Trainers, tr3);
            CommonTools.AddToAList(Trainers, tr4);
            CommonTools.AddToAList(t2.TrainersPerCourse, tr3);
            CommonTools.AddToAList(t2.TrainersPerCourse, tr4);
            CommonTools.AddToAList(TrainersPerCourse, t2);
        }
Ejemplo n.º 2
0
        public static TrainerPerCourse CreateTrainerPerCourse(List <Course> courses)
        {
            TrainerPerCourse trainerPerCourse = new TrainerPerCourse();

            trainerPerCourse.course = CreateCourse();
            AddToAList(ListDatabase.AllCourses, trainerPerCourse.course);
            string x = "";

            do
            {
                trainerPerCourse.TrainersPerCourse.Add(CreateTrainer());
                Console.Write("Press anything to add another trainer or 'e'/'E' to exit: ");
                x = Console.ReadLine().ToLower();
            } while (x != "e");
            foreach (var item in trainerPerCourse.TrainersPerCourse)
            {
                ListDatabase.AllTrainers.Add(item);
            }
            return(trainerPerCourse);
        }