Files
BeWoPlaner/ReportImp/BeWoColoniaMitarbeiter2/ServicesOverviewReport.cs
2019-08-29 15:39:32 +02:00

61 lines
1.9 KiB
C#

using System;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
namespace BeWoDreilichPastorMitarbeiter
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
bool showMinutes = true;
if (pRO.StartDate < new DateTime(2019, 1, 1))
{
showMinutes = false;
}
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable)
{
if (!showMinutes)
{
s.Minutes = s.Minutes / 60;
}
servicesBillable.Add(s);
}
}
pRO.Services = servicesBillable;
}
if (showMinutes)
{
cellMinutenFLSHeader.Text = "Geleistete Minuten";
cellGesamt.Text = String.Format("{0:0.##}", pRO.TotalFLMBillable);
cellGesamtFaktor.Text = String.Format("{0:0.##}", pRO.TotalFLMBillable * 1.2);
}
else
{
cellGesamt.Text = String.Format("{0:0.##}", pRO.TotalFLMBillable / 60);
cellGesamtFaktor.Text = String.Format("{0:0.##}", (pRO.TotalFLMBillable / 60) * 1.2);
}
this.bindingSource1.DataSource = pRO;
}
}
}