private void button3_Click(object sender, EventArgs e)
{
if (this.datosCorrectos())
{
bool huboCondicion = false;
string queryselect = QUERY_BASE;
if (!this.sePusoFiltro())
{
return;
}
queryselect = queryselect + " WHERE ";
if (/*txtFiltro1.TextLength != 0*/!Validacion.esVacio(txtFiltro1 , "No importa" , false))
{
string condicion = "ROL_NOMBRE" + " LIKE '%" + txtFiltro1.Text + "%'";
this.generarQuery(ref huboCondicion, ref queryselect, condicion);
}
if (/*txtFiltro2.TextLength != 0*/!Validacion.esVacio(txtFiltro2 , "No importa" , false))
{
string condicion = "ROL_NOMBRE = '" + txtFiltro2.Text + "'";
this.generarQuery(ref huboCondicion, ref queryselect, condicion);
}
if (/*!chkEstadoIgnorar.Checked*/!Validacion.estaCheckeadoCheck(chkEstadoIgnorar))
{
string condicion;
if (/*optEstadoAlta.Checked*/Validacion.estaCheckeadoOpt(optEstadoAlta))
{
condicion = "ROL_ESTADO = 1";
}
else
{
condicion = "ROL_ESTADO = 0";
}
this.generarQuery(ref huboCondicion, ref queryselect, condicion);
}
this.ejecutarConsulta(queryselect);
if (dg.Rows.Count == 0)
{
MessageBox.Show("No se han encontrado resultados en la consulta", "Informe", MessageBoxButtons.OK);
}
}
}