Example #1
0
        public void carregaCombos()
        {
            var cmbReport_Type = db.Report_Type
                                 .Where(w => w.ID != (int)TabReport_Type.Bank)
                                 .Select(x =>
                                         new DropDownlist()
            {
                Value = x.ID,
                Text  = x.Description
            }).ToList();

            var dropDownlist = new Camada.Dominio.Mensagens.DropDownlist();

            cmbReport_Type.Add(dropDownlist.AdicionarSelecione());
            ViewBag.cmbReport_Type = new SelectList(cmbReport_Type.OrderBy(o => o.Value), "Value", "Text");

            var cmbSHIFT_TYPE = db.SHIFT_TYPE
                                .Select(x =>
                                        new DropDownlist()
            {
                Value = x.ID,
                Text  = x.DESCRIPTION
            }).ToList();

            ViewBag.cmbSHIFT_TYPE = new SelectList(cmbSHIFT_TYPE.OrderBy(o => o.Value), "Value", "Text");
        }
Example #2
0
        public void carregaCombos()
        {
            var cmbIDCalc_Type = db.Calc_Type
                                 .Select(x =>
                                         new DropDownlist()
            {
                Value = x.ID,
                Text  = x.Description
            }).ToList();

            var dropDownlist = new Camada.Dominio.Mensagens.DropDownlist();

            cmbIDCalc_Type.Add(dropDownlist.AdicionarSelecione());
            ViewBag.IDCalc_Type = new SelectList(cmbIDCalc_Type.OrderBy(o => o.Value), "Value", "Text");

            //ViewBag.cmbEstado = new SelectList
            //    (
            //        new DropDownlist().ListaDDLEstado(),
            //        "Value",
            //        "Text"
            //    );

            //ViewBag.cmbTipoAto = new SelectList
            //    (
            //        new DropDownlist().ListaDDLTipoAto(),
            //        "Value",
            //        "Text"
            //    );

            //var cmbUnidade = db.V_UnidadeGestora
            //            .Where(w=>w.identificador > 0 && !string.IsNullOrEmpty(w.nomeUnidade)).Select(x =>
            //                    new DropDownlist()
            //                    {
            //                        Value = x.identificador,
            //                        Text = x.nomeUnidade
            //                    }).ToList();


            //var dropDownlist = new Camada.Dominio.Mensagens.DropDownlist();
            //cmbUnidade.Add(dropDownlist.AdicionarSelecione());
            //ViewBag.cmbUnidade = new SelectList(cmbUnidade.OrderBy(o=>o.Text), "Value","Text");
        }