private void btnExec_Click(object sender, EventArgs e) { // TODO varrer lista de controles, usar as TAGs pra fazer os filtros. StringBuilder filtro = new StringBuilder(); foreach (Control c in panelParams.Controls) { string _and = string.IsNullOrEmpty(filtro.ToString()) ? "" : " AND "; if (c.GetType() == typeof(TextBox)) { TextBox texto = c as TextBox; filtro.AppendLine(_and + texto.Tag.ToString().Replace("@?@", texto.Text)); } if (c.GetType() == typeof(DateTimePicker)) { DateTimePicker data = c as DateTimePicker; filtro.AppendLine(_and + data.Tag.ToString().Replace("@?@", data.Value.ToString("yyyyMMdd"))); } } Report cReport = new Report(); cReport.LOAD(this.RELATORIO.NOME, false); cReport.TABLE.FILTROPARAMETRO = filtro.ToString(); gridWindow grid = new gridWindow(cReport.TABLE.QUERY.ToString(), null); grid.SetGridHeader(cReport.TABLE.FIELDS.TOGRID); grid.showWindow(); }
private void btnShowData_Click(object sender, EventArgs e) { try { gridWindow grid = new gridWindow(this.TABLE.QUERY.ToString(), null); grid.SetGridHeader(this.TABLE.FIELDS.TOGRID); grid.showWindow(this.Form); } catch (Exception EX) { new ERROR(Carralero.ExceptionControler.getFullException(EX)).SHOW(); } }