Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            GMRating gMRating = db.GMRatings.Find(id);

            db.GMRatings.Remove(gMRating);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult Create(string id)
        {
            var GMRating = new GMRating
            {
                GMID     = id,
                PlayerID = User.Identity.GetUserId(),
            };

            ViewBag.GM = db.GMs.Find(id);
            return(View(GMRating));
        }
Exemple #3
0
 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));
 }
Exemple #4
0
        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));
        }
Exemple #5
0
        // 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));
        }
Exemple #6
0
        // 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));
        }