Example #1
0
 public ActionResult Edit([Bind(Include = "TongHuaID,TongHuaBiaoTi,TongHuaNeiRong,TongHuaLeiBieID,PaiXu,ZhuangTai")] e_tonghuaxinxi e_tonghuaxinxi)
 {
     if (ModelState.IsValid)
     {
         /*
          * db.e_tonghuaxinxi.Attach(e_tonghuaxinxi);
          * var entry = db.Entry(e_tonghuaxinxi);
          * entry.Property(e => e.TongHuaBiaoTi).IsModified = true;
          * entry.Property(e => e.TongHuaNeiRong).IsModified = true;
          * entry.Property(e => e.TongHuaLeiBieID).IsModified = true;
          * entry.Property(e => e.PaiXu).IsModified = true;
          * db.SaveChanges();
          */
         db.Entry(e_tonghuaxinxi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         ViewBag.ErrorInfo = "信息验证失败";
     }
     return(View(e_tonghuaxinxi));
 }