/// <summary>
        /// GetListByPage
        /// </summary>
        /// <param name="textWhere"></param>
        /// <param name="textOrder"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageRow"></param>
        /// <param name="dataCount"></param>
        /// <returns></returns>
        public List <UserRoleInfo> GetListByPage(string textWhere, string textOrder, int pageIndex, int pageRow, out int dataCount)
        {
            dataCount = dal.GetCounts(textWhere);
            ///用户角色关系数据
            List <UserRoleInfo> list = dal.GetListByPage(textWhere, textOrder, pageIndex, pageRow);
            ///角色用户例外条件数据
            List <UserRoleRangeAuthInfo> userRoleRangeAuthInfos = new UserRoleRangeAuthDAL().GetList(textWhere, string.Empty);
            ///例外条件基础数据
            List <RangeAuthConditionInfo> rangeAuthConditionInfos = new RangeAuthConditionDAL().GetList(string.Empty, string.Empty);

            foreach (UserRoleInfo info in list)
            {
                foreach (RangeAuthConditionInfo rangeAuthConditionInfo in rangeAuthConditionInfos)
                {
                    UserRoleRangeAuthInfo userRoleRangeAuthInfo
                        = userRoleRangeAuthInfos.FirstOrDefault(d => d.UserFid.GetValueOrDefault() == info.Fid.GetValueOrDefault());
                    if (userRoleRangeAuthInfo == null)
                    {
                        continue;
                    }
                    PropertyInfo propertyInfo = info.GetType().GetProperty(rangeAuthConditionInfo.AttributeName);
                    if (propertyInfo == null)
                    {
                        continue;
                    }
                    propertyInfo.SetValue(info, userRoleRangeAuthInfo.ConditionContext, null);
                }
            }
            return(list);
        }
Beispiel #2
0
 /// <summary>
 /// 分页获取数据列表
 /// </summary>
 public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
 {
     return(dal.GetListByPage(strWhere, orderby, startIndex, endIndex));
 }