//Seeding public static void SeedSimpleStudents() { Student s1 = new Student(); s1.FirstName = "Kostas"; s1.LastName = "Vasileiou"; s1.DateOfBirth = new DateTime(1990, 6, 17); s1.TuitionFees = 2500; Student s2 = new Student(); s2.FirstName = "Maria"; s2.LastName = "Gerantoni"; s2.DateOfBirth = new DateTime(1994, 6, 23); s2.TuitionFees = 2500; CommonTools.AddToAList(Students, s1); CommonTools.AddToAList(Students, s2); }
public static void SeedSimpleCourses() { Course course1 = new Course(); Course course2 = new Course(); course1.Title = "CB3"; course1.Stream = "Full time"; course1.Type = "C#"; course1.Start_Date = Convert.ToDateTime("1/1/2016"); course1.End_Date = Convert.ToDateTime("1/4/2016"); course2.Title = "CB3"; course2.Stream = "Part time"; course2.Type = "C#"; course2.Start_Date = Convert.ToDateTime("1/1/2016"); course2.End_Date = Convert.ToDateTime("1/7/2016"); CommonTools.AddToAList(CourseList, course1); CommonTools.AddToAList(CourseList, course2); }
public static void SeedSimpleTrainers() { Trainer tr1 = new Trainer() { FirstName = "Petros", LastName = "Eystathiou", Subject = "C#" }; Trainer tr2 = new Trainer() { FirstName = "Ioannis", LastName = "Zaxarias", Subject = "Javascript" }; CommonTools.AddToAList(Trainers, tr1); CommonTools.AddToAList(Trainers, tr2); }
public static void SeedSimpleAssignments() { Assignment as1 = new Assignment() { Title = "Count the number of Duplicates", Description = "Write a function to find duplicate items in a list",//50 chars SubDateTime = new DateTime(2019, 7, 10), OralMark = 50, TotalMark = 50 }; Assignment as2 = new Assignment() { Title = "Bubble Sort", Description = "Create a function that sorts with Bubble Sort way.", SubDateTime = new DateTime(2019, 7, 20), OralMark = 50, TotalMark = 50 }; CommonTools.AddToAList(Assignments, as1); CommonTools.AddToAList(Assignments, as2); }
static void Main(string[] args) { Synthetic_Data.SeedDb(); CommonTools.Start(); }
public void DisplayAssignment() { Console.WriteLine($"{CommonTools.CutString(Title, 15),-15} | {SubDateTime.ToString("dd/MM/yyyy"),-11} | {OralMark,-11} | {TotalMark,-12}| {CommonTools.CutString(Description, 55),-55} |"); }
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); }
public static void SeedAssignmentsPerCourse() { AssignmentPerCourse a1 = new AssignmentPerCourse(); AssignmentPerCourse a2 = new AssignmentPerCourse(); a1.course.Title = "CB9"; a1.course.Stream = "Full time"; a1.course.Type = "Python"; a1.course.Start_Date = Convert.ToDateTime("1/3/2020"); a1.course.End_Date = Convert.ToDateTime("1/6/2020"); CommonTools.AddToAList(CourseList, a1.course); Assignment as1 = new Assignment() { Title = "Leap Years", Description = "You should determine, whether a given year is a leap year or not.", SubDateTime = new DateTime(2019, 6, 21), OralMark = 50, TotalMark = 50 }; Assignment as2 = new Assignment() { Title = "Cut String", Description = "Write a function that cuts a string to the length the user desires.", SubDateTime = new DateTime(2019, 7, 20), OralMark = 50, TotalMark = 50 }; CommonTools.AddToAList(a1.AssignmentsPerCourse, as1); CommonTools.AddToAList(a1.AssignmentsPerCourse, as2); CommonTools.AddToAList(Assignments, as1); CommonTools.AddToAList(Assignments, as2); a2.course.Title = "CB9"; a2.course.Stream = "Part time"; a2.course.Type = "Python"; a2.course.Start_Date = Convert.ToDateTime("1/3/2020"); a2.course.End_Date = Convert.ToDateTime("1/9/2020"); CommonTools.AddToAList(CourseList, a2.course); Assignment as3 = new Assignment() { Title = "Valid Phone Number", Description = "Write a function that accepts a string, and returns true if it is in the form of a phone number. ", SubDateTime = new DateTime(2019, 7, 10), OralMark = 50, TotalMark = 50 }; Assignment as4 = new Assignment() { Title = "Find the capital ", Description = "Write function that finds capital letters in a string.", SubDateTime = new DateTime(2019, 7, 20), OralMark = 50, TotalMark = 50 }; CommonTools.AddToAList(a2.AssignmentsPerCourse, as3); CommonTools.AddToAList(a2.AssignmentsPerCourse, as4); CommonTools.AddToAList(Assignments, as3); CommonTools.AddToAList(Assignments, as4); CommonTools.AddToAList(AssignmentsPerCourse, a1); CommonTools.AddToAList(AssignmentsPerCourse, a2); }
public void DisplayTrainer() { Console.WriteLine($"{ CommonTools.CutString(FirstName, 13),-13} {CommonTools.CutString(LastName, 13),-14} | {CommonTools.CutString(Subject, 13),-13} |"); }
public void DisplayCourse() { Console.WriteLine($"{ CommonTools.CutString(Title, 13),-13} | {CommonTools.CutString(Stream, 13),-14} | {CommonTools.CutString(Type, 13),-13} | {Start_Date.ToString("dd/MM/yyyy"),10} | {End_Date.ToString("dd/MM/yyyy"),10} |"); }
public void DisplayStudent() { Console.WriteLine($"{ CommonTools.CutString(FirstName,13), -13} {CommonTools.CutString(LastName, 14), -14} | {DateOfBirth.ToString("dd/MM/yyyy"),-13} | {TuitionFees, -15}|"); }