Ejemplo n.º 1
0
 private void listarMunicipios()
 {
     DropDownListMunicipio.DataSource     = oMun.dtMunicipios(0);
     DropDownListMunicipio.DataTextField  = "Nombre_Municipio";
     DropDownListMunicipio.DataValueField = "Id_Municipio";
     DropDownListMunicipio.DataBind();
 }
Ejemplo n.º 2
0
    protected void GridViewListarUsuarios_SelectedIndexChanged(object sender, EventArgs e)
    {
        lblRegistradoError.Visible = false;
        GridViewRow row = GridViewListarUsuarios.SelectedRow;

        this.txtUsuario.Enabled             = false;
        this.txtContarsenia.Enabled         = false;
        this.txtConfirmarContraseña.Enabled = false;
        lbtnActualizar.Visible = true;
        if (row.Cells[12].Text == "")
        {
            txtNumero_Documento.Text   = row.Cells[1].Text;
            txtFechaRegistro.Text      = row.Cells[2].Text;
            txtNombre_Empleado.Text    = row.Cells[3].Text;
            txtApellido_Empleado.Text  = row.Cells[4].Text;
            txtDireccion_Empleado.Text = row.Cells[5].Text;
            txtTelefono_Empleado.Text  = row.Cells[6].Text;

            txtEmail_Empleado.Text   = row.Cells[7].Text;
            txtfecha_Nacimiento.Text = row.Cells[8].Text;

            //DropDownListSucursal.SelectedValue = row.Cells[13].Text;
            //DropDownListSucursal.DataTextField = row.Cells[10].Text;
            //DropDownListSucursal.DataBind();

            DropDownListMunicipio.SelectedValue = row.Cells[14].Text;
            DropDownListMunicipio.DataTextField = row.Cells[9].Text;
            DropDownListMunicipio.DataBind();
        }

        else if (row.Cells[12].Text != "")
        {
            //txtNumero_Documento.Text = row.Cells[1].Text;
            txtNumero_Documento.Text   = GridViewListarUsuarios.SelectedDataKey.Value.ToString();
            txtFechaRegistro.Text      = row.Cells[2].Text;
            txtNombre_Empleado.Text    = row.Cells[3].Text;
            txtApellido_Empleado.Text  = row.Cells[4].Text;
            txtDireccion_Empleado.Text = row.Cells[5].Text;
            txtTelefono_Empleado.Text  = row.Cells[6].Text;

            txtEmail_Empleado.Text   = row.Cells[7].Text;
            txtfecha_Nacimiento.Text = row.Cells[8].Text;

            //DropDownListSucursal.SelectedValue = row.Cells[13].Text;
            //DropDownListSucursal.DataTextField = row.Cells[10].Text;
            //DropDownListSucursal.DataBind();

            DropDownListMunicipio.SelectedValue = row.Cells[14].Text;
            DropDownListMunicipio.DataTextField = row.Cells[9].Text;
            DropDownListMunicipio.DataBind();
            lbtnRegistrarUsuario.Visible = false;
        }
    }