예제 #1
0
 public ActionResult Edit(Board board)
 {
     if (ModelState.IsValid)
     {
         db.Entry(board).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(board));
 }
예제 #2
0
 public ActionResult Edit(Pin pin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TypeId  = new SelectList(db.Types, "TypeId", "Name", pin.TypeId);
     ViewBag.BoardId = new SelectList(db.Boards.Where(u => u.User.UserId == WebSecurity.CurrentUserId), "BoardId", "Title", pin.Board.BoardId);
     return(View(pin));
 }