예제 #1
0
 public ActionResult Edit([Bind(Include = "CategoryID,CategoryName")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "ID,Messages,Timestamp")] Message message)
 {
     if (ModelState.IsValid)
     {
         db.Entry(message).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(message));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "UserID,UserName,UserLastName,UserFirstName,UserCity")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "Id,MessageID")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MessageID = new SelectList(db.Messages, "ID", "Messages", user.MessageID);
     return(View(user));
 }