private void buscar() { clsZone oClsZone = new clsZone(); clsContactCFE oClsContactoCFE = new clsContactCFE(); DataTable dtZone; StringBuilder strHTMLGroup = new StringBuilder(); try { msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "none"); string strDivision = ddl_Divisiones.Items[ddl_Divisiones.SelectedIndex].Value; string strZone = string.Empty; if (ddl_Zonas.SelectedIndex != -1) { strZone = ddl_Zonas.Items[ddl_Zonas.SelectedIndex].Value; } dtZone = oClsContactoCFE.ValidateFilters(strDivision, strZone); if (dtZone == null) { ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('','Error al recuperar los datos','warning');", true); //msgErrorSearch.InnerText = ""; //msgErrorSearch.Style.Add("display", "inline"); //msgErrorSearch.InnerText = "Error al recuperar los datos"; } else { if (dtZone.Rows.Count > 0) { strHTMLGroup = oClsContactoCFE.ReturnHTMLDivision(dtZone); DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTMLGroup.ToString() }); } else { //msgErrorSearch.InnerText = ""; //msgErrorSearch.Style.Add("display", "inline"); //msgErrorSearch.InnerText = "No hay datos para mostrar"; ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('','No hay datos para mostrar','warning');", true); } } } catch (Exception ex) { clsError.logMessage = ex.ToString(); clsError.logModule = "btnSearch_Click"; clsError.LogWrite(); msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "inline"); msgErrorSearch.InnerHtml = ex.ToString(); } }
private void Buscar() { clsZone oClsZone = new clsZone(); clsContactCFE oClsContactoCFE = new clsContactCFE(); DataTable dtZone; StringBuilder strHTMLGroup = new StringBuilder(); try { msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "none"); string strDivision = cmbSearchDivision.Items[cmbSearchDivision.SelectedIndex].Value; string strZone = string.Empty; if (cmbSearchZone.SelectedIndex != -1) { strZone = cmbSearchZone.Items[cmbSearchZone.SelectedIndex].Value; } dtZone = oClsContactoCFE.ValidateFilters(strDivision, strZone); if (dtZone == null) { msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "inline"); msgErrorSearch.InnerText = "Error al recuperar los datos"; } else { if (dtZone.Rows.Count > 0) { strHTMLGroup = oClsContactoCFE.ReturnHTMLDivision(dtZone); DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTMLGroup.ToString() }); } else { msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "inline"); msgErrorSearch.InnerText = "No hay datos para mostrar"; } } } catch (Exception ex) { clsError.logMessage = ex.ToString(); clsError.logModule = "btnSearch_Click"; clsError.LogWrite(); msgErrorSearch.InnerText = ""; msgErrorSearch.Style.Add("display", "inline"); msgErrorSearch.InnerHtml = ex.ToString(); } }