/// <summary> /// 用户修改签名密码 /// </summary> /// <param name="userInfo">用户</param> /// <param name="oldPassword">原始密码</param> /// <param name="newPassword">新密码</param> /// <param name="statusCode">返回状态码</param> /// <param name="statusMessage">返回状消息</param> /// <returns>影响行数</returns> public int ChangeSignedPassword(BaseUserInfo userInfo, string oldPassword, string newPassword, out string statusCode, out string statusMessage) { var parameter = ServiceParameter.CreateWithMessage(userInfo , MethodBase.GetCurrentMethod() , this.serviceName , AppMessage.LogOnService_ChangeSignedPassword); int result = 0; string returnCode = string.Empty; string returnMessage = string.Empty; ServiceUtil.ProcessUserCenterWriteDb(parameter, (dbHelper) => { // 事务开始 // dbHelper.BeginTransaction(); var userManager = new BaseUserLogOnManager(dbHelper, userInfo); result = userManager.ChangeSignedPassword(oldPassword, newPassword, out returnCode); // 获得状态消息 returnMessage = userManager.GetStateMessage(returnCode); // 事务提交 // dbHelper.CommitTransaction(); }); statusCode = returnCode; statusMessage = returnMessage; return(result); }
/// <summary> /// 设置用户通讯密码 /// </summary> /// <param name="userInfo">用户</param> /// <param name="userId">被设置的员工主键</param> /// <param name="password">新密码</param> /// <param name="statusCode">返回状态码</param> /// <param name="statusMessage">返回状消息</param> /// <returns>影响行数</returns> public int SetCommunicationPassword(BaseUserInfo userInfo, string[] userIds, string password, out string statusCode, out string statusMessage) { var parameter = ServiceParameter.CreateWithLog(userInfo , MethodBase.GetCurrentMethod()); int result = 0; string returnCode = string.Empty; string returnMessage = string.Empty; ServiceUtil.ProcessUserCenterWriteDb(parameter, (dbHelper) => { var userManager = new BaseUserLogOnManager(dbHelper, userInfo); result = userManager.BatchSetCommunicationPassword(userIds, password, out returnCode); // 获得状态消息 returnMessage = userManager.GetStateMessage(returnCode); BaseLogManager.Instance.Add(userInfo, this.serviceName, AppMessage.LogOnService_SetPassword, MethodBase.GetCurrentMethod()); }); statusCode = returnCode; statusMessage = returnMessage; return(result); }
/// <summary> /// 创建数字证书签名 /// </summary> /// <param name="userInfo">用户</param> /// <param name="password">密码</param> /// <param name="statusCode">返回状态码</param> /// <param name="statusMessage">返回状消息</param> /// <returns>私钥</returns> public string CreateDigitalSignature(BaseUserInfo userInfo, string password, out string statusCode, out string statusMessage) { var parameter = ServiceParameter.CreateWithMessage(userInfo , MethodBase.GetCurrentMethod() , this.serviceName , AppMessage.LogOnService_CreateDigitalSignature); string result = string.Empty; string returnCode = string.Empty; string returnMessage = string.Empty; ServiceUtil.ProcessUserCenterWriteDb(parameter, (dbHelper) => { var userManager = new BaseUserLogOnManager(dbHelper, userInfo); result = userManager.CreateDigitalSignature(password, out returnCode); // 获得状态消息 returnMessage = userManager.GetStateMessage(returnCode); }); statusCode = returnCode; statusMessage = returnMessage; return(result); }