/// <summary> /// 获得员工列表 /// </summary> /// <param name="userInfo">用户</param> /// <param name="organizationId">组织主键</param> /// <param name="searchKey">查询</param> /// <returns>数据表</returns> public DataTable Search(BaseUserInfo userInfo, string organizationId, string searchKey) { var dt = new DataTable(BaseStaffEntity.CurrentTableName); var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod()); ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) => { var manager = new BaseStaffManager(dbHelper, userInfo); dt = manager.Search(organizationId, searchKey, false); dt.TableName = BaseStaffEntity.CurrentTableName; }); return(dt); }
/// <summary> /// 获得员工列表 /// </summary> /// <param name="userInfo">用户</param> /// <param name="organizeId">组织主键</param> /// <param name="search">查询</param> /// <returns>数据表</returns> public DataTable Search(BaseUserInfo userInfo, string organizeId, string searchValue) { // 写入调试信息 #if (DEBUG) int milliStart = BaseBusinessLogic.StartDebug(userInfo, MethodBase.GetCurrentMethod()); #endif // 加强安全验证防止未授权匿名调用 #if (!DEBUG) LogOnService.UserIsLogOn(userInfo); #endif DataTable dataTable = new DataTable(BaseStaffEntity.TableName); using (IDbHelper dbHelper = DbHelperFactory.GetHelper(BaseSystemInfo.UserCenterDbType)) { try { dbHelper.Open(UserCenterDbConnection); BaseStaffManager staffManager = new BaseStaffManager(dbHelper, userInfo); dataTable = staffManager.Search(organizeId, searchValue, false); dataTable.TableName = BaseStaffEntity.TableName; BaseLogManager.Instance.Add(dbHelper, userInfo, this.serviceName, MethodBase.GetCurrentMethod()); } catch (Exception ex) { BaseExceptionManager.LogException(dbHelper, userInfo, ex); throw ex; } finally { dbHelper.Close(); } } // 写入调试信息 #if (DEBUG) BaseBusinessLogic.EndDebug(MethodBase.GetCurrentMethod(), milliStart); #endif return(dataTable); }