public ActionResult DeleteConfirmed(int id) { Nemesi nemesi = db.Nemesis.Find(id); db.Nemesis.Remove(nemesi); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "NemisisID,NemisisName,NemesisInJail,NumberOfHenchman,HeroID")] Nemesi nemesi) { if (ModelState.IsValid) { db.Entry(nemesi).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "HeroName", nemesi.HeroID); return(View(nemesi)); }
public ActionResult Create([Bind(Include = "NemesisID,NemesisName,InJail,NumberOfHenchmen,HeroID")] Nemesi nemesi) { if (ModelState.IsValid) { db.Nemesis.Add(nemesi); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "SecretIdentity", nemesi.HeroID); return(View(nemesi)); }
// GET: Nemesis/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Nemesi nemesi = db.Nemesis.Find(id); if (nemesi == null) { return(HttpNotFound()); } return(View(nemesi)); }
// GET: Nemesis/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Nemesi nemesi = db.Nemesis.Find(id); if (nemesi == null) { return(HttpNotFound()); } ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "HeroName", nemesi.HeroID); return(View(nemesi)); }