Ejemplo n.º 1
0
        private async Task <Stream> GetEstimateReportPdfStreamAsync(IRepairEstimateDataSource estimate, IEnumerable <IRepairEstimateLineItemsDataSource> estimateLineItems)
        {
            var rds = new ReportDataSource
            {
                Name  = "RepairEstimate",
                Value = new List <IRepairEstimateDataSource> {
                    estimate
                }
            };

            if (!estimateLineItems.Any())
            {
                estimateLineItems = new List <IRepairEstimateLineItemsDataSource>()
                {
                    new RepairEstimateLineItemsDataSource()
                    {
                        TypeOfScan     = "<No Estimated Scans>",
                        EstimateAmount = 0
                    }
                };
            }

            var li = new ReportDataSource
            {
                Name  = "EstimateLineItems",
                Value = estimateLineItems
            };

            return(await GenerateStream.ReportToPdfAsync(EstimateReport, new[] { rds, li }));
        }
Ejemplo n.º 2
0
        private async Task <Stream> GetInvoiceReportPdfStreamAsync(IRepairInvoiceDataSource invoice, IEnumerable <IRepairInvoiceLineItemsDataSource> invoiceLineItems)
        {
            var rds = new ReportDataSource
            {
                Name  = "RepairInvoice",
                Value = new List <IRepairInvoiceDataSource> {
                    invoice
                }
            };

            if (!invoiceLineItems.Any())
            {
                invoiceLineItems = new List <IRepairInvoiceLineItemsDataSource>()
                {
                    new RepairInvoiceLineItemsDataSource()
                    {
                        WorkPerfomed  = "<No Invoiced Scans>",
                        InvoiceAmount = 0
                    }
                };
            }

            var li = new ReportDataSource
            {
                Name  = "LineItems",
                Value = invoiceLineItems
            };

            return(await GenerateStream.ReportToPdfAsync(InvoiceReport, new[] { rds, li }));
        }
Ejemplo n.º 3
0
        private async Task <Stream> GetScanReportPdfStreamAsync(IScanReportDataSource dataSource)
        {
            var rds = new ReportDataSource
            {
                Name  = "ScanReportDataSource",
                Value = new List <IScanReportDataSource>()
                {
                    dataSource
                }
            };

            return(await GenerateStream.ReportToPdfAsync(ScanReport, new[] { rds }));
        }
Ejemplo n.º 4
0
        private async Task <Stream> GetStatementReportPfdStreamAsync(IStatementDataSource statement,
                                                                     IEnumerable <IStatementLineItemsDataSource> statementLineItems)
        {
            var rds = new ReportDataSource
            {
                Name  = "Statement",
                Value = new List <IStatementDataSource>()
                {
                    statement
                }
            };

            var li = new ReportDataSource
            {
                Name  = "InvoiceLineItems",
                Value = statementLineItems
            };

            return(await GenerateStream.ReportToPdfAsync(StatementReport, new[] { rds, li }));
        }