public ActionResult Edit([Bind(Include = "Id,TeacherId,JoinDate")] CodingClubAdvTB codingClubAdvTB) { if (ModelState.IsValid) { db.Entry(codingClubAdvTB).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TeacherId = new SelectList(db.TeacherTBs, "Id", "TeacherName", codingClubAdvTB.TeacherId); return(View(codingClubAdvTB)); }
public ActionResult Edit([Bind(Include = "Id,StudentId,ExpDate,Type")] NetworkingClubTB networkingClubTB) { if (ModelState.IsValid) { db.Entry(networkingClubTB).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.StudentTBs, "Id", "StudentName", networkingClubTB.StudentId); return(View(networkingClubTB)); }