Пример #1
0
 public ActionResult Edit([Bind(Include = "ID,Name")] MenuGroup menuGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(menuGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(menuGroup));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Username,Password,FullName,Photo")] Admin admin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(admin));
 }
 public ActionResult Edit([Bind(Include = "Username,Password,ConfirmPassword,FullName,Address,Email,Photo,ID")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "ID,Name,Alias,CategoryID,Image,MoreImages,Price,PromotionPrice,Warranty,Description,Content,HomeFlag,HotFlag,ViewCount,CreatedDate,CreatedBy,UpdatedDate,UpdatedBy,MetaKeyword,MetaDescription,Status")] Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.ProductCategories, "ID", "Name", product.CategoryID);
     return(View(product));
 }
 public virtual void Update(T entity)
 {
     dbSet.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
 }