Exemplo n.º 1
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            if (IsValid == false)
            {
                MessageBox.Show(AllErrors.ErrorMessageString(), Constants.ALERTMESSAGEHEADER);
                return;
            }

            var transactionType = (TransactionType)Enum.Parse(typeof(TransactionType), cboTransactionType.SelectedItem.ToString());

            var request = new TaxInvoiceReportRequest
            {
                TransactionNumber = txtInvoiceNo.Text,
                TransactionType   = transactionType
            };

            var response       = new TaxInvoiceReportResponse();
            var reportDocument = new ReportDocument();

            if (rdoDetail.Checked)
            {
                response = _reportService.GetTransactionDetailReport(request);
                reportDocument.Load(ReportUtility.GetTaxInvoiceDetailReportPath(transactionType));
            }
            else if (rdoSummary.Checked)
            {
                response = _reportService.GetTransactionSumaryReport(request);
                reportDocument.Load(ReportUtility.GetTaxInvoiceSummaryReportPath(transactionType));
            }

            if (false == response.IsValid)
            {
                MessageBox.Show(response.AllErrors.ErrorMessageString(), Constants.ALERTMESSAGEHEADER);
                crystalReportViewer.ReportSource = null;
                return;
            }

            if (rdoDetail.Checked)
            {
                reportDocument.SetDataSource(response.TaxInvoiceDetailDataSet);
            }
            else if (rdoSummary.Checked)
            {
                reportDocument.SetDataSource(response.TaxInvoiceSummaryDataSet);
            }

            crystalReportViewer.ReportSource = reportDocument;
            crystalReportViewer.Refresh();
        }
Exemplo n.º 2
0
        private void ShowSummartyReport(int id)
        {
            var             lookup          = _transactionService.GetJewelTransactionsLookUpById(id);
            TransactionType transactionType = lookup.TransactionType;

            var request = new TaxInvoiceReportRequest
            {
                TransactionNumber = lookup.MemoNumber,
                TransactionType   = transactionType
            };

            var response = _reportService.GetTransactionSumaryReport(request);

            var orderReport = new frmReport
            {
                ReportPath    = ReportUtility.GetTaxInvoiceSummaryReportPath(transactionType),
                ReportDataSet = response.TaxInvoiceSummaryDataSet
            };

            orderReport.Show();
        }