/// <summary>
        /// 获取角色列表
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="pagination"></param>
        /// <param name="sortFieldName"></param>
        /// <param name="sortEnum"></param>
        /// <returns></returns>
        public virtual List <SysRole> GetRoleList(SearchSysRole condition, Pagination pagination, string sortFieldName, ScriptQuery.SortEnum sortEnum)
        {
            try
            {
                Script.TableName = SysRole.SysRole_TableName;
                Script.Select().ALL().From().Where();
                if (!string.IsNullOrEmpty(condition.RoleName))
                {
                    Script.Like(SysRole.RoleName_FieldName, condition.RoleName);
                }
                if (condition.RoleState > 0)
                {
                    Script.Where(SysRole.RoleState_FieldName, condition.RoleState);
                }
                if (condition.IsInnerRole != 2)
                {
                    Script.Where(SysRole.IsInnerRole_FieldName, condition.IsInnerRole);
                }

                Script.Where(SysRole.Owner_FieldName, condition.Owner);
                if (!string.IsNullOrEmpty(condition.OwnerCode))
                {
                    Script.Where(SysRole.OwnerCode_FieldName, condition.OwnerCode);
                }


                Script.AddOrderBy().OrderBy(sortFieldName, sortEnum);

                Script.PageIndex  = pagination.PageIndex;
                Script.PageSize   = pagination.PageSize;
                Script.PrimaryKey = SysRole.RoleID_FieldName;                //sql2000分页查询时请指定主键字段名称
                List <SysRole> lists = Script.GetList <SysRole>();
                pagination.RecordCount = Script.RecordCount;
                return(lists);
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message, ex);
                return(new List <SysRole>());
            }
        }
 /// <summary>
 /// 获取角色列表
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="pagination"></param>
 /// <returns></returns>
 public virtual List <SysRole> GetRoleList(SearchSysRole condition, DevNet.Common.Pagination pagination)
 {
     return(GetRoleList(condition, pagination, SysRole.RoleID_FieldName, ScriptQuery.SortEnum.ASC));
 }