protected override void SetProperties(IDnaDataReader reader)
        {
            base.SetProperties(reader);

            ThreadEntryId = reader.GetNullableInt32("ThreadEntryId");
            ModClassId = reader.GetInt32("ModClassId");
            SiteId = reader.GetInt32("SiteId");
            ForumId = reader.GetInt32("ForumId");
            ThreadId = reader.GetNullableInt32("ThreadId");
            UserId = reader.GetInt32("UserId");
            DatePosted = reader.GetDateTime("DatePosted");
            Text = reader.GetString("text");
            RiskModThreadEntryQueueId = reader.GetInt32("RiskModThreadEntryQueueId");
        }
Example #2
0
        protected override void SetProperties(IDnaDataReader reader)
        {
            base.SetProperties(reader);

            ThreadEntryId = reader.GetInt32("ThreadEntryId");
            ModClassId = reader.GetInt32("ModClassId");
            SiteId = reader.GetInt32("SiteId");
            ForumId = reader.GetInt32("ForumId");
            ThreadId = reader.GetInt32("ThreadId");
            UserId = reader.GetInt32("UserId");
            NextSibling = reader.GetNullableInt32("NextSibling");
            Parent = reader.GetNullableInt32("Parent");
            PrevSibling = reader.GetNullableInt32("PrevSibling");
            FirstChild = reader.GetNullableInt32("FirstChild");
            DatePosted = reader.GetDateTime("DatePosted");
            Text = reader.GetString("text");
        }
Example #3
0
 void TestNullableIntField(IDnaDataReader reader, string fieldName, int? expected)
 {
     int? v = reader.GetNullableInt32(fieldName);
     if (expected.HasValue)
         Assert.AreEqual(expected, v);
     else
         Assert.IsFalse(v.HasValue);
 }
Example #4
0
        void RiskModTestPostHelper(IDnaDataReader reader, int forumid, int? threadid, int? inreplyto, int userid, string content, out int? newthreadid, out int? newthreadentryid, bool ignoremoderation, bool forcepremodposting)
        {
            string sql = string.Format(@"
                
                -- Pretend this user has never posted to this forum, to make sure the check in posttoforuminternal
                -- that stops the same user from creating a new conversation within a minute of the last one, doesn't stop the post
                update threadentries set forumid=-{0} where forumid={0} and userid={3}

                declare @hash uniqueidentifier, @returnthread int, @returnpost int, @premodpostingmodid int, @ispremoderated int
                set @hash=newid()
                exec posttoforuminternal    @userid= {3}, 
										    @forumid = {0}, 
										    @inreplyto = {2}, 
										    @threadid = {1}, 
										    @subject ='The Cabinet', 
										    @content ='{4}', 
										    @poststyle =1, 
										    @hash =@hash,
										    @keywords ='', 
										    @nickname ='the furry one', 
										    @returnthread = @returnthread OUTPUT, 
										    @returnpost = @returnpost OUTPUT, 
										    @type = NULL, 
										    @eventdate = NULL,
										    @forcemoderate = 0, 
										    @forcepremoderation = 0,
										    @ignoremoderation = {6}, 
										    @allowevententries = 1, 
										    @nodeid = 0, 
										    @ipaddress = 'testip',
										    @queueid = null, 
										    @clubid = 0, 
										    @premodpostingmodid =@premodpostingmodid OUTPUT,
										    @ispremoderated =@ispremoderated OUTPUT, 
										    @bbcuid = '{5}',
										    @isnotable = 0, 
										    @iscomment = 0,
										    @modnotes = NULL,
										    @isthreadedcomment = 0,
										    @ignoreriskmoderation = 0,
										    @forcepremodposting = {7},
										    @forcepremodpostingdate = NULL,
										    @riskmodthreadentryqueueid = NULL;

                -- put the userids back
                update threadentries set forumid={0} where forumid =-{0} and userid={3}

                select @returnthread AS returnthread, @returnpost as returnpost",
                                            forumid,
                                            threadid.HasValue ? threadid.ToString() : "NULL",
                                            inreplyto.HasValue ? inreplyto.ToString() : "NULL",
                                            userid,
                                            content,
                                            testGUID.ToString(),
                                            ignoremoderation ? 1 : 0,
                                            forcepremodposting ? 1 : 0);

            reader.ExecuteWithinATransaction(sql);
            reader.Read();
            newthreadid = reader.GetNullableInt32("returnthread");
            newthreadentryid = reader.GetNullableInt32("returnpost");
            reader.Close();
        }