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); }
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); } } }