コード例 #1
0
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="permissionCode">权限编码</param>
        /// <param name="companyId"></param>
        /// <param name="condition">查询</param>
        /// <param name="auditStates">有效</param>
        /// <param name="enabled"></param>
        /// <param name="recordCount"></param>
        /// <param name="pageNo"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <returns>数据表</returns>
        public DataTable SearchByPage(BaseUserInfo userInfo, string permissionCode, string companyId, string condition, string auditStates, bool?enabled, out int recordCount, int pageNo = 1, int pageSize = 100, string sort = null)
        {
            recordCount = 0;
            var myRecordCount = 0;
            var result        = new DataTable();

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterWriteDb(userInfo, parameter, (dbHelper) =>
            {
                var staffManager = new BaseStaffManager(dbHelper, userInfo);
                // result = staffManager.GetDataTable(100, BaseStaffEntity.FieldSortCode);
                result           = staffManager.SearchByPage(permissionCode, condition, enabled, auditStates, companyId, null, out myRecordCount, pageNo, pageSize, sort);
                result.TableName = BaseStaffEntity.CurrentTableName;
            });
            recordCount = myRecordCount;
            return(result);
        }