//Get a list of records that match the criteria specified in a filter public virtual ArrayList GetRecordList( string userId, BaseClasses.Data.BaseFilter filter, BaseClasses.Data.OrderBy orderBy, int pageNumber, int batchSize, ref int totalRows) { if (userId != null) { filter = BaseFilter.CombineFilters( CompoundFilter.CompoundingOperators.And_Operator, filter, BaseFilter.CreateUserIdFilter(((IUserTable)this), userId)); } BaseClasses.Data.BaseFilter join = null; return(((BaseClasses.ITable) this).GetRecordList(join, filter, null, orderBy, pageNumber, batchSize, ref totalRows)); }
//Get a list of records that match the user's name/password public virtual ArrayList GetRecordList( string userName, string userPassword, BaseClasses.Data.BaseFilter filter, BaseClasses.Data.OrderBy orderBy, int pageNumber, int batchSize, ref int totalRows) { //Set up a name/password filter if ((userName != null) || (userPassword != null)) { filter = BaseFilter.CombineFilters( CompoundFilter.CompoundingOperators.And_Operator, filter, BaseFilter.CreateUserAuthenticationFilter(((IUserIdentityTable)this), userName, userPassword)); } BaseClasses.Data.BaseFilter join = null; return(((BaseClasses.ITable) this).GetRecordList(join, filter, null, orderBy, pageNumber, batchSize, ref totalRows)); }
//Get a list of roles to which the user belongs public string[] GetUserRoles() { string[] roles; if ((this as BaseClasses.IUserRoleRecord) != null) { string role = ((BaseClasses.IUserRoleRecord) this).GetUserRole(); roles = new string[] { role }; } else { BaseClasses.IUserRoleTable roleTable = ((BaseClasses.IUserIdentityTable) this.TableAccess).GetUserRoleTable(); if (roleTable == null) { return(null); } else { ColumnValueFilter filter = BaseFilter.CreateUserIdFilter(roleTable, this.GetUserId()); BaseClasses.Data.OrderBy order = new BaseClasses.Data.OrderBy(false, false); BaseClasses.Data.BaseFilter join = null; ArrayList roleRecords = roleTable.GetRecordList( join, filter, null, order, BaseClasses.Data.BaseTable.MIN_PAGE_NUMBER, BaseClasses.Data.BaseTable.MAX_BATCH_SIZE); ArrayList roleList = new ArrayList(roleRecords.Count); foreach (BaseClasses.IUserRoleRecord roleRecord in roleRecords) { roleList.Add(roleRecord.GetUserRole()); } roles = (string[])roleList.ToArray(typeof(string)); } } return(roles); }