Exemplo n.º 1
0
        public static void ComboBooleano(ref DropDownList oddl, bool IncluirValorInicial = true)
        {
            List <ComboBool> lstCombo = new List <ComboBool>();

            ComboBool oCombo = new ComboBool();

            if (IncluirValorInicial == true)
            {
                oCombo.id          = "null";
                oCombo.descripcion = " -TODO- ";
                lstCombo.Add(oCombo);
            }

            oCombo             = new ComboBool();
            oCombo.id          = "NO";
            oCombo.descripcion = " NO ";
            lstCombo.Add(oCombo);

            oCombo             = new ComboBool();
            oCombo.id          = "SI";
            oCombo.descripcion = " SI ";
            lstCombo.Add(oCombo);

            oddl.DataSource     = lstCombo;
            oddl.DataValueField = "id";
            oddl.DataTextField  = "descripcion";
        }
Exemplo n.º 2
0
        public static void ComboAnnosConstancia(ref DropDownList oddl, bool IncluirValorInicial = true)
        {
            List <ComboBool> lstCombo = new List <ComboBool>();

            ComboBool oCombo = new ComboBool();

            if (IncluirValorInicial == true)
            {
                oCombo.id          = "0";
                oCombo.descripcion = " -Seleccionar año- ";
                lstCombo.Add(oCombo);
            }

            oCombo             = new ComboBool();
            oCombo.id          = "2008";
            oCombo.descripcion = " 2008 ";
            lstCombo.Add(oCombo);

            oCombo             = new ComboBool();
            oCombo.id          = "2009";
            oCombo.descripcion = " 2009 ";
            lstCombo.Add(oCombo);

            oCombo             = new ComboBool();
            oCombo.id          = "2010";
            oCombo.descripcion = " 2010 ";
            lstCombo.Add(oCombo);

            oCombo             = new ComboBool();
            oCombo.id          = "2011";
            oCombo.descripcion = " 2011 ";
            lstCombo.Add(oCombo);

            oCombo             = new ComboBool();
            oCombo.id          = "2012";
            oCombo.descripcion = " 2012 ";
            lstCombo.Add(oCombo);

            oddl.DataSource     = lstCombo;
            oddl.DataValueField = "id";
            oddl.DataTextField  = "descripcion";
        }