Esempio n. 1
0
		private static void SampleInitDB()
		{
			PageObject page = new PageObject();

			page.Title = "Tralala";
			List<DataLibrary.Menu> subMenu = new List<Menu>();

			#region Menu
			page.Menu = new List<Menu>();
			Menu parent = new Menu(2, "About Us", "About", subMenu, page, null);
			page.Menu.Add(parent);

			subMenu.Add(new Menu(8, "About", "Company News", page, parent));
			subMenu.Add(new Menu(9, "About", "Our Team Work", page, parent));
			subMenu.Add(new Menu(10, "About", "History", page, parent));
			subMenu.Add(new Menu(11, "About", "Testimonials", page, parent));
			subMenu.Add(new Menu(12, "About", "Privacy Policy", page, parent));
			subMenu.Add(new Menu(13, "About", "Contact", page, parent));

			parent = new Menu(1, "Index", "Home", page, null);
			page.Menu.Add(parent);



			subMenu = new List<Menu>();
			parent = new Menu(3, "Services", "Services", subMenu, page, null);
			page.Menu.Add(parent);

			subMenu.Add(new Menu(14, "Services", "Company News", page, parent));
			subMenu.Add(new Menu(15, "Services", "Our Team Work", page, parent));
			subMenu.Add(new Menu(16, "Services", "History", page, parent));
			subMenu.Add(new Menu(17, "Services", "Testimonials", page, parent));


			subMenu = new List<Menu>();
			parent = new Menu(4, "Clients", "Clients", subMenu, page, null);
			page.Menu.Add(parent);
			subMenu.Add(new Menu(18, "Clients", "Company News", page, parent));
			subMenu.Add(new Menu(19, "Clients", "Our Team Work", page, parent));


			subMenu = new List<Menu>();
			parent = new Menu(5, "Products", "Products", subMenu, page, null);
			page.Menu.Add(parent);
			subMenu.Add(new Menu(14, "Products", "History", page, parent));
			subMenu.Add(new Menu(15, "Products", "Testimonials", page, parent));
			subMenu.Add(new Menu(16, "Products", "Privacy Policy", page, parent));
			subMenu.Add(new Menu(17, "Products", "Contact", page, parent));


			page.Menu.Add(new Menu(6, "Our Resources", "Resources", page, null));
			page.Menu.Add(new Menu(7, "Partners", "Partners", page, null));
			#endregion

			#region News
			page.News = new List<News>();
			page.News.Add(new News("GDP Increase of 3% - What does it mean?", "Seemingly never-ending woes about oil, war, and inflation have had the world bracing for recessions and hard economic times in general. But the The Company has experienced an unexpectedly high annualized growth rate of 3.3% in Q2.", DateTime.Now, page));
			page.News.Add(new News("Who says we don't want Foreign Investment?", "They only push for foreign investment via government invitations. They are very quiet about the way they invite foreign investment to their country. They have to be – they are communist, and are supposed to be self-sufficient.” Gary Brown said.", DateTime.Now.AddDays(-4), page));
			page.News.Add(new News("The Company Names Three to its Board", "The Company today announced that it has appointed three business leaders to its board of directors. At the same time a board secretary has been also appointed. “We’re delighted that John, Ronald, and Mary have joined our board.", DateTime.Now.AddDays(-10), page));
			page.News.Add(new News("GDP Increase of 3% - What does it mean?", "They only push for foreign investment via government invitations. They are very quiet about the way they invite foreign investment to their country. They have to be – they are communist, and are supposed to be self-sufficient.", DateTime.Now.AddDays(-1), page));
			page.News.Add(new News("Who says we don't want Foreign Investment?", "Seemingly never-ending woes about oil, war, and inflation have had the world bracing for recessions and hard economic times in general. But the The Company has experienced an unexpectedly high annualized growth rate of 3.3% in Q2.", DateTime.Now.AddDays(-2), page));
			#endregion

			#region Dynamic Content
			page.Content = new List<DynamicContent>();
			page.Content.Add(new DynamicContent(DynamicTypes.Main, "Welcome", "Welcome Text",
				@"<b>Our Company is a globally </b>operating provider of 
                    business services. Our highly professional employees develop
                    integrated service solutions and ideas for lasting successful business.
                    The Company is always there to provide any help and valuable advice our customer may need. We treat our customers as possessing partners, so they decide how extensive our services should be.<br/><br/>The purpose of our Company is to provide our customers with the best services in the field, while ensuring good values and commitment that build long-term partner relationships. We are able to achieve this by providing a trained dedicated staff, complete business services and immediate ...", "", page));
			page.Content.Add(new DynamicContent(DynamicTypes.Main, "Learn More", "Learn More",
			   "Our strength in finance and accounting lies in staff special expertise in systems development and implementation, workflow, system support and accounting services and the close integration of these areas. The combination of technical and business expertise is the foundation for integrated process solutions that meet the most stringent requirements.", "", page));
			page.Content.Add(new DynamicContent(DynamicTypes.Rep, "Our Advantage", "simple principles of service", "No matter the size of your business, our Company understands that it should run at maximum efficience. Needless to say, that we have everything for that. Our team is able to develop any network solutions that will increase productivity and save you millions. We are a prosperous, successul Company and we give all our clients our personal guarantee.", "", page));
			page.Content.Add(new DynamicContent(DynamicTypes.Rep, "Featured Services", "Finance and Accounting s", "Our strength in finance and accounting lies in staff special expertise in systems development and implementation, workflow, system support and accounting services and the close integration of these areas. The combination of technical and business expertise is the foundation for integrated process solutions that meet the most stringent requirements.", "", page));
			// List<DynamicContent> type2 = page.Content.Where(p => p.Type == DynamicTypes.Rep).ToList();
			#endregion
			if (page.Id == 0)
			{
				page.Save();
			}
			else
			{
				page.Update();
			}
		}