Files
BeWoPlaner/ReportImp/Lori/ServicesOverviewReport.cs
2019-02-12 19:10:37 +01:00

58 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace Lori
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
if (String.IsNullOrEmpty(pRO.MainAttendant))
{
pRO.MainAttendant = "";
}
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable)
{
if (s.IsGroup)
{
s.ServiceCategoryAbbr = "G";
}
else
{
s.ServiceCategoryAbbr = "E";
}
servicesBillable.Add(s);
if (!pRO.MainAttendant.Contains(s.EmployeeFullname))
{
if (pRO.MainAttendant.Length > 0)
{
pRO.MainAttendant += ", ";
}
pRO.MainAttendant += s.EmployeeFullname;
}
}
}
pRO.Services = servicesBillable;
}
this.bindingSource1.DataSource = pRO;
}
}
}