public ActionResult DeleteConfirmed(int id) { ClubEvents clubEvents = db.clubEvents.Find(id); db.clubEvents.Remove(clubEvents); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,PointKey,PointValue,EventCount,ClubId,Date")] ClubEvents clubEvents) { if (ModelState.IsValid) { db.Entry(clubEvents).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClubId = new SelectList(db.clubs, "Id", "Name", clubEvents.ClubId); return(View(clubEvents)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClubEvents clubEvents = db.clubEvents.Find(id); if (clubEvents == null) { return(HttpNotFound()); } return(View(clubEvents)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClubEvents clubEvents = db.clubEvents.Find(id); if (clubEvents == null) { return(HttpNotFound()); } ViewBag.ClubId = new SelectList(db.clubs, "Id", "Name", clubEvents.ClubId); return(View(clubEvents)); }