示例#1
0
 public static void deleteCourse(Course course)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(course).State = EntityState.Deleted;
     db.Courses.Remove(course);
     db.SaveChanges();
 }
示例#2
0
 public static void createSection(Section section)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(section).State = EntityState.Added;
     db.Sections.Add(section);
     db.SaveChanges();
 }
示例#3
0
 public static void deleteSection(Section section)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(section).State = EntityState.Deleted;
     db.Sections.Remove(section);
     db.SaveChanges();
 }
示例#4
0
 public static void createCourse(Course course)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(course).State = EntityState.Added;
     db.Courses.Add(course);
     db.SaveChanges();
 }
示例#5
0
 public static void editSection(Section section)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(section).State = EntityState.Modified;
     db.SaveChanges();
 }
示例#6
0
 public static void editCourse(Course course)
 {
     BasicSchoolDbContext db = new BasicSchoolDbContext();
     db.Entry(course).State = EntityState.Modified;
     db.SaveChanges();
 }