private DataTable Consultar() { var filtro = new StringBuilder(); if (StringHelpers.IsDate(this.txtDe.Text)) { filtro.Append(" AND A.DataEmissao >= CONVERT(DATETIME, '" + this.txtDe.Text + "', 103) "); } if (StringHelpers.IsDate(this.txtAte.Text)) { filtro.Append(" AND A.DataEmissao <= CONVERT(DATETIME, '" + this.txtAte.Text + "', 103) "); } if (this.cbEmpresa.SelectedValue.ToInt() > 0) { filtro.Append(" AND A.Empresa = '" + this.cbEmpresa.SelectedValue + "' "); } if (!string.IsNullOrEmpty(this.txtFilial.Text)) { filtro.Append(" AND A.Filial = '" + this.txtFilial.Text + "' "); } if (!string.IsNullOrEmpty(this.txtMemorando.Text)) { filtro.Append(" AND A.Memorando = '" + this.txtMemorando.Text + "' "); } if (!string.IsNullOrEmpty(this.txtDUE.Text)) { filtro.Append(" AND C.DUE = '" + this.txtDUE.Text + "' "); } if (!string.IsNullOrEmpty(this.txtChaveDUE.Text)) { filtro.Append(" AND C.ChaveAcesso = '" + this.txtChaveDUE.Text + "' "); } if (!string.IsNullOrEmpty(this.txtChaveNF.Text)) { filtro.Append(" AND A.ChaveNF LIKE '%" + this.txtChaveNF.Text + "%' "); } if (!string.IsNullOrEmpty(this.txtNumeroNF.Text)) { filtro.Append(" AND A.NumeroNF = '" + this.txtNumeroNF.Text + "' "); } if (!string.IsNullOrEmpty(this.txtCNPJ.Text)) { filtro.Append(" AND A.CNPJNF = '" + this.txtCNPJ.Text.Replace(".", "").Replace("/", "").Replace("-", "") + "' "); } return(_notaFiscalDAO.ListagemMemorando(filtro.ToString())); }