예제 #1
0
        public ActionResult Edit([Bind(Include = "AnswerID,AnswerString,ModuleID,PictureCount")] Answer answer, int?ModuleID)
        {
            if (ModelState.IsValid)
            {
                using (Repos repo = new Repos())
                {
                    repo.UpdateAnswer(answer);
                    ViewBag.Pictures = repo.GetViewBagPictureList(answer.AnswerID);
                }

                return(RedirectToAction("Create", new { controller = "Answers", id = answer.ModuleID }));
            }
            ViewBag.ModuleID = new SelectList(db.Modules, "ModuleID", "Name");
            return(View(answer));
        }