public ActionResult EditPictureView(int?id) { int ID = id ?? 0; Picture picture; using (Repos repo = new Repos()) { picture = repo.GetPictureByID(ID); } return(View(picture)); }
public ActionResult DeleteConfirmed(int id) { int answerID; using (Repos repo = new Repos()) { answerID = repo.GetPictureByID(id).AnswerID; repo.DeletePicture(id); } return(RedirectToAction("edit", new { controller = "Answers", id = answerID })); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } int ID = id ?? 0; Picture picture; using (Repos repo = new Repos()) { picture = repo.GetPictureByID(ID); } if (picture == null) { return(HttpNotFound()); } return(View(picture)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } int ID = id ?? 0; Picture picture; using (Repos repo = new Repos()) { picture = repo.GetPictureByID(ID); } if (picture == null) { return(HttpNotFound()); } ViewBag.AnswerID = new SelectList(db.Answers, "AnswerID", "AnswerString", picture.AnswerID); return(View(picture)); }