Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: pburgh01
Total crap. I'm goin' Linq2SQL with a table containing those values. More maintainability; you don't need to deploy a new webapp for every new program.

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.

57 posted on 02/21/2010 5:59:27 AM PST by Lazamataz (Do it for the children.)
[ Post Reply | Private Reply | To 51 | View Replies ]


To: Lazamataz

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.


66 posted on 02/21/2010 6:06:40 AM PST by pburgh01
[ Post Reply | Private Reply | To 57 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson