示例#1
0
 public ActionResult Edit([Bind(Include = "UserID,EMail,Password,TelNr,SessionID,IsAdmin")] 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 = "ProductID,Name,Description,Price,PictureLink")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "OrderID,UserID,Paid,OrderDate")] 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));
 }