Beispiel #1
0
        public ForumTopic(Core core, Forum forum, System.Data.Common.DbDataReader topicRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Topic_ItemLoad);

            this.forum = forum;

            try
            {
                loadItemInfo(topicRow);
            }
            catch (InvalidItemException)
            {
                throw new InvalidTopicException();
            }

            try
            {
                readStatus = new TopicReadStatus(core, topicRow);
                readStatusLoaded = true;
            }
            catch (InvalidTopicReadStatusException)
            {
                readStatus = null;
                readStatusLoaded = true;
            }
        }
Beispiel #2
0
        public ForumTopic(Core core, Forum forum, long topicId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Topic_ItemLoad);

            this.forum = forum;

            SelectQuery query = ForumTopic_GetSelectQueryStub(core);
            query.AddCondition("`forum_topics`.`topic_id`", topicId);

            System.Data.Common.DbDataReader topicReader = db.ReaderQuery(query);

            if (topicReader.HasRows)
            {
                topicReader.Read();

                loadItemInfo(topicReader);

                try
                {
                    readStatus = new TopicReadStatus(core, topicReader);
                    readStatusLoaded = true;
                }
                catch (InvalidTopicReadStatusException)
                {
                    readStatus = null;
                    readStatusLoaded = true;
                }

                topicReader.Close();
                topicReader.Dispose();
            }
            else
            {
                topicReader.Close();
                topicReader.Dispose();

                throw new InvalidTopicException();
            }
        }
Beispiel #3
0
        public ForumTopic(Core core, DataRow topicRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Topic_ItemLoad);

            try
            {
                loadItemInfo(topicRow);
            }
            catch (InvalidItemException)
            {
                throw new InvalidTopicException();
            }

            try
            {
                readStatus = new TopicReadStatus(core, topicRow);
                readStatusLoaded = true;
            }
            catch (InvalidTopicReadStatusException)
            {
                readStatus = null;
                readStatusLoaded = true;
            }
        }