Files
BeWoPlaner/ReportImp/Club74DB2/ServicesOverviewReport.cs
Christian 0cdbf53408 cb
2021-11-16 10:56:40 +01:00

49 lines
1.4 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace BeWo.Club74
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
if (String.IsNullOrEmpty(pRO.ApprovedStartDate))
{
lblZeitraum.Text = "Nicht bewilligt";
if (!String.IsNullOrEmpty(pRO.RequestedStartDate))
{
lblZeitraum.Text = String.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}, nicht bewilligt", pRO.RequestedStartDate, pRO.RequestedEndDate);
}
}
if (pRO.Services != null)
{
var servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
pRO.TotalFLMBillable = 0;
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable)
{
servicesBillable.Add(s);
s.Minutes = Math.Round(s.Minutes, 0, MidpointRounding.AwayFromZero);
pRO.TotalFLMBillable += s.Minutes;
}
}
pRO.Services = servicesBillable;
}
bindingSource1.DataSource = pRO;
}
}
}