예제 #1
0
        private bool changeStudentCourseList(StudentCourseList scl, EntityState state)
        {
            var entry = db.Entry <StudentCourseList>(scl);

            entry.State = state;
            return(db.SaveChanges() < 0);
        }
예제 #2
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));
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public bool deleteStudentCourseList(StudentCourseList scl)
 {
     scl.active = false;
     return(changeStudentCourseList(scl, EntityState.Modified));
 }
예제 #6
0
 public bool updateStudentCourseList(StudentCourseList scl)
 {
     return(changeStudentCourseList(scl, EntityState.Modified));
 }
예제 #7
0
 public bool insertStudentCourseList(StudentCourseList scl)
 {
     db.StudentCourseLists.Add(scl);
     return(db.SaveChanges() > 0);
 }