示例#1
0
        public BaseResultDto <string> UpdatePwd(RQPwdDto model)
        {
            BaseResultDto <string> result = new BaseResultDto <string>();
            List <string>          keyVal = new List <string>();

            keyVal.Add(string.Format("UserPassword='******'", model.NewPwd));
            string sqlWhere = string.Format("UserPassword='******' and ID={1}", model.OriPwd, model.UserId);

            if (helper.Exists <SystemUsers>(sqlWhere) > 0)
            {
                if (oper.Update(keyVal, sqlWhere))
                {
                    result.ErrorCode = 1;
                    result.ErrorMsg  = "成功";
                }
                else
                {
                    result.ErrorCode = -2;
                    result.ErrorMsg  = "修改失败";
                }
            }
            else
            {
                result.ErrorCode = -1;
                result.ErrorMsg  = "原密码错误";
            }
            return(result);
        }