Esempio n. 1
0
 private void loadCustomPages()
 {
     dt.PageData pd = new dt.PageData();
     homePageId        = pd.Create(homeMenuId, standardCatId, false, true, false, false, "", "UNI Foundation Homepage", "", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "default.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "This is the website's homepage.", userId);
     newsListPageId    = pd.Create(newsMenuId, standardCatId, false, true, false, false, "", "News Archive", "News Archive", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "newsList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published news.", userId);
     dstoryListPageId  = pd.Create(dstoryMenuId, standardCatId, false, true, false, false, "", "Donor Stories", "Donor Stories", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "dstoryList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published donor stories.", userId);
     collegeListPageId = pd.Create(collegeMenuId, standardCatId, false, true, false, false, "", "Colleges", "Colleges", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "collegeList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published college pages.", userId);
     dptListPageId     = pd.Create(dptMenuId, standardCatId, false, true, false, false, "", "Departments", "Departments", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "departmentList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published department pages.", userId);
     progListPageId    = pd.Create(progMenuId, standardCatId, false, true, false, false, "", "Programs", "Programs", "", true, false, false, false, false, true, ConfigurationHelper.PublicWebsiteRoot + "programList.aspx?id=" + UrlHelper.PAGE_ID_PREFIX, "Displays a list of published program pages.", userId);
     givingPageId      = pd.Create(givingMenuId, standardCatId, true, true, true, true, "", "Giving Opportunities", "Giving Opportunities", "", true, true, true, true, false, true, ConfigurationHelper.PublicWebsiteRoot + UrlHelper.PUBLIC_STANDARD_PAGE + "?id=" + UrlHelper.PAGE_ID_PREFIX, "", userId);
 }
Esempio n. 2
0
        private void loadPages()
        {
            Console.WriteLine("loading pages");
            DataTable dtMenu = new d.StagingMenuData().GetOrdered().Tables[0];

            d.PageData pd = new d.PageData();
            //create 10 pages for each menu
            string partialUrl = ba.UrlHelper.BuildPagePartialUrlByPageCategory(ba.PageCategoryCode.StandardPage);

            foreach (DataRow dr in dtMenu.Rows)
            {
                for (int i = 0; i < 10; i++)
                {
                    int menuId = Convert.ToInt32(dr[0]);
                    if (menuId != 1) //all except home
                    {
                        pd.Create(menuId, 1, true, true, true, true, "", "page title " + Convert.ToInt32(dr[0]) + "-" + i, getRandomText(4, 80), getRandomText(500, 5000),
                                  true, false, false, false, false, true, partialUrl, getRandomText(50, 500), 1);
                    }
                }
            }

            //assign menus to pages
            d.StagingMenuData smd = new d.StagingMenuData();
            int pageId;

            d.Page    page;
            DataTable dtPages;

            foreach (DataRow dr in dtMenu.Rows)
            {
                int menuId = Convert.ToInt32(dr[0]);
                if (menuId != 1)
                {
                    dtPages = pd.GetPublishedByMenuId(menuId);
                    pageId  = Convert.ToInt32(dtPages.Rows[rnd.Next(dtPages.Rows.Count)][0]);
                    page    = new d.Page(pageId);
                    smd.UpdatePage(menuId, pageId);
                }
            }
        }