Exemplo n.º 1
0
        public void Run()
        {
            DataTable dt = new d.StagingMenuData().GetOrdered().Tables[0];

            Console.WriteLine("count=" + dt.Rows.Count);
            ba.PublicMenuTree pmt = new ba.PublicMenuTree(ba.PublicMenuTree.ConvertData(dt), -1, "../");
        }
Exemplo n.º 2
0
 private void updateMenu()
 {
     dt.StagingMenuData smd = new dt.StagingMenuData();
     smd.UpdatePage(homeMenuId, homePageId);
     smd.UpdatePage(newsMenuId, newsListPageId);
     smd.UpdatePage(dstoryMenuId, dstoryListPageId);
     smd.UpdatePage(collegeMenuId, collegeListPageId);
     smd.UpdatePage(dptMenuId, dptListPageId);
     smd.UpdatePage(progMenuId, progListPageId);
     smd.UpdatePage(givingMenuId, givingPageId);
 }
Exemplo n.º 3
0
 private void loadMenu()
 {
     dt.StagingMenuData smd = new dt.StagingMenuData();
     homeMenuId    = smd.CreateLocked(CmsPageData.NO_PARENT, "Home", -1);
     newsMenuId    = smd.Create(CmsPageData.NO_PARENT, "News", 1);
     dstoryMenuId  = smd.Create(CmsPageData.NO_PARENT, "Donor Stories", 2);
     givingMenuId  = smd.Create(CmsPageData.NO_PARENT, "Giving Opportunities", 3);
     collegeMenuId = smd.Create(givingMenuId, "Colleges", 0);
     dptMenuId     = smd.Create(givingMenuId, "Departments", 1);
     progMenuId    = smd.Create(givingMenuId, "Programs", 2);
 }
Exemplo n.º 4
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);
                }
            }
        }