public ActionResult Edit(CatalogModel catalogmodel) { if (ModelState.IsValid) { db.Entry(catalogmodel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(catalogmodel)); }
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 = "id,name")] Catalog catalog) { if (ModelState.IsValid) { db.Entry(catalog).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(catalog)); }
public ActionResult Edit([Bind(Include = "ID,LastName,FirstMidName,EnrollmentDate")] Student student) { if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Edit([Bind(Include = "EnrollmentID,CourseID,StudentID,Grade")] 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, "ID", "LastName", enrollment.StudentID); return(View(enrollment)); }
public bool Update(Category item) { try { context.Entry(item).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public void UpdateCatalogItem(CatalogItem catalogItem) { db.Entry(catalogItem).State = EntityState.Modified; db.SaveChanges(); }
public void Update(T item) { context.Entry(item).State = EntityState.Modified; }