public ActionResult DeleteConfirmed(int id) { MFAdminASPNET.Models.Player player = db.Players.Find(id); db.Players.Remove(player); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PlayerId,PlayerName")] MFAdminASPNET.Models.Player player) { if (ModelState.IsValid) { db.Entry(player).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(player)); }
public ActionResult Create([Bind(Include = "PlayerId,PlayerName")] MFAdminASPNET.Models.Player player) { if (ModelState.IsValid) { db.Players.Add(player); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(player)); }
// GET: Players/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MFAdminASPNET.Models.Player player = db.Players.Find(id); if (player == null) { return(HttpNotFound()); } return(View(player)); }