Exemple #1
0
 public ActionResult Edit([Bind(Include = "PictureID,AnswerID,Attribution,PictureData")] Picture picture)
 {
     if (ModelState.IsValid)
     {
         using (Repos repo = new Repos())
         {
             if (!repo.UpdatePicture(picture))
             {
                 //ERROR UPDATING DATABASE
             }
         }
         return(RedirectToAction("edit", new { controller = "Answers", id = picture.AnswerID }));
     }
     ViewBag.AnswerID = new SelectList(db.Answers, "AnswerID", "AnswerString", picture.AnswerID);
     return(View(picture));
 }