protected void Button_BUSQUEDA_AVANZADA_Click(object sender, EventArgs e) { if (CheckBox_RAZ_SOCIAL.Checked == true || CheckBox_CUMPLIDO.Checked == true || CheckBox_CANCELADO.Checked == true || CheckBox_REGIONAL.Checked == true || CheckBox_CIUDAD.Checked == true || CheckBox_PSICOLOGO.Checked == true || CheckBox_TIPO.Checked == true || CheckBox_FECHA_REQ.Checked == true) { String RAZ_SOCIAL = null; String CUMPLIDO = null; String CANCELADO = null; String REGIONAL = null; String CIUDAD = null; String PSICOLOGO = null; String TIPO = null; DateTime FECHA_INICIAL = new DateTime(); DateTime FECHA_FINAL = new DateTime(); if (CheckBox_RAZ_SOCIAL.Checked) { RAZ_SOCIAL = TextBox_RAZON_SOCIAL.Text; } if(CheckBox_CUMPLIDO.Checked) { CUMPLIDO = DropDownList_CUMPLIDOS.SelectedItem.ToString(); } if (CheckBox_CANCELADO.Checked) { CANCELADO = DropDownList_CANCELADOS.SelectedItem.ToString(); } if (CheckBox_REGIONAL.Checked) { REGIONAL = DropDownList_REGIONALES.SelectedItem.ToString(); } if (CheckBox_CIUDAD.Checked) { CIUDAD = DropDownList_CIUDAD.SelectedItem.ToString(); } if (CheckBox_PSICOLOGO.Checked) { PSICOLOGO = DropDownList_PSICOLOGO.SelectedValue.ToString(); } if (CheckBox_TIPO.Checked) { TIPO = DropDownList_Tipo.SelectedValue.ToString(); } if (CheckBox_FECHA_REQ.Checked) { tools _tool = new tools(); if((String.IsNullOrEmpty(TextBox_FECHA_FINAL.Text))||(String.IsNullOrEmpty(TextBox_FECHA_INICIAL.Text))) { configurarMensajes(true, System.Drawing.Color.Orange); Label_MENSAJE.Text = "Los Campos de Fecha inicial y Fecha final son requeridos"; } else { FECHA_FINAL = Convert.ToDateTime(TextBox_FECHA_FINAL.Text.ToString()); FECHA_INICIAL = Convert.ToDateTime(TextBox_FECHA_INICIAL.Text.ToString()); } } requisicion _req = new requisicion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaReq = _req.ObtenerRequisicionesPorFiltro(RAZ_SOCIAL, CUMPLIDO, CANCELADO, REGIONAL, CIUDAD, PSICOLOGO, TIPO, FECHA_INICIAL, FECHA_FINAL); if (!(String.IsNullOrEmpty(_req.MensajeError))) { configurarMensajes(true, System.Drawing.Color.Orange); Label_MENSAJE.Text = "Para poder generar el reporte debe seleccionar por lo menos un parámetro de busqueda."; } if (tablaReq.Rows.Count <= 0) { configurarMensajes(true, System.Drawing.Color.Orange); Label_MENSAJE.Text = "No se encontraron resulados para la busqueda, con los parámetros seleccionados."; Panel_GRID_RESULTADOS.Visible = false; Panel_FORM_BOTONES.Visible = true; } else { GridView_RESULTADOS_BUSQUEDA.DataSource = tablaReq; GridView_RESULTADOS_BUSQUEDA.DataBind(); Panel_GRID_RESULTADOS.Visible = true; Panel_FORM_BOTONES.Visible = true; } } else { configurarMensajes(true, System.Drawing.Color.Orange); Label_MENSAJE.Text = "Para poder generar el reporte debe seleccionar por lo menos un parámetro de busqueda."; } }