コード例 #1
0
        private void btVisualizar_Click(object sender, EventArgs e)
        {
            BIZFrete    bizFrete          = new BIZFrete();
            ReportClass relat             = new ReportClass();
            DataTable   dt                = new DataTable();
            string      filtro            = string.Empty;
            string      filtroRelatorio   = string.Empty;
            string      msgRetorno        = string.Empty;
            string      periodoVencimento = string.Empty;

            msgRetorno = this.ValidarFiltro();

            if (msgRetorno == string.Empty)
            {
                this.Cursor = Cursors.WaitCursor;

                filtro          = this.MontarFiltroSQL();
                filtroRelatorio = this.MontarFiltroRelatorio();

                dt = bizFrete.GerarRelatorio(filtro, filtroRelatorio);

                relat = new FretesGerados();
                relat.SetDataSource(dt);
                Relatorio relatorioFrete = new Relatorio(relat);
                relatorioFrete.Text = "Relatório de Fretes";

                this.Cursor = Cursors.Default;

                relatorioFrete.ShowDialog();
            }
            else
            {
                MessageBox.Show("Atenção: " + msgRetorno, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }