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