public static void SeedStudentsPerCourse()
        {
            StudentPerCourse spc1 = new StudentPerCourse();
            StudentPerCourse spc2 = new StudentPerCourse();

            spc1.course.Title      = "CB8";
            spc1.course.Stream     = "Full time";
            spc1.course.Type       = "Ruby on Rails";
            spc1.course.Start_Date = Convert.ToDateTime("1/6/2018");
            spc1.course.End_Date   = Convert.ToDateTime("1/9/2018");
            CommonTools.AddToAList(CourseList, spc1.course);
            Student s1 = new Student();

            s1.FirstName   = "Loukas";
            s1.LastName    = "Mantas";
            s1.DateOfBirth = new DateTime(1989, 6, 3);
            s1.TuitionFees = 0;
            Student s2 = new Student();

            s2.FirstName   = "Aleka";
            s2.LastName    = "Verginou";
            s2.DateOfBirth = new DateTime(1994, 1, 12);
            s2.TuitionFees = 2500;
            CommonTools.AddToAList(Students, s1);
            CommonTools.AddToAList(Students, s2);
            CommonTools.AddToAList(spc1.StudentsPerCourse, s1);
            CommonTools.AddToAList(spc1.StudentsPerCourse, s2);


            spc2.course.Title      = "CB8";
            spc2.course.Stream     = "Part Time";
            spc2.course.Type       = "Ruby on Rails";
            spc2.course.Start_Date = Convert.ToDateTime("1/6/2018");
            spc2.course.End_Date   = Convert.ToDateTime("1/12/2018");
            CommonTools.AddToAList(CourseList, spc2.course);
            Student s3 = new Student();

            s3.FirstName   = "Stelios";
            s3.LastName    = "Touloumis";
            s3.DateOfBirth = new DateTime(1989, 7, 3);
            s3.TuitionFees = 0;
            Student s4 = new Student();

            s4.FirstName   = "Giota";
            s4.LastName    = "Ntourma";
            s4.DateOfBirth = new DateTime(1994, 12, 12);
            s4.TuitionFees = 2500;
            CommonTools.AddToAList(Students, s3);
            CommonTools.AddToAList(Students, s4);
            CommonTools.AddToAList(spc2.StudentsPerCourse, s3);
            CommonTools.AddToAList(spc2.StudentsPerCourse, s4);
            CommonTools.AddToAList(StudentsPerCourse, spc1);
            CommonTools.AddToAList(StudentsPerCourse, spc2);
        }
Ejemplo n.º 2
0
        public static StudentPerCourse CreateStudentPerCourse(List <Course> courses)
        {
            Console.Clear();
            StudentPerCourse studentPerCourse = new StudentPerCourse();

            studentPerCourse.course = CreateCourse();
            ListDatabase.AllCourses.Add(studentPerCourse.course);
            string x = "";

            do
            {
                studentPerCourse.StudentsPerCourse.Add(CreateStudent());
                Console.Write("Press anything to add another student or 'e'/'E' to exit: ");
                x = Console.ReadLine();
            } while (x != "e");
            foreach (var item in studentPerCourse.StudentsPerCourse)
            {
                ListDatabase.AllStudents.Add(item);
            }
            return(studentPerCourse);
        }
        public static void SeedStudentsAssignments()
        {
            StudentAssignments spapc1 = new StudentAssignments();

            spapc1.Student.FirstName   = "Kostas";
            spapc1.Student.LastName    = "Grodis";
            spapc1.Student.DateOfBirth = new DateTime(1990, 04, 15);
            spapc1.Student.TuitionFees = 2500;
            CommonTools.AddToAList(Students, spapc1.Student);

            AssignmentPerCourse aspc1 = new AssignmentPerCourse();

            aspc1.course.Title      = "CB15";
            aspc1.course.Stream     = "Full time";
            aspc1.course.Type       = "C#";
            aspc1.course.Start_Date = new DateTime(2022, 06, 01);
            aspc1.course.End_Date   = new DateTime(2022, 09, 01);
            CommonTools.AddToAList(CourseList, aspc1.course);

            StudentPerCourse stpc1 = new StudentPerCourse();

            stpc1.course = aspc1.course;
            stpc1.StudentsPerCourse.Add(spapc1.Student);
            CommonTools.AddToAList(StudentsPerCourse, stpc1);

            Assignment a1 = new Assignment();

            a1.Title       = "Area of Triangle";
            a1.Description = "Calculate the area of a triangle";
            a1.SubDateTime = new DateTime(2019, 06, 20);
            a1.OralMark    = 50;
            a1.TotalMark   = 50;

            Assignment a2 = new Assignment();

            a2.Title       = "Area of Square";
            a2.Description = "Calculate the area of a square";
            a2.SubDateTime = new DateTime(2019, 06, 19);
            a2.OralMark    = 50;
            a2.TotalMark   = 50;

            CommonTools.AddToAList(Assignments, a1);
            CommonTools.AddToAList(Assignments, a2);
            CommonTools.AddToAList(aspc1.AssignmentsPerCourse, a1);
            CommonTools.AddToAList(aspc1.AssignmentsPerCourse, a2);
            CommonTools.AddToAList(AssignmentsPerCourse, aspc1);


            CommonTools.AddToAList(spapc1.AssignmentPerCourseList, aspc1);

            AssignmentPerCourse aspc2 = new AssignmentPerCourse();

            aspc2.course.Title      = "CB15";
            aspc2.course.Stream     = "Part time";
            aspc2.course.Type       = "C#";
            aspc2.course.Start_Date = new DateTime(2022, 06, 01);
            aspc2.course.End_Date   = new DateTime(2022, 12, 01);
            CommonTools.AddToAList(CourseList, aspc2.course);

            StudentPerCourse studpc = new StudentPerCourse();

            studpc.course = aspc2.course;
            studpc.StudentsPerCourse.Add(spapc1.Student);
            CommonTools.AddToAList(StudentsPerCourse, studpc);

            Assignment a3 = new Assignment();

            a3.Title       = "Sum three strings";
            a3.Description = "Write function to sum three strings";
            a3.SubDateTime = new DateTime(2019, 06, 21);
            a3.OralMark    = 50;
            a3.TotalMark   = 50;

            Assignment a4 = new Assignment();

            a4.Title       = "Website";
            a4.Description = "Create a static web page";
            a4.SubDateTime = new DateTime(2019, 06, 17);
            a4.OralMark    = 50;
            a4.TotalMark   = 50;

            CommonTools.AddToAList(Assignments, a3);
            CommonTools.AddToAList(Assignments, a4);
            CommonTools.AddToAList(aspc2.AssignmentsPerCourse, a3);
            CommonTools.AddToAList(aspc2.AssignmentsPerCourse, a4);
            CommonTools.AddToAList(AssignmentsPerCourse, aspc2);

            CommonTools.AddToAList(spapc1.AssignmentPerCourseList, aspc2);
            CommonTools.AddToAList(StudentAssignments, spapc1);


            StudentAssignments spapc2 = new StudentAssignments();

            spapc2.Student.FirstName   = "Mary";
            spapc2.Student.LastName    = "Ioannou";
            spapc2.Student.DateOfBirth = new DateTime(1993, 11, 30);
            spapc2.Student.TuitionFees = 2500;
            CommonTools.AddToAList(Students, spapc2.Student);

            spapc2.AssignmentPerCourseList.Add(AssignmentsPerCourse[0]);
            spapc2.AssignmentPerCourseList.Add(AssignmentsPerCourse[1]);

            StudentPerCourse stpc2 = new StudentPerCourse();

            stpc2.course = spapc2.AssignmentPerCourseList[0].course;
            stpc2.StudentsPerCourse.Add(spapc2.Student);
            StudentPerCourse stpc3 = new StudentPerCourse();

            stpc3.course = spapc2.AssignmentPerCourseList[1].course;
            stpc3.StudentsPerCourse.Add(spapc2.Student);

            CommonTools.AddToAList(StudentsPerCourse, stpc2);
            CommonTools.AddToAList(StudentsPerCourse, stpc3);



            CommonTools.AddToAList(StudentAssignments, spapc2);
        }