2016-06-27 01:45:38 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
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)
|
|
|
|
|
{
|
2023-03-27 17:41:58 +02:00
|
|
|
if(string.IsNullOrEmpty(pRO.ApprovedStartDate))
|
2017-06-11 15:50:31 +02:00
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
if (pRO.Services != null)
|
|
|
|
|
{
|
|
|
|
|
var servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
2017-12-11 14:31:59 +01:00
|
|
|
pRO.TotalFLMBillable = 0;
|
2016-06-27 01:45:38 +02:00
|
|
|
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
|
|
|
|
|
{
|
2017-12-11 14:31:59 +01:00
|
|
|
if (s.IsBillable)
|
|
|
|
|
{
|
|
|
|
|
servicesBillable.Add(s);
|
|
|
|
|
|
|
|
|
|
s.Minutes = Math.Round(s.Minutes, 0, MidpointRounding.AwayFromZero);
|
|
|
|
|
pRO.TotalFLMBillable += s.Minutes;
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pRO.Services = servicesBillable;
|
|
|
|
|
}
|
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|