72 lines
2.7 KiB
C#
72 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace AssistenzaReports
|
|
{
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
{
|
|
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
{
|
|
if (empOid > 0)
|
|
{
|
|
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, 0, startDay, endDay, serviceCategoryOid);
|
|
|
|
if (lROs.Count > 0)
|
|
{
|
|
var e = DAOFactory.GenericDAO.LoadByID<Employee>(empOid);
|
|
foreach (var ro in lROs)
|
|
{
|
|
ro.MainAttendant = e.Person.FirstNameLastName;
|
|
}
|
|
var lServiceOverviewAllCustomersReport = this.FindReportImp<ServicesOverviewRO>();
|
|
lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
|
|
(lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
|
|
var Report = lServiceOverviewAllCustomersReport as XtraReport;
|
|
|
|
for (int i = 1; i < lROs.Count; i++)
|
|
{
|
|
var lNext = FindReportImp<ServicesOverviewRO>();
|
|
lNext.SetReportDataSource(lROs[i]);
|
|
(lNext as XtraReport).CreateDocument();
|
|
Report.Pages.AddRange((lNext as XtraReport).Pages);
|
|
}
|
|
|
|
return lServiceOverviewAllCustomersReport as XtraReport;
|
|
}
|
|
return new XtraReport();
|
|
}
|
|
|
|
return base.CreateServiceOverviewAllCustomersReport(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
}
|
|
|
|
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
{
|
|
if (empOid > 0)
|
|
{
|
|
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, 0, startDay, endDay, serviceCategoryOid);
|
|
|
|
var e = DAOFactory.GenericDAO.LoadByID<Employee>(empOid);
|
|
|
|
ro.MainAttendant = e.Person.FirstNameLastName;
|
|
|
|
var lServiceOverviewSingleCustomerReport = this.FindReportImp<ServicesOverviewRO>(null);
|
|
lServiceOverviewSingleCustomerReport.SetReportDataSource(ro);
|
|
|
|
return lServiceOverviewSingleCustomerReport as XtraReport;
|
|
}
|
|
|
|
return base.CreateServiceOverviewSingleCustomerReport(customerOid, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
}
|
|
|
|
}
|
|
}
|