Esempio n. 1
0
        private void cargarMunicipios(string dat)

        {
            try
            {
                DropDownListmunicipiocontrato.Items.Clear();
                DropDownListmunicipiocontrato.Items.Add(new ListItem("Seleccione", "Seleccione"));
                munic.departamento_iddepartamento            = dat;
                DropDownListmunicipiocontrato.DataSource     = Validar.Consulta(munic.ConsultarMunicipioIdDepartamento(munic));
                DropDownListmunicipiocontrato.DataTextField  = "municipio";
                DropDownListmunicipiocontrato.DataValueField = "idmunicipio";
                DropDownListmunicipiocontrato.DataBind();
            }
            catch (Exception ex)
            {
                textError.InnerHtml = ex.Message;
                Alerta.CssClass     = "alert alert-error";
                Alerta.Visible      = true;
            }
        }
Esempio n. 2
0
 protected void departamentobarrio_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         municipiobarrio.Items.Clear();
         municipiobarrio.Items.Add(new ListItem("Seleccione", "Seleccione"));
         munic.departamento_iddepartamento = Validar.validarselected(departamentobarrio.SelectedValue);
         municipiobarrio.DataSource        = Validar.Consulta(munic.ConsultarMunicipioIdDepartamento(munic));
         municipiobarrio.DataTextField     = "municipio";
         municipiobarrio.DataValueField    = "idmunicipio";
         municipiobarrio.DataBind();
         ClientScript.RegisterStartupScript(GetType(), "alerta", "panel2();", true);
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
         ClientScript.RegisterStartupScript(GetType(), "alerta", "panel2();", true);
     }
 }
Esempio n. 3
0
 protected void DropDownListdepartamento_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DropDownListmunicipio.Items.Clear();
         DropDownListmunicipio.Items.Add(new ListItem("Seleccione", "Seleccione"));
         munic.departamento_iddepartamento    = Validar.validarselected(DropDownListdepartamento.SelectedValue);
         DropDownListmunicipio.DataSource     = Validar.Consulta(munic.ConsultarMunicipioIdDepartamento(munic));
         DropDownListmunicipio.DataTextField  = "municipio";
         DropDownListmunicipio.DataValueField = "idmunicipio";
         DropDownListmunicipio.DataBind();
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }