Exemplo n.º 1
0
    static XtraReport CreateCustomerSalesSummaryReport(long customerID)
    {
        var report   = new CustomerSalesSummaryReport();
        var customer = DataProvider.Customers.FirstOrDefault(c => c.Id == customerID);

        if (customer != null)
        {
            report.DataSource = QueriesHelper.GetCustomerSaleOrderItemDetails(customer.Id, DataProvider.OrderItems);
        }
        return(report);
    }
Exemplo n.º 2
0
        XtraReport CreateAndInitializeReport(CustomerReportType reportType)
        {
            var locator = GetService <Services.IReportLocator>();
            var report  = locator.GetReport(reportType) as XtraReport;

            switch (reportType)
            {
            case CustomerReportType.SelectedContactDirectory:
                report.DataSource = CollectionViewModel.SelectedEntity.Employees;
                break;

            case CustomerReportType.ContactDirectory:
                report.DataSource = ViewModel.CustomerEmployees;
                break;

            case CustomerReportType.LocationsDirectory:
                report.DataSource = CollectionViewModel.Entities;
                break;

            case CustomerReportType.SalesDetail:
                var orders = QueriesHelper.GetCustomerSaleDetails(CollectionViewModel.SelectedEntityKey, CollectionViewModel.GetOrderItems());
                //((CustomerSalesDetailReport)report).SetChartData(orders.SelectMany(x => x.OrderItems).ToArray());
                report.DataSource = orders;
                break;

            case CustomerReportType.Profile:
                report.DataSource = new List <Customer> {
                    CollectionViewModel.SelectedEntity
                };
                break;

            case CustomerReportType.SalesSummary:
                report.DataSource = QueriesHelper.GetCustomerSaleOrderItemDetails(CollectionViewModel.SelectedEntity.Id, CollectionViewModel.GetOrderItems());
                break;
            }
            return(report);
        }
 public void PrintOrderSummaryReport()
 {
     ShowReport(ReportInfoFactory.CustomerSalesSummaryReport(QueriesHelper.GetCustomerSaleOrderItemDetails(SelectedEntity.Id, CreateUnitOfWork().OrderItems)), "SalesSummary");
 }