SVN r1044
SVN-Revision: r1044
This commit is contained in:
@@ -182,7 +182,8 @@ namespace Lskj.Business.Impl
|
||||
{
|
||||
sqlValue = string.Format("update P_EmployeeTab set password='{0}',p_emp_password='{1}' where EmployeeId='{2}' select @@ROWCOUNT", password, mdpassword, userId);
|
||||
}
|
||||
return SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
int result = SqlHelper.ExecuteNonQuery(sqlValue);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:修改密码</para>
|
||||
@@ -224,6 +225,72 @@ namespace Lskj.Business.Impl
|
||||
return numberOfAffectedRows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改密码,传入到存储过程中处理
|
||||
/// </summary>
|
||||
/// <param name="personid"></param>
|
||||
/// <param name="newpsw"></param>
|
||||
/// <param name="tipMsg"></param>
|
||||
/// <returns></returns>
|
||||
public static int ChangePassword(string personid, string newpsw, out string tipMsg)
|
||||
{
|
||||
try
|
||||
{
|
||||
//md5加密密码
|
||||
//string mdpassword = SHAHelper.GetMd5Hash(newpsw);
|
||||
newpsw = SHAHelper.EncryptPassword(newpsw);
|
||||
|
||||
SqlParameter pMsg = ERPInfo.Instance.ChangeParameterType ? new SqlParameter("@msg", SqlDbType.NVarChar, 4000) : new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
||||
pMsg.Direction = ParameterDirection.Output;
|
||||
SqlParameter returnValue = new SqlParameter("@return", SqlDbType.Int, 4);
|
||||
returnValue.Direction = ParameterDirection.ReturnValue;
|
||||
SqlParameter[] param =
|
||||
{
|
||||
|
||||
new SqlParameter("@personid",SqlDbType.Int),
|
||||
new SqlParameter("@newpsw",SqlDbType.VarChar),
|
||||
pMsg,
|
||||
returnValue
|
||||
};
|
||||
param[0].Value = personid;
|
||||
param[1].Value = newpsw;
|
||||
param[2].Value = "";
|
||||
|
||||
int result = MainImpl.ExecProcedure("pr_sytemchangepsw", param);
|
||||
tipMsg = pMsg.Value.ToString();
|
||||
int rValue = Convert.ToInt32(returnValue.Value);
|
||||
return rValue;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tipMsg = ex.Message;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录修改后的密码
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="afterPass"></param>
|
||||
/// <returns></returns>
|
||||
public static bool RecordPassword(string afterPass)
|
||||
{
|
||||
try
|
||||
{
|
||||
//加密密码
|
||||
afterPass = AESUtil.Encrypt(afterPass);
|
||||
LogUtil.WriteDebug("", "修改密码", afterPass, "");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:跨数据库修改密码</para>
|
||||
/// <para>创建人:曹屹峰</para>
|
||||
|
||||
Reference in New Issue
Block a user