public ActionResult DeleteConfirmed(int id) { allowedTime allowedTime = db.allowedTimes.Find(id); db.allowedTimes.Remove(allowedTime); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,time,playerId")] allowedTime allowedTime) { if (ModelState.IsValid) { db.Entry(allowedTime).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.playerId = new SelectList(db.players, "playerId", "Username", allowedTime.playerId); return(View(allowedTime)); }
public ActionResult Create([Bind(Include = "id,time,playerId")] allowedTime allowedTime) { if (ModelState.IsValid) { db.allowedTimes.Add(allowedTime); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.playerId = new SelectList(db.players, "playerId", "Username", allowedTime.playerId); return(View(allowedTime)); }
// GET: allowedTimes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } allowedTime allowedTime = db.allowedTimes.Find(id); if (allowedTime == null) { return(HttpNotFound()); } return(View(allowedTime)); }
// GET: allowedTimes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } allowedTime allowedTime = db.allowedTimes.Find(id); if (allowedTime == null) { return(HttpNotFound()); } ViewBag.playerId = new SelectList(db.players, "playerId", "Username", allowedTime.playerId); return(View(allowedTime)); }