예제 #1
0
        public static SAS.Common.Generic.List<AlbumCategoryInfo> GetAlbumCategory()
        {
            SASCache cache = SASCache.GetCacheService();
            SAS.Common.Generic.List<AlbumCategoryInfo> acic = cache.RetrieveObject("/Space/AlbumCategory") as SAS.Common.Generic.List<AlbumCategoryInfo>;

            if (acic == null)
            {
                acic = new SAS.Common.Generic.List<AlbumCategoryInfo>();
                acic = Data.DbProvider.GetInstance().GetAlbumCategory();
                cache.AddObject("/Space/AlbumCategory", (ICollection)acic);
            }
            return acic;
        }
예제 #2
0
        /// <summary>
        /// 获取全部团队信息列表
        /// </summary>
        /// <returns></returns>
        public static SAS.Common.Generic.List<TeamInfo> GetAllTeamInfoList()
        {
            SASCache cache = SASCache.GetCacheService();
            SAS.Common.Generic.List<TeamInfo> acic = cache.RetrieveObject("/Sirius/TeamInfoList") as SAS.Common.Generic.List<TeamInfo>;

            if (acic == null)
            {
                acic = new SAS.Common.Generic.List<TeamInfo>();
                acic = Data.DbProvider.GetInstance().GetAllTeamList();
                cache.AddObject("/Sirius/TeamInfoList", (ICollection)acic);
            }
            return acic;
        }
예제 #3
0
        public static SAS.Common.Generic.List<PhotoInfo> GetPhotosWithSameTag(int tagid, int pageid, int pagesize)
        {
            IDataReader reader = Data.DbProvider.GetInstance().GetPhotosWithSameTag(tagid, pageid, pagesize);
            SAS.Common.Generic.List<PhotoInfo> photolist = new SAS.Common.Generic.List<PhotoInfo>();
            while (reader.Read())
            {
                photolist.Add(GetPhotoEntity(reader));
            }
            reader.Close();

            return photolist;
        }
예제 #4
0
        public static SAS.Common.Generic.List<PhotoInfo> GetSpacePhotosInfo(DataTable dt)
        {
            if (dt == null || dt.Rows.Count == 0)
                return new SAS.Common.Generic.List<PhotoInfo>();

            SAS.Common.Generic.List<PhotoInfo> photosinfoarray = new SAS.Common.Generic.List<PhotoInfo>();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                PhotoInfo photo = new PhotoInfo();
                photo.Photoid = TypeConverter.ObjectToInt(dt.Rows[i]["photoid"]);
                photo.Filename = dt.Rows[i]["filename"].ToString();
                photo.Attachment = dt.Rows[i]["attachment"].ToString();
                photo.Filesize = TypeConverter.ObjectToInt(dt.Rows[i]["filesize"]);
                photo.Description = dt.Rows[i]["description"].ToString();
                photo.Postdate = dt.Rows[i]["postdate"].ToString();
                photo.Albumid = TypeConverter.ObjectToInt(dt.Rows[i]["albumid"]);
                photo.Userid = TypeConverter.ObjectToInt(dt.Rows[i]["userid"]);
                photo.Title = dt.Rows[i]["title"].ToString();
                photo.Views = TypeConverter.ObjectToInt(dt.Rows[i]["views"]);
                photo.Commentstatus = (PhotoStatus)TypeConverter.ObjectToInt(dt.Rows[i]["commentstatus"]);
                photo.Tagstatus = (PhotoStatus)TypeConverter.ObjectToInt(dt.Rows[i]["tagstatus"]);
                photo.Comments = TypeConverter.ObjectToInt(dt.Rows[i]["comments"]);

                photosinfoarray.Add(photo);
            }
            dt.Dispose();
            return photosinfoarray;
        }
예제 #5
0
        /// <summary>
        /// 团队活动获取(带缓存)
        /// </summary>
        public static List<TeamActInfo> GetTeamActByTidWithCache(int tid)
        {
            SASCache cache = SASCache.GetCacheService();
            string cachekey = "/Sirius/ActList_" + tid;
            SAS.Common.Generic.List<TeamActInfo> acic = cache.RetrieveObject(cachekey) as SAS.Common.Generic.List<TeamActInfo>;

            if (acic == null)
            {
                acic = new SAS.Common.Generic.List<TeamActInfo>();
                acic = GetTeamActByTid(tid);
                cache.AddObject(cachekey, (ICollection)acic);
            }
            return acic;
        }
예제 #6
0
        /// <summary>
        /// 返回在线用户列表
        /// </summary>
        /// <param name="forumid">版块id</param>
        /// <returns></returns>
        public static List<OnlineUserInfo> GetForumOnlineUserCollection(int forumid)
        {
            SAS.Common.Generic.List<OnlineUserInfo> coll = new SAS.Common.Generic.List<OnlineUserInfo>();

            IDataReader reader = DatabaseProvider.GetInstance().GetForumOnlineUserList(forumid);
            while (reader.Read())
            {
                OnlineUserInfo info = LoadSingleOnlineUser(reader);
                coll.Add(info);
            }
            reader.Close();
            //返回当前版块的在线用户表
            return coll;
        }
예제 #7
0
        /// <summary>
        /// 返回在线用户列表
        /// </summary>
        public static List<OnlineUserInfo> GetOnlineUserCollection()
        {
            SAS.Common.Generic.List<OnlineUserInfo> coll = new SAS.Common.Generic.List<OnlineUserInfo>();

            IDataReader reader = DatabaseProvider.GetInstance().GetOnlineUserList();
            while (reader.Read())
            {
                OnlineUserInfo onlineUserInfo = LoadSingleOnlineUser(reader);
                if (onlineUserInfo.Ol_ps_id > 0 || (onlineUserInfo.Ol_ps_id == -1 && GeneralConfigs.GetConfig().Whosonlinecontract == 0))
                {
                    onlineUserInfo.Ol_actionname = UserAction.GetActionDescriptionByID((int)(onlineUserInfo.Ol_action));
                    coll.Add(onlineUserInfo);
                }
            }
            reader.Close();
            //返回当前版块的在线用户表
            return coll;
        }