public ActionResult DeleteConfirmed(int id) { GMRating gMRating = db.GMRatings.Find(id); db.GMRatings.Remove(gMRating); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(string id) { var GMRating = new GMRating { GMID = id, PlayerID = User.Identity.GetUserId(), }; ViewBag.GM = db.GMs.Find(id); return(View(GMRating)); }
public ActionResult Edit([Bind(Include = "RatingID,GMID,PlayerID,Comment,Rating,RatingTime")] GMRating gMRating) { if (ModelState.IsValid) { db.Entry(gMRating).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GMID = new SelectList(db.GMs, "GMID", "Username", gMRating.GMID); ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "Username", gMRating.PlayerID); return(View(gMRating)); }
public ActionResult Create(GMRating gMRating) { if (ModelState.IsValid) { gMRating.RatingTime = DateTime.Now; db.GMRatings.Add(gMRating); db.SaveChanges(); return(RedirectToAction("Details", "GMs", new { id = gMRating.GMID })); } ViewBag.GM = db.GMs.Find(gMRating.GMID); return(View(gMRating)); }
// GET: GMRatings/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GMRating gMRating = db.GMRatings.Find(id); if (gMRating == null) { return(HttpNotFound()); } return(View(gMRating)); }
// GET: GMRatings/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GMRating gMRating = db.GMRatings.Find(id); if (gMRating == null) { return(HttpNotFound()); } ViewBag.GMID = new SelectList(db.GMs, "GMID", "Username", gMRating.GMID); ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "Username", gMRating.PlayerID); return(View(gMRating)); }