92 lines
3.4 KiB
C#
92 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Remoting.Messaging;
|
|
using System.Text;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace HphBersenbrueckAph
|
|
{
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
{
|
|
//public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
//{
|
|
// DateTime startDate = new DateTime(year, month, 1);
|
|
|
|
// if (startDay == 1 && endDay == DateTime.DaysInMonth(year, month))
|
|
// {
|
|
// var endDate = startDate.AddMonths(2);
|
|
// endDay = (int)endDate.Subtract(startDate).TotalDays;
|
|
// }
|
|
// List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay);
|
|
|
|
// if (lROs.Count > 0)
|
|
// {
|
|
// //String reportId = null;
|
|
// //if (orgaOid > 0)
|
|
// //{
|
|
// // var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
|
// // if (organisation != null)
|
|
// // reportId = organisation.Name;
|
|
// //}
|
|
|
|
|
|
// var rootReport = CreateServicesOverviewReportForRo(lROs[0], null);
|
|
// rootReport.CreateDocument();
|
|
|
|
// for (int i = 1; i < lROs.Count; i++)
|
|
// {
|
|
// var lNext = CreateServicesOverviewReportForRo(lROs[i], null);
|
|
// 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)
|
|
//{
|
|
// //String reportId = null;
|
|
// //if (orgaOid > 0)
|
|
// //{
|
|
// // var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
|
// // if (organisation != null)
|
|
// // reportId = organisation.Name;
|
|
// //}
|
|
// DateTime startDate = new DateTime(year, month, 1);
|
|
|
|
// if (startDay == 1 && endDay == DateTime.DaysInMonth(year, month))
|
|
// {
|
|
// var endDate = startDate.AddMonths(2);
|
|
// endDay = (int)endDate.Subtract(startDate).TotalDays;
|
|
// }
|
|
|
|
|
|
// var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
|
|
|
// return CreateServicesOverviewReportForRo(ro, null);
|
|
|
|
//}
|
|
|
|
//private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, String reportId)
|
|
//{
|
|
// IBeWoReport<ServicesOverviewRO> report = null;
|
|
|
|
// //foreach (var s in ro.Services)
|
|
// //{
|
|
// // if (report == null && s.ServiceCategory.Contains("BeWo 67"))
|
|
// // report = new BeWo.IBPReports.StundenzettelBeWo67();
|
|
// //}
|
|
// if (report == null)
|
|
// report = new HphBersenbrueckAph.Stundenzettel();
|
|
// report.SetReportDataSource(ro);
|
|
|
|
// return report as XtraReport;
|
|
//}
|
|
}
|
|
}
|