/// <summary> /// 设置用户密码 /// </summary> /// <param name="userInfo">用户</param> /// <param name="userId">被设置的员工主键</param> /// <param name="password">新密码</param> /// <param name="returnStatusCode">返回状态码</param> /// <param name="returnStatusMessage">返回状消息</param> /// <returns>影响行数</returns> public int SetPassword(BaseUserInfo userInfo, string[] userIds, string password, out string returnStatusCode, out string returnStatusMessage) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 #if (!DEBUG) LogOnService.UserIsLogOn(userInfo); #endif returnStatusCode = string.Empty; returnStatusMessage = string.Empty; int returnValue = 0; using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType)) { try { dbHelper.Open(UserCenterDbConnection); BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, AppMessage.LogOnService_SetPassword, MethodBase.GetCurrentMethod()); BaseUserManager userManager = new BaseUserManager(dbHelper, userInfo); returnValue = userManager.BatchSetPassword(userIds, password); returnStatusCode = userManager.ReturnStatusCode; // 获得状态消息 returnStatusMessage = userManager.GetStateMessage(returnStatusCode); } catch (Exception ex) { BaseExceptionManager.LogException(dbHelper, userInfo, ex); throw ex; } finally { dbHelper.Close(); } } // 写入调试信息 #if (DEBUG) BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart); #endif return returnValue; }