public ActionResult Edit([Bind(Include = "TeacherId,Name")] Teacher teacher) { if (ModelState.IsValid) { db.Entry(teacher).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(teacher)); }
public ActionResult Edit([Bind(Include = "StudentID,LastName,FirstName,EnrollmentDate,Phone")] Student student) { if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Edit([Bind(Include = "CustomerID,FirstName,LastName,Phone")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "CourseID,Title,Credits")] Course course) { if (ModelState.IsValid) { db.Entry(course).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(course)); }
public ActionResult Edit([Bind(Include = "EnrollmentID,Grade,CourseID,StudentID")] Enrollment enrollment) { if (ModelState.IsValid) { db.Entry(enrollment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "Title", enrollment.CourseID); ViewBag.StudentID = new SelectList(db.Students, "StudentID", "LastName", enrollment.StudentID); return(View(enrollment)); }