Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            learningResult learningResult = db.learningResults.Find(id);

            db.learningResults.Remove(learningResult);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "id_learningResult,Code,Description,id_Competition")] learningResult learningResult)
 {
     if (ModelState.IsValid)
     {
         db.Entry(learningResult).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_Competition = new SelectList(db.Competitions, "id_Competition", "Code", learningResult.id_Competition);
     return(View(learningResult));
 }
Example #3
0
        // GET: learningResults/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            learningResult learningResult = db.learningResults.Find(id);

            if (learningResult == null)
            {
                return(HttpNotFound());
            }
            var list = db.Competitions.ToList();

            list = list.OrderBy(co => co.FullCompetition).ToList();
            return(View(learningResult));
        }
Example #4
0
        // GET: learningResults/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            learningResult learningResult = db.learningResults.Find(id);

            if (learningResult == null)
            {
                return(HttpNotFound());
            }
            var list = db.Competitions.ToList();

            list = list.OrderBy(co => co.FullCompetition).ToList();
            ViewBag.id_Competition = new SelectList(db.Competitions, "id_Competition", "FullCompetition");
            return(View(learningResult));
        }