Files
BeWoPlaner/ReportImp/IndroABW/ServicesOverviewReport.cs
2016-06-27 01:45:38 +02:00

44 lines
970 B
C#

using System;
using System.Collections.Generic;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using DevExpress.XtraReports.UI;
namespace IndroABW
{
public partial class Stundenzettel : XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
if (pRO.Services != null)
{
var servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.StartDate.Second == 0)
{
s.TimeRangeString = String.Format("{0} - {1}", s.StartDate.ToShortTimeString(), s.EndDate.ToShortTimeString());
}
if (s.IsBillable)
servicesBillable.Add(s);
}
pRO.Services = servicesBillable;
}
bindingSource1.DataSource = pRO;
}
}
}