Esempio n. 1
0
        private static int CreateNewSite(IDnaDataReader reader, string urlname)
        {
            string sql = @"exec createnewsite	 @urlname = '"+urlname+"',"+
									            "@shortname = '"+urlname+"',"+
									            "@description = '"+urlname+"',"+
									            "@defaultskin = 'default',"+
									            "@skindescription = '',"+
									            "@skinset ='boards',"+
									            "@useframes =0,"+
									            "@premoderation = 0,"+
									            "@noautoswitch =0,"+
									            "@customterms = 0,"+
									            "@moderatorsemail = '[email protected]',"+
									            "@editorsemail = '[email protected]',"+
									            "@feedbackemail = '[email protected]',"+
									            "@automessageuserid = 245,"+
									            "@passworded = 0,"+
									            "@unmoderated = 0,"+
									            "@articleforumstyle =0,"+
									            "@threadorder =1,"+
									            "@threadedittimelimit = 0,"+
									            "@eventemailsubject = '',"+
									            "@eventalertmessageuserid = 254,"+ 
									            "@includecrumbtrail  = 0,"+
									            "@allowpostcodesinsearch = 0,"+ 
									            "@ssoservice = null,"+
									            "@siteemergencyclosed = 0,"+
									            "@allowremovevote = 0,"+
									            "@queuepostings = 0,"+
									            "@modclassid = 1,"+
									            "@identitypolicy = 'http://identity/policies/dna/adult'";

            reader.ExecuteDEBUGONLY(sql);
            reader.Read();
            int siteid = reader.GetInt32("siteid");
            return siteid;
        }
Esempio n. 2
0
        private static bool SiteExists(IDnaDataReader reader,string urlname)
        {
            using (IDnaDataReader r = reader.ExecuteDEBUGONLY("select * from sites where urlname='"+urlname+"'"))
            {
                while (r.Read())
                {
                    if (r.GetString("urlname") == urlname)
                        return true;
                }
            }

            return false;
        }
Esempio n. 3
0
        private void SetSiteID(IDnaDataReader dataReader, String urlname)
        {
            dataReader.ExecuteDEBUGONLY("select siteid from sites where urlname='" + urlname + "'");

            if (dataReader.Read())
            {
                _siteId = dataReader.GetInt32("SiteID");
            }
            else
            {
                Assert.Fail("Unable to read the Sites table");
            }
        }
Esempio n. 4
0
        private void SetForumID(IDnaDataReader dataReader)
        {
            dataReader.ExecuteDEBUGONLY("select forumid from forums where canread = 1 and canwrite=1 and siteid =" + Convert.ToString(_siteId) );

            if (dataReader.Read())
            {
                _forumId = dataReader.GetInt32("ForumID");
            }
            else
            {
                Assert.Fail("Unable to find a forum for site");
            }
        }
Esempio n. 5
0
        private void ReadTopDateRangeRecord(IDnaDataReader dataReader, ref DateRangeInfo drInfo)
        {
            dataReader.ExecuteDEBUGONLY("select top 1 * from articledaterange order by entryid desc");

            if (dataReader.Read())
            {
                drInfo.entryId= dataReader.GetInt32("EntryID");
                drInfo.startDate = dataReader.GetDateTime("StartDate");
                drInfo.endDate = dataReader.GetDateTime("EndDate");
                drInfo.timeIntervalNull = dataReader.IsDBNull("TimeInterval");
                if (!drInfo.timeIntervalNull)
                {
                    drInfo.timeInterval = dataReader.GetInt32("TimeInterval");
                }
            }
            else
            {
                Assert.Fail("Unable to read the ArticleDateRange table");
            }
        }