Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }