public int Edit(SysModule entity)
 {
     using (SysMgr_DBEntities db = new SysMgr_DBEntities())
     {
         db.SysModule.Attach(entity);
         db.Entry <SysModule>(entity).State = System.Data.Entity.EntityState.Modified;
         return(db.SaveChanges());
     }
 }
 public int Edit(SysSample entity)
 {
     using (SysMgr_DBEntities db = new SysMgr_DBEntities())
     {
         db.SysSample.Attach(entity);
         //db.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
         db.Entry <SysSample>(entity).State = System.Data.Entity.EntityState.Modified;
         return(db.SaveChanges());
     }
 }