/// <summary> /// Gets all the users in a role /// </summary> /// <param name="roleID"></param> /// <returns></returns> public static IList<UserAccount> GetUsersInRole(int roleID) { UserAccounts uars = null; DbCommand comm = DbAct.CreateCommand(); comm.CommandText = "up_GetUsersInRole"; comm.AddParameter("roleID", roleID); DataTable dt = DbAct.ExecuteSelectCommand(comm); if (dt == null || dt.Rows.Count <= 0) return uars; uars = new UserAccounts(); uars.AddRange(from DataRow dr in dt.Rows select new UserAccount(dr)); return uars; }
private UserAccounts LoadTopForumUsers(IEnumerable<int> mostPostsInForum) { var topForumUsers = new UserAccounts(); topForumUsers.AddRange(mostPostsInForum.Select(topForumUser => new UserAccount(topForumUser))); return topForumUsers; }