public void FillInSusiInfo(Student student, StudentInfo studentInfo, IEnumerable<CourseInfo> courseInfo) { // TODO: edit when SUSI API is available student.FirstName = studentInfo.FirstName; student.LastName = studentInfo.LastName; student.Email = "*****@*****.**"; Tuple<int, int> startEndYears = studentInfo.GetStartEndYear(); Bachelor bachelor = new Bachelor { StartYear = startEndYears.Item1, EndYear = startEndYears.Item2, Specialty = StudentManager.programmeMapping[studentInfo.Programme], Subjects = courseInfo.Select(x => x.ToSubject()).ToList(), }; FMIEdu fmiEdu = new FMIEdu { Bachelor = bachelor, }; student.FMIInfo = fmiEdu; db.SaveChanges(); }
public void FillInSusiInfo(Student student, StudentInfo studentInfo, IEnumerable<CourseInfo> courseInfo) { student.FirstName = studentInfo.FirstName; student.LastName = studentInfo.LastName; Tuple<int, int> startEndYears = studentInfo.GetStartEndYear(); Bachelor bachelor = new Bachelor { StartYear = startEndYears.Item1, EndYear = startEndYears.Item2, CurrentCourse = studentInfo.Year, Specialty = StudentManager.programmeMapping[studentInfo.Programme], Subjects = courseInfo.Select(x => x.ToSubject()).ToList(), CurrentAverageGrade = courseInfo.Average(x => x.Grade) }; FMIEdu fmiEdu = new FMIEdu { Bachelor = bachelor, }; student.FMIInfo = fmiEdu; db.SaveChanges(); }