示例#1
0
 public ActionResult Edit([Bind(Include = "UserId,Email,Password,FirstName,LastName")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "ItemId,Name,Description,Price")] Item item)
 {
     if (ModelState.IsValid)
     {
         db.Entry(item).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(item));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "OrderId,UserId,DateCreated")] Order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Users, "UserId", "Email", order.UserId);
     return(View(order));
 }