public ActionResult Edit(Student student, int CourseId) { if (CourseId != 0) { _db.Enrollment.Add(new Enrollment() { CourseId = CourseId, StudentId = student.StudentId }); } _db.Entry(student).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Course course) { _db.Entry(course).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Department department) { _db.Entry(department).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }