81 lines
2.5 KiB
C#
81 lines
2.5 KiB
C#
using System;
|
|
using System.Linq;
|
|
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraPrinting;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace BeWo.Convoi
|
|
{
|
|
public partial class Stundenzettel : XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public Stundenzettel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
bool hatGruppen = false;
|
|
|
|
if (pRO.Services != null)
|
|
{
|
|
var servicesBillable = pRO.Services.Where(s => s.IsBillable).ToList();
|
|
foreach (var sd in servicesBillable)
|
|
{
|
|
if (sd.IsGroup)
|
|
{
|
|
hatGruppen = true;
|
|
}
|
|
}
|
|
pRO.Services = servicesBillable;
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.AbsenceTimes))
|
|
{
|
|
pRO.AbsenceTimes = "Abwesenheit: " + pRO.AbsenceTimes;
|
|
}
|
|
else
|
|
{
|
|
lblHatAbwesenheiten.Text = "X";
|
|
}
|
|
|
|
if (!hatGruppen)
|
|
{
|
|
lblHatGruppen.Text = "X";
|
|
}
|
|
|
|
//if (pRO.SupportConceptCostBearer != null)
|
|
//{
|
|
// var ats = pRO.SupportConceptCostBearer.SupportConcept.Customer.AbsenceTimes;
|
|
|
|
// for (var i = 0; i < ats.Count; i++)
|
|
// {
|
|
|
|
// var at = ats[i];
|
|
// var cellText = string.Format("Abwesenheit: {0}.{1}. - {2}.{3}. {4}",
|
|
// at.AbsenceSpan.StartDate.Day < 10
|
|
// ? " " + at.AbsenceSpan.StartDate.Day
|
|
// : at.AbsenceSpan.StartDate.Day.ToString(), at.AbsenceSpan.StartDate.Month,
|
|
// at.AbsenceSpan.EndDate.Day < 10 ? " " + at.AbsenceSpan.EndDate.Day : at.AbsenceSpan.EndDate.Day.ToString(),
|
|
// at.AbsenceSpan.EndDate.Month, at.Reason);
|
|
|
|
// if (i == 0)
|
|
// {
|
|
// abwesenheitsTabelle.Rows[0].Cells[0].Text = cellText;
|
|
// }
|
|
// else
|
|
// {
|
|
// var reihe = new XRTableRow();
|
|
// reihe.Cells.Add(new XRTableCell {Text = cellText, TextAlignment = TextAlignment.MiddleLeft});
|
|
// abwesenheitsTabelle.Rows.Add(reihe);
|
|
// }
|
|
// }
|
|
//}
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|