protected void btnEliminar_Click(object sender, EventArgs e) { if (gwProveedores.SelectedValue == null) { MostrarMensajeCheto("Seleccione una Fila antes de continuar :)"); return; } Panel1.Visible = false; pnlAgregar.Visible = false; pnlConsultar.Visible = true; btnConfElimCon.Visible = true; btnConfModificar.Visible = false; btnConfAgregar.Visible = false; lblAccion.Text = " Eliminando"; int idProveedor = (int)gwProveedores.SelectedValue; try { IngelunEntidades.Proveedor Prov = GestorProveedores.buscarPorId(idProveedor); txtIdProveedorConsulta.Text = Prov.id_Proveedor.ToString(); txtNombreConsulta.Text = Prov.nombre; txtDireccionConsulta.Text = Prov.direccion.ToString(); txtEmailConsulta.Text = Prov.mail.ToString(); txtTelefonoConsulta.Text = Prov.telefono.ToString(); txtNumeroDocumentoConsulta.Text = Prov.numeroDocumento.ToString(); txtCodigoPostalConsulta.Text = Prov.codigo_Postal.ToString(); if (Prov.fechaNac != null) { string fecha = Prov.fechaNac.ToString(); DateTime fechaNacimiento = DateTime.Parse(fecha); txtFechaNacimientoConsulta.Text = fechaNacimiento.ToShortDateString(); } else { txtFechaNacimientoConsulta.Text = ""; } chBoxEfectivoConsulta.Checked = Prov.soloEfectivo; ddlProveedorConsulta.SelectedIndex = (int)Prov.id_tipo_dni; } catch (Exception ex) { lblMensaje.Text = ex.Message; } btnConfElim.Visible = true; }