예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Birthday,Address,PhoneNumber,Email,Username,Password,Deleted,UserGroupId,AccessFailedCount")] 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 = "Id,Name")] UserGroup userGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userGroup));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Price,Quantity,Description,Image,CategoryId,CreatedDate,ModifiedDate,Deleted,Promotion")] Product product)
 {
     if (ModelState.IsValid)
     {
         product.ModifiedDate    = DateTime.Now;
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }