예제 #1
0
        private void CarregarEstado()
        {
            Regras.Regras dados   = new Regras.Regras();
            var           estados = dados.GetAllEstado();

            DropDownListEstado.DataSource     = estados;
            DropDownListEstado.DataValueField = "IdEstado";
            DropDownListEstado.DataTextField  = "SiglaEstado";
            DropDownListEstado.DataBind();
            DropDownListEstado.Items.Insert(0, new ListItem("-Selecione-", "0"));
            Session["Estados"] = estados;
        }
예제 #2
0
        //obtenemos el catalogo del estado
        private Boolean PoblarDropDownListEstado()
        {
            bool ok = false;

            DropDownListEstado.DataTextField  = "Descripcion";
            DropDownListEstado.DataValueField = "IdValue";

            try
            {
                DropDownListEstado.DataSource = AdministradorCatalogos.ObtenerCatalogoEstados();
                DropDownListEstado.DataBind();

                DropDownListEstado.Items.Add("TODAS");
                this.DropDownListEstado.Items.FindByText("TODAS").Selected = true;

                ok = true;
            }
            catch (Exception ex)
            {
                Msj = "Ha ocurrido un error al cargar la lista de estados. Contacta al área de sistemas.";
                this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>";

                BitacoraExcepcion BitacoraExcepcionAplictivo = new BitacoraExcepcion
                {
                    CadenaconexionBD = System.Configuration.ConfigurationManager.ConnectionStrings["cnArrendamientoInmueble"].ConnectionString,
                    Aplicacion       = "ContratosArrto",
                    Modulo           = MethodInfo.GetCurrentMethod().DeclaringType.ToString() + ".aspx",
                    Funcion          = MethodBase.GetCurrentMethod().Name + "()",
                    DescExcepcion    = ex.InnerException == null ? ex.Message : ex.InnerException.Message,
                    Usr = ((SSO)Session["Contexto"]).UserName.ToString()
                };

                BitacoraExcepcionAplictivo.RegistrarBitacoraExcepcion();
                BitacoraExcepcionAplictivo = null;
            }


            return(ok);
        }