/// <summary> /// Convert StudentDAO into Student. /// </summary> /// <param name="studentDAO">The StudentDAO to convert.</param> /// <returns>The Student.</returns> public static Student MapToStudent(StudentDAO studentDAO) { RegistrationData data = new RegistrationData(); Student student = data.FindOrCreateStudent(studentDAO.Person.Id); student.PersonId = studentDAO.Person.Id; student.MajorId = studentDAO.MajorDepartment.Id; student.Person = MapToPerson(studentDAO.Person); student.Department = MapToDepartment(studentDAO.MajorDepartment); return(student); }
/// <summary> /// Drops a Course for a Student. /// </summary> /// <param name="studentDAO">The Student to drop the Course on.</param> /// <param name="studentScheduleDAO">The Course to drop.</param> /// <returns>True if the drop was successful.</returns> public bool DropCourse(int studentId, int courseScheduleId) { return(data.DropCourse(data.FindOrCreateStudent(studentId), data.FindOrCreateStudentSchedule(studentId, courseScheduleId))); }