66 lines
2.0 KiB
C#
66 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace BeWoImFlow
|
|
{
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
{
|
|
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
{
|
|
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay);
|
|
|
|
if (lROs.Count > 0)
|
|
{
|
|
var rootReport = CreateServicesOverviewReportForRo(lROs[0]);
|
|
rootReport.CreateDocument();
|
|
|
|
for (int i = 1; i < lROs.Count; i++)
|
|
{
|
|
var lNext = CreateServicesOverviewReportForRo(lROs[i]);
|
|
lNext.CreateDocument();
|
|
rootReport.Pages.AddRange(lNext.Pages);
|
|
}
|
|
|
|
return rootReport;
|
|
}
|
|
return new XtraReport();
|
|
}
|
|
|
|
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
{
|
|
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
|
|
|
return CreateServicesOverviewReportForRo(ro);
|
|
|
|
}
|
|
|
|
public override XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, string reportId)
|
|
{
|
|
return CreateServicesOverviewReportForRo(ro);
|
|
}
|
|
|
|
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro)
|
|
{
|
|
IBeWoReport<ServicesOverviewRO> report = null;
|
|
|
|
if (!String.IsNullOrWhiteSpace(ro.Costbearer) && (ro.Costbearer.ToLower().Contains("lvr")))
|
|
{
|
|
if (ro.StartDate >= new DateTime(2019, 1, 1))
|
|
{
|
|
report = new BeWoImFlow.Quittierungsbeleg();
|
|
}
|
|
}
|
|
if (report == null)
|
|
report = new BeWoImFlow.Stundenzettel();
|
|
report.SetReportDataSource(ro);
|
|
|
|
return report as XtraReport;
|
|
}
|
|
}
|
|
}
|