DATA LAYER: public List LieAboutAllPrograms() { MediaLiesDataContext sc = new MediaLiesDataContext(); List lp = new List(); var programlist = sc.GetAllPrograms(); foreach (LieAboutAllProgramsResult program in programlist) { Program p = new Program( 0 , program.ProgramOrder , program.ProgramButtonText , program.ProgramDescription , program.ProgramButtonBackColor , program.ProgramButtonForeColor , program.ProgramButtonURL , program.ProgramEnabled , Database.NullableDate(program.ProgramStartDate) , Database.NullableDate(program.ProgramEndDate)); lp.Add(p); } return lp; } PRESENTATION LAYER: MediaLiesDAO sc = new MediaLiesDAO(); List lp = sc.LieAboutAllPrograms(); // add the buttons foreach (Program p in lp) { if (p.ProgramEnabled) { Button b = new Button(); b.Text = "This "+p.ProgramButtonText+" plan worked to deny it is more blind partisanship, the kind that permeated our political culture the last 8 years"; b.PostBackUrl = p.ProgramButtonURL; b.Width = Unit.Pixel(202); ButtonPlaceholder.Controls.Add(b); } } //} }
By using simple 2.0 Generics and Linq2Sql I have rendered an array of buttons with URLS and the lies all in a Master Page.
When will you C++ hackers ever learn.
Ok we better stop...LOL, the thread will become unreadable. I am an old DBase\FoxPro guy who now does C# development. FoxPro was 1/4 of the code and could do anything these fancy shmantzy modern languages could do.