Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AssignedImage assignedImage = db.AssignedImages.Find(id);

            db.AssignedImages.Remove(assignedImage);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        // 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));
        }
Esempio n. 4
0
        // 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));
        }