91 lines
3.7 KiB
C#
91 lines
3.7 KiB
C#
using System.Text;
|
|
using BeWo.Report.ReportObjects;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace BeWo.Report.DefaultReports
|
|
{
|
|
public partial class DailyAppointmentReportKalender : XtraReport, IBeWoReport<KalenderRO>
|
|
{
|
|
public DailyAppointmentReportKalender()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(KalenderRO pRO)
|
|
{
|
|
if (pRO.KalenderTageSortiert != null)
|
|
{
|
|
foreach (var tag in pRO.KalenderTageSortiert)
|
|
{
|
|
if (tag.Termine != null)
|
|
{
|
|
foreach (var termin in tag.Termine)
|
|
{
|
|
if (termin.Appointment != null)
|
|
{
|
|
StringBuilder empString = new StringBuilder();
|
|
|
|
if (termin.Appointment.EmployeeList != null)
|
|
{
|
|
foreach (var e2s in termin.Appointment.EmployeeList)
|
|
{
|
|
if (empString.Length == 0)
|
|
{
|
|
empString.Append("Mitarbeiter: ");
|
|
}
|
|
else
|
|
{
|
|
empString.Append(", ");
|
|
}
|
|
empString.Append(e2s.Employee.Person.FirstNameLastName);
|
|
}
|
|
}
|
|
termin.Appointment.Notice2 = empString.ToString();
|
|
|
|
StringBuilder custString = new StringBuilder();
|
|
|
|
if (termin.Appointment.CustomerList != null)
|
|
{
|
|
foreach (var c in termin.Appointment.CustomerList)
|
|
{
|
|
if (custString.Length == 0)
|
|
{
|
|
custString.Append("Klienten: ");
|
|
}
|
|
else
|
|
{
|
|
custString.Append(", ");
|
|
}
|
|
custString.Append(c.Person.FirstNameLastName);
|
|
}
|
|
}
|
|
termin.Appointment.Notice3 = custString.ToString();
|
|
|
|
StringBuilder resString = new StringBuilder();
|
|
|
|
if (termin.Appointment.ResourceList != null)
|
|
{
|
|
foreach (var r in termin.Appointment.ResourceList)
|
|
{
|
|
if (resString.Length == 0)
|
|
{
|
|
resString.Append("Ressourcen: ");
|
|
}
|
|
else
|
|
{
|
|
resString.Append(", ");
|
|
}
|
|
resString.Append(r.Name);
|
|
}
|
|
}
|
|
termin.Appointment.Notice4 = resString.ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
bindingSource2.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|