public ActionResult DeleteConfirmed(int id) { AssignedImage assignedImage = db.AssignedImages.Find(id); db.AssignedImages.Remove(assignedImage); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AssignedImageID,ExerciseInstructionID,ExerciseImageID")] AssignedImage assignedImage) { if (ModelState.IsValid) { db.Entry(assignedImage).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ExerciseImageID = new SelectList(db.ExerciseImages, "ExerciseImageID", "ImageURL", assignedImage.ExerciseImageID); ViewBag.ExerciseInstructionID = new SelectList(db.ExerciseInstructions, "ExerciseInstructionID", "Remark", assignedImage.ExerciseInstructionID); return(View(assignedImage)); }
// GET: AssignedImages/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssignedImage assignedImage = db.AssignedImages.Find(id); if (assignedImage == null) { return(HttpNotFound()); } return(View(assignedImage)); }
// GET: AssignedImages/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssignedImage assignedImage = db.AssignedImages.Find(id); if (assignedImage == null) { return(HttpNotFound()); } ViewBag.ExerciseImageID = new SelectList(db.ExerciseImages, "ExerciseImageID", "ImageURL", assignedImage.ExerciseImageID); ViewBag.ExerciseInstructionID = new SelectList(db.ExerciseInstructions, "ExerciseInstructionID", "Remark", assignedImage.ExerciseInstructionID); return(View(assignedImage)); }