Esempio n. 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     MFAdminASPNET.Models.Player player = db.Players.Find(id);
     db.Players.Remove(player);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 // 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));
 }