public ActionResult DeleteConfirmed(int id) { learningResult learningResult = db.learningResults.Find(id); db.learningResults.Remove(learningResult); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }