Example #1
0
        /// <summary>
        /// Convert StudentScheduleDAO into StudentSchedule.
        /// </summary>
        /// <param name="studentScheduleDAO">The StudentScheduleDAO to convert.</param>
        /// <returns>The StudentSchedule.</returns>
        public static StudentSchedule MapToStudentSchedule(StudentScheduleDAO studentScheduleDAO)
        {
            RegistrationData data = new RegistrationData();

            StudentSchedule studentSchedule = data.FindOrCreateStudentSchedule(studentScheduleDAO.CourseSchedule.Id, studentScheduleDAO.Student.Person.Id);

            studentSchedule.CourseSchedule   = MapToCourseSchedule(studentScheduleDAO.CourseSchedule);
            studentSchedule.CourseScheduleId = studentScheduleDAO.CourseSchedule.Id;
            studentSchedule.Student          = MapToStudent(studentScheduleDAO.Student);
            studentSchedule.StudentId        = studentScheduleDAO.Student.Person.Id;
            studentSchedule.Enrolled         = studentScheduleDAO.Enrolled;

            return(studentSchedule);
        }
Example #2
0
 /// <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)));
 }