public void addenrollment(enrollment u) { tema2psEntities entities = new tema2psEntities(); entities.enrollments.Add(u); entities.SaveChanges(); }
public enrollment getenrollmentbyID(int id) { tema2psEntities entities = new tema2psEntities(); enrollment u = new enrollment(); foreach (enrollment uDB in entities.enrollments) { if (uDB.id == id) { u = uDB; } } return(u); }
public void updateenrollment(enrollment u) { tema2psEntities entities = new tema2psEntities(); foreach (enrollment uDB in entities.enrollments) { if (uDB.id == u.id) { uDB.userID = u.userID; uDB.courseID = u.courseID; uDB.grade = u.grade; } } entities.SaveChanges(); }