Exemple #1
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;
        }
Exemple #2
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;
        }
Exemple #3
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;
        }
Exemple #4
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;
        }