示例#1
0
        public ActionResult EditPictureView(int?id)
        {
            int     ID = id ?? 0;
            Picture picture;

            using (Repos repo = new Repos())
            {
                picture = repo.GetPictureByID(ID);
            }
            return(View(picture));
        }
示例#2
0
        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 }));
        }
示例#3
0
        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));
        }
示例#4
0
        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));
        }