public ActionResult DeleteConfirmed(int id) { Aristocrat aristocrat = db.Aristocrats.Find(id); db.Aristocrats.Remove(aristocrat); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Points,RequireGreen,RequireWhite,RequireBlue,RequireBlack,RequireRed,ImagePath")] Aristocrat aristocrat) { if (ModelState.IsValid) { db.Entry(aristocrat).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aristocrat)); }
public ActionResult Create([Bind(Include = "Id,Points,RequireGreen,RequireWhite,RequireBlue,RequireBlack,RequireRed,ImagePath")] Aristocrat aristocrat) { if (ModelState.IsValid) { db.Aristocrats.Add(aristocrat); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aristocrat)); }
// GET: Aristocrats/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Aristocrat aristocrat = db.Aristocrats.Find(id); if (aristocrat == null) { return(HttpNotFound()); } return(View(aristocrat)); }