private void btnBuscarPropiedad_Click(object sender, EventArgs e) { try { DataTable tablaResultado = AD_Propiedades.GetPropiedadesPorDesigCatastral(int.Parse(txtDesigCatastral.Text.Trim())); if (tablaResultado.Rows.Count > 0) { txtCalle.Text = tablaResultado.Rows[0][1].ToString(); txtNroCalle.Text = tablaResultado.Rows[0][2].ToString(); txtIDBarrio.Text = tablaResultado.Rows[0][3].ToString(); } else { MessageBox.Show("Propiedad no encontrada"); txtDesigCatastral.Focus(); txtCalle.Text = ""; txtNroCalle.Text = ""; txtIDBarrio.Text = ""; } } catch (Exception ex) { MessageBox.Show("Error al obtener propiedad"); } }
private void btnBuscar_Click(object sender, EventArgs e) { if (txtDesigCat.Text.Equals("")) { MessageBox.Show("Selecciona una Designacion Catastral para Buscar", "Advertencia!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtDesigCat.Focus(); } else { grillaPropiedades.DataSource = AD_Propiedades.GetPropiedadesPorDesigCatastral(int.Parse(txtDesigCat.Text)); btnReporte.Enabled = true; if (grillaPropiedades.Rows.Count == 0) { btnReporte.Enabled = false; MessageBox.Show("No se encontraron resultados!", "Aviso!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } txtDesigCat.Focus(); limpiarCampos(); }
private void btnBuscar_Click(object sender, EventArgs e) { if (chkMostrarTodasProp.Checked) { CargarGrillaPropiedades(); } else if (txtDesigCat.Text.Equals("")) { MessageBox.Show("Selecciona algun filtro!", "Advertencia!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtDesigCat.Focus(); } else { grillaPropiedades.DataSource = AD_Propiedades.GetPropiedadesPorDesigCatastral(int.Parse(txtDesigCat.Text)); if (grillaPropiedades.Rows.Count == 0) { MessageBox.Show("No se encontraron resultados!", "Aviso!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } txtDesigCat.Text = ""; txtDesigCat.Focus(); chkMostrarTodasProp.Checked = false; }