Exemple #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     OverallPercentages overallPercentages = db.OverallPercentages.Find(id);
     db.OverallPercentages.Remove(overallPercentages);
     db.SaveChanges();
     return RedirectToAction("Index");
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ID,PlayerId,DifficultyId,MetricId,Percentage,DateAdded")] OverallPercentages overallPercentages)
 {
     if (ModelState.IsValid)
     {
         db.Entry(overallPercentages).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.PlayerId = new SelectList(db.Players, "ID", "Name", overallPercentages.PlayerId);
     return View(overallPercentages);
 }
Exemple #3
0
 public ActionResult Create([Bind(Include = "ID,PlayerId,DifficultyId,MetricId,Percentage,DateAdded")] OverallPercentages overallPercentages)
 {
     if (ModelState.IsValid)
     {
         db.OverallPercentages.Add(overallPercentages);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     
     ViewBag.PlayerId = Utilities.PlayerList(db.Players.ToList(), overallPercentages.PlayerId);
     return View(overallPercentages);
 }
Exemple #4
0
 // GET: OverallPercentages/Details/5
 public ActionResult Details(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     OverallPercentages overallPercentages = db.OverallPercentages.Include(o => o.Player).Include(s => s.Player.Spec).Include(d => d.Difficulty).Include(m => m.Metric).Where(o => o.ID == id).FirstOrDefault();
     if (overallPercentages == null)
     {
         return HttpNotFound();
     }
     return View(overallPercentages);
 }
Exemple #5
0
        // GET: OverallPercentages/Edit/5
        public ActionResult Edit(int? id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            OverallPercentages overallPercentages = db.OverallPercentages.Include(o => o.Player).Include(s => s.Player.Spec).Where(o => o.ID == id).FirstOrDefault();
            if (overallPercentages == null)
            {
                return HttpNotFound();
            }

            ViewBag.PlayerId = Utilities.PlayerList(db.Players.Include(s => s.Spec).ToList(), overallPercentages.PlayerId);
            ViewBag.DifficultyId = new SelectList(db.Difficulties, "ID", "Name");
            ViewBag.MetricId = new SelectList(db.Metrics, "ID", "Type");
            return View(overallPercentages);
        }