Files
BeWoPlaner/ReportImp/WMB/ServicesOverviewReport.cs

76 lines
1.9 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
using System;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Collections.Generic;
2017-06-11 15:50:31 +02:00
namespace WMB
2016-06-27 01:45:38 +02:00
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
DateTime dt;
TimeSpan tspan;
double d;
2018-10-08 11:57:16 +02:00
bool hatGruppen = false;
if (pRO.Services != null)
2016-06-27 01:45:38 +02:00
{
2017-06-11 15:50:31 +02:00
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
2016-06-27 01:45:38 +02:00
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);
2017-06-11 15:50:31 +02:00
servicesBillable.Add(s);
2018-10-08 11:57:16 +02:00
if (s.IsGroup)
{
//sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount);
hatGruppen = true;
}
}
2016-06-27 01:45:38 +02:00
else
{
s.FLSQualifiedString = "";
}
}
2017-06-11 15:50:31 +02:00
pRO.Services = servicesBillable;
2016-06-27 01:45:38 +02:00
}
2018-10-08 11:57:16 +02:00
if (!hatGruppen)
{
lblHatGruppen.Text = "X";
}
//dt = DateTime.Now.Date.AddMinutes(pRO.TotalFLMBillable * (double)pRO.RateFactor);
//tspan = dt.Subtract(DateTime.Now.Date);
2016-06-27 01:45:38 +02:00
2018-10-08 11:57:16 +02:00
//d = tspan.TotalHours;
2016-06-27 01:45:38 +02:00
2018-10-08 11:57:16 +02:00
//d = Math.Floor(d);
2016-06-27 01:45:38 +02:00
2018-10-08 11:57:16 +02:00
//pRO.TotalFLSQualifiedString = String.Format("{0}:{1:00}", d, tspan.Minutes);
2016-06-27 01:45:38 +02:00
this.bindingSource1.DataSource = pRO;
}
}
}