Beispiel #1
0
 public long ChangeUserPsw(string oldPsw, string newPsw)
 {
     BaseSearchModel se = new BaseSearchModel("bw_user");
     se["ID"] = LoginInfo.Current.UserID;
     var user = se.LoadEntity<BW_User>();
     if (user.UserPsw.Equals(Encryption.GetMD5(oldPsw)))
     {
         user = new BW_User();
         user["ID"] = LoginInfo.Current.UserID;
         user.UserPsw = Encryption.GetMD5(newPsw);
         return user.Save();
     }
     return 0;
 }
Beispiel #2
0
        public JsonNetResult SaveUser(BW_User entity)
        {
            if (entity.ID == 0)
            {
                #region 维护新增数据

                entity.CreateBy = LoginInfo.Current.UserName;
                entity.CreateOn = DateTime.Now;
                entity.UserPsw = Encryption.GetMD5("123456");

                #endregion
            }
            else
            {
                #region 维护修改数据

                entity.EditBy = LoginInfo.Current.UserName;
                entity.EditOn = DateTime.Now;

                #endregion
            }

            var r = entity.Save();
            if (r > 0)
            {
                return ExController.JsonNet(entity);
            }
            return ExController.JsonNet(new { ID = 0 });
        }