public void update(User user) {
   Tuser u = userDao.get(Tuser.class, user.getCid());
   BeanUtils.copyProperties(user, u, new String[] {"cid", "cpwd"});
   if (user.getCpwd() != null && !user.getCpwd().trim().equals("")) {
     u.setCpwd(Encrypt.e(user.getCpwd()));
   }
   u.setCmodifydatetime(new Date());
   this.saveUserRole(user, u);
 }
 public void editUserInfo(User user) {
   if (user.getCpwd() != null && !user.getCpwd().trim().equals("")) {
     Tuser t = userDao.get(Tuser.class, user.getCid());
     t.setCpwd(Encrypt.e(user.getCpwd()));
   }
 }