Files
BeWoPlaner/ReportImp/WMB/ServicesOverviewReport.cs
Christian 40ebcc80fc cb
2018-10-08 11:57:16 +02:00

76 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 WMB
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
DateTime dt;
TimeSpan tspan;
double d;
bool hatGruppen = false;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable)
{
dt = DateTime.Now.Date.AddMinutes(s.Minutes*(double) pRO.RateFactor);
tspan = dt.Subtract(DateTime.Now.Date);
d = tspan.TotalHours;
d = Math.Floor(d);
s.FLSQualifiedString = String.Format("{0}:{1:00}", d, tspan.Minutes);
servicesBillable.Add(s);
if (s.IsGroup)
{
//sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount);
hatGruppen = true;
}
}
else
{
s.FLSQualifiedString = "";
}
}
pRO.Services = servicesBillable;
}
if (!hatGruppen)
{
lblHatGruppen.Text = "X";
}
//dt = DateTime.Now.Date.AddMinutes(pRO.TotalFLMBillable * (double)pRO.RateFactor);
//tspan = dt.Subtract(DateTime.Now.Date);
//d = tspan.TotalHours;
//d = Math.Floor(d);
//pRO.TotalFLSQualifiedString = String.Format("{0}:{1:00}", d, tspan.Minutes);
this.bindingSource1.DataSource = pRO;
}
}
}