public ActionResult DeleteConfirmed(int id) { CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id); db.CodeingClubTBs.Remove(codeingClubTB); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,ExpDate,Type,StudentId")] CodeingClubTB codeingClubTB) { if (ModelState.IsValid) { db.Entry(codeingClubTB).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.StudentTBs, "Id", "StudentName", codeingClubTB.StudentId); return(View(codeingClubTB)); }
// GET: CodeingClub/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id); if (codeingClubTB == null) { return(HttpNotFound()); } return(View(codeingClubTB)); }
// GET: CodeingClub/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CodeingClubTB codeingClubTB = db.CodeingClubTBs.Find(id); if (codeingClubTB == null) { return(HttpNotFound()); } ViewBag.StudentId = new SelectList(db.StudentTBs, "Id", "StudentName", codeingClubTB.StudentId); return(View(codeingClubTB)); }