private bool changeStudentCourseList(StudentCourseList scl, EntityState state) { var entry = db.Entry <StudentCourseList>(scl); entry.State = state; return(db.SaveChanges() < 0); }
public bool registerCourse(Student student, Course course) { var register = new StudentCourseList(); register.studentID = student.studentID; register.courseID = course.courseID; register.active = true; return(insertStudentCourseList(register)); }
public StudentCourseList MapToStudentCourseList(StudentCourseListDAO studentCourseList) { var scl = new StudentCourseList(); scl.courseID = studentCourseList.courseID; scl.StudentCourseID = studentCourseList.StudentCourseID; scl.studentID = studentCourseList.studentID; scl.active = studentCourseList.active; return(scl); }
public StudentCourseListDAO MapToStudentCourseListDAO(StudentCourseList studentCourseList) { var scl = new StudentCourseListDAO(); scl.Course = new CourseMapper().MapToCourseDAO(studentCourseList.Course); scl.courseID = studentCourseList.courseID; scl.Student = new StudentMapper().MapToStudentDAO(studentCourseList.Student); scl.StudentCourseID = studentCourseList.StudentCourseID; scl.studentID = studentCourseList.studentID; scl.Course = new CourseMapper().MapToCourseDAO(studentCourseList.Course); scl.active = studentCourseList.active; return(scl); }
public bool deleteStudentCourseList(StudentCourseList scl) { scl.active = false; return(changeStudentCourseList(scl, EntityState.Modified)); }
public bool updateStudentCourseList(StudentCourseList scl) { return(changeStudentCourseList(scl, EntityState.Modified)); }
public bool insertStudentCourseList(StudentCourseList scl) { db.StudentCourseLists.Add(scl); return(db.SaveChanges() > 0); }