public ActionResult DeleteConfirmed(int id) { ChallengeDayExersice challengeDayExersice = db.ChallengeDayExersices.Find(id); db.ChallengeDayExersices.Remove(challengeDayExersice); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,DayID,ChallengeID,ExersiceID,Repeats,RepeatType")] ChallengeDayExersice challengeDayExersice) { if (ModelState.IsValid) { db.Entry(challengeDayExersice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ChallengeID = new SelectList(db.Challenges, "ID", "ChallengeTitle", challengeDayExersice.ChallengeID); ViewBag.ExersiceID = new SelectList(db.Exercises, "ID", "ExerciseName", challengeDayExersice.ExersiceID); ViewBag.RepeatType = new SelectList(db.RepeatTypes, "ID", "RepeatType1", challengeDayExersice.RepeatType); return(View(challengeDayExersice)); }
// GET: ChallengeExersices/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChallengeDayExersice challengeDayExersice = db.ChallengeDayExersices.Find(id); if (challengeDayExersice == null) { return(HttpNotFound()); } return(View(challengeDayExersice)); }
// GET: ChallengeExersices/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChallengeDayExersice challengeDayExersice = db.ChallengeDayExersices.Find(id); if (challengeDayExersice == null) { return(HttpNotFound()); } ViewBag.ChallengeID = new SelectList(db.Challenges, "ID", "ChallengeTitle", challengeDayExersice.ChallengeID); ViewBag.ExersiceID = new SelectList(db.Exercises, "ID", "ExerciseName", challengeDayExersice.ExersiceID); ViewBag.RepeatType = new SelectList(db.RepeatTypes, "ID", "RepeatType1", challengeDayExersice.RepeatType); return(View(challengeDayExersice)); }