Пример #1
0
 /// <summary>
 /// 加载指定代理快开厅用户
 /// <param name="userCode">用户帐号</param>
 /// </summary>
 public void Load(string userCode)
 {
     try
     {
         TSAgentUser tsAgentUser = tsAgentUserDAO.Get(userCode);
         WebJson.ToJson(context, tsAgentUser);
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }
Пример #2
0
        /// <summary>
        /// 修改当前用户密码
        /// </summary>
        /// <param name="oldPwd">旧密码</param>
        /// <param name="newPwd">新密码</param>
        public void ChangePwd(string oldPwd, string newPwd, string roleId, string roleType)
        {
            TSAgentUserDAO tsAgentUserDao = new TSAgentUserDAO();
            TSAgentUser    user           = tsAgentUserDao.Get(loginAgentUser.UserId, roleId);

            if (user.userPwd.Equals(Encrypt.ConvertPwd(user.userId, oldPwd)) == false)
            {
                Message.error(context, "旧密码输入错误");
                return;
            }

            user.userPwd = Encrypt.ConvertPwd(user.userId, newPwd);
            try
            {
                tsAgentUserDao.ChangePwd(user.userId, user.userPwd, roleType);
                Message.success(context, "密码修改成功");
                loginAgentUser.Log("密码修改成功");
            }
            catch (Exception e)
            {
                Message.error(context, "密码修改失败");
                loginAgentUser.Log("密码修改失败,错误:" + e.Message);
            }
        }