Beispiel #1
0
 /// <summary>
 /// 返回在线用户列表
 /// </summary>
 public static ASEWH.Common.Generic.List<OnlineUserInfo> GetOnlineUserCollection()
 {
     ASEWH.Common.Generic.List<OnlineUserInfo> coll = new ASEWH.Common.Generic.List<OnlineUserInfo>();
     if (appDBCache)
         coll = IOnlineUserService.GetOnlineUserCollection();
     else
     {
         IDataReader reader = DatabaseProvider.GetInstance().GetOnlineUserList();
         while (reader.Read())
         {
             OnlineUserInfo onlineUserInfo = LoadSingleOnlineUser(reader);
             if (onlineUserInfo.Userid > 0 || (onlineUserInfo.Userid == -1 && GeneralConfigs.GetConfig().Whosonlinecontract == 0))
             {
                 onlineUserInfo.Actionname = UserAction.GetActionDescriptionByID((int)(onlineUserInfo.Action));
                 coll.Add(onlineUserInfo);
             }
         }
         reader.Close();
     }
     //返回当前版块的在线用户表
     return coll;
 }
Beispiel #2
0
 /// <summary>
 /// 获取需要审核的主题
 /// </summary>
 /// <param name="fidList">版块ID列表</param>
 /// <param name="tpp">每页主题数</param>
 /// <param name="pageId">页数</param>
 /// <param name="filter">displayorder过滤器</param>
 /// <returns></returns>
 public static ASEWH.Common.Generic.List<TopicInfo> GetUnauditNewTopic(string fidList, int tpp, int pageId, int filter)
 {
     ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();
     IDataReader reader = DatabaseProvider.GetInstance().GetUnauditNewTopic(fidList, tpp, pageId, filter);
     while (reader.Read())
     {
         list.Add(LoadSingleTopicInfo(reader));
     }
     reader.Close();
     return list;
 }
Beispiel #3
0
 /// <summary>
 /// 返回在线用户列表
 /// </summary>
 /// <param name="forumid">版块id</param>
 /// <returns></returns>
 public static ASEWH.Common.Generic.List<OnlineUserInfo> GetForumOnlineUserCollection(int forumid)
 {
     ASEWH.Common.Generic.List<OnlineUserInfo> coll = new ASEWH.Common.Generic.List<OnlineUserInfo>();
     if (appDBCache)
         coll = IOnlineUserService.GetForumOnlineUserCollection(forumid);
     else
     {
         IDataReader reader = DatabaseProvider.GetInstance().GetForumOnlineUserList(forumid);
         while (reader.Read())
         {
             OnlineUserInfo info = LoadSingleOnlineUser(reader);
             coll.Add(info);
         }
         reader.Close();
     }
     //返回当前版块的在线用户表
     return coll;
 }
Beispiel #4
0
        /// <summary>
        /// 获取置顶主题列表
        /// </summary>
        /// <param name="fid">版块id</param>
        /// <param name="pageIndex">页号</param>
        /// <param name="pageSize">每页条数</param>
        /// <param name="tids">置顶主题Id列表</param>
        /// <returns></returns>
        public static ASEWH.Common.Generic.List<TopicInfo> GetTopTopicList(int fid, int pageSize, int pageIndex, string tidList)
        {
            if (!Utils.IsNumericList(tidList))
                return new List<TopicInfo>();

            ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();
            if (appDBCache)
                list = ITopicService.GetTopTopicList(fid, pageSize, pageIndex, tidList);

            if (list.Count == 0)
            {
                IDataReader reader = DatabaseProvider.GetInstance().GetTopTopics(fid, pageSize, pageIndex, tidList);
                while (reader.Read())
                {
                    list.Add(LoadSingleTopicInfo(reader));
                }
                reader.Close();
            }
            return list;
        }
Beispiel #5
0
        /// <summary>
        /// 按照用户Id获取主题列表
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static ASEWH.Common.Generic.List<TopicInfo> GetTopicsByUserId(int userId, int pageIndex, int pageSize)
        {
            ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();

            IDataReader reader = DatabaseProvider.GetInstance().GetTopicsByUserId(userId, pageIndex, pageSize);

            while (reader.Read())
            {
                list.Add(LoadSingleTopicInfo(reader));
            }
            reader.Close();

            return list;
        }
Beispiel #6
0
        public static List<TopicInfo> GetTopicListByViewsOrReplies(int fid, int pageSize, int pageIndex, int startNumber, string condition, string orderFields, int sortType)
        {
            ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();
            IDataReader reader = DatabaseProvider.GetInstance().GetTopicsByViewsOrReplies(fid, pageSize, pageIndex, startNumber, condition, orderFields, sortType);
            while (reader.Read())
            {
                list.Add(LoadSingleTopicInfo(reader));
            }
            reader.Close();

            return list;
        }
Beispiel #7
0
        /// <summary>
        /// 对符合新帖,精华帖的页面显示进行查询的函数
        /// </summary>
        /// <param name="pageSize">每个分页的主题数</param>
        /// <param name="pageIndex">分页页数</param>
        /// <param name="startNumber">置顶帖数量</param>
        /// <param name="condition">条件</param>
        /// <param name="orderFields">排序字段,以","间隔</param>
        /// <param name="sortType">升/降序,0为升序,非0为降序</param>
        /// <returns>主题列表</returns>
        public static ASEWH.Common.Generic.List<TopicInfo> GetTopicListByCondition(int pageSize, int pageIndex, int startNumber, string condition, string orderFields, int sortType)
        {
            ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();
            IDataReader reader = null;
            if (orderFields == "")
                reader = DatabaseProvider.GetInstance().GetTopicsByType(pageSize, pageIndex, startNumber, condition, sortType);
            else
                reader = DatabaseProvider.GetInstance().GetTopicsByTypeDate(pageSize, pageIndex, startNumber, condition, orderFields, sortType);

            while (reader.Read())
            {
                list.Add(LoadSingleTopicInfo(reader));
            }
            reader.Close();

            return list;
        }
Beispiel #8
0
        /// <summary>
        /// 获得一般主题信息列表
        /// </summary>
        /// <param name="fid">版块ID</param>
        /// <param name="pageSize">每页显示主题数</param>
        /// <param name="pageIndex">当前页数</param>
        /// <param name="startNumber">置顶帖数量</param>
        /// <param name="condition">条件</param>
        /// <returns>主题信息列表</returns>
        public static ASEWH.Common.Generic.List<TopicInfo> GetTopicList(int fid, int pageSize, int pageIndex, int startNumber, string condition)
        {
            ASEWH.Common.Generic.List<TopicInfo> list = new ASEWH.Common.Generic.List<TopicInfo>();
            if (string.IsNullOrEmpty(condition) && appDBCache)
            {
                list = ITopicService.GetTopicList(fid, pageSize, pageIndex, startNumber);
                if (list.Count > 0) return list;
            }

            IDataReader reader = DatabaseProvider.GetInstance().GetTopics(fid, pageSize, pageIndex, startNumber, condition);
            while (reader.Read())
            {
                list.Add(LoadSingleTopicInfo(reader));
            }
            reader.Close();
            return list;
        }