예제 #1
0
        public ActionResult EditPro(Product pro)
        {
            entity.Entry(pro).State = EntityState.Modified;

            if (entity.SaveChanges() > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(Content("<script>alert('修改失败')</script>"));
            }
        }
예제 #2
0
 //修改商品
 public ActionResult UpdateProduct(Product pro)
 {
     PEntity.Entry <Product>(pro).State = System.Data.Entity.EntityState.Modified;
     PEntity.SaveChanges();
     return(RedirectToAction("Index"));
 }