예제 #1
0
        XtraReport CreateAndInitializeReport(SalesReportType reportType)
        {
            var locator = GetService <Services.IReportLocator>();
            var report  = locator.GetReport(reportType) as XtraReport;

            switch (reportType)
            {
            case SalesReportType.Invoice:
                report.DataSource = new List <Order> {
                    CollectionViewModel.SelectedEntity
                };
                break;

            case SalesReportType.SalesReport:
                report.DataSource = CollectionViewModel.GetSaleSummaryInfos();
                break;

            case SalesReportType.SalesByStore:
                report.DataSource = CollectionViewModel.GetSaleAnalisysInfos();
                break;
            }
            return(report);
        }