73 lines
2.3 KiB
C#
73 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using DevExpress.XtraPrinting.Native;
|
|
|
|
namespace HshCologne
|
|
{
|
|
public partial class LeistungsnachweisSbWesseling : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public LeistungsnachweisSbWesseling()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
Organisation org = null;
|
|
cellDatum.Text = String.Format("Datum {0:dd.MM.yyyy}", DateTime.Now);
|
|
this.lblHeader.Text = "Leistungsnachweis";
|
|
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
|
|
{
|
|
var c2s = pRO.CostBearer2SupportConceptList[0];
|
|
org = c2s.CostBearer.Organisation;
|
|
|
|
if (org.Name.Contains("Wesseling"))
|
|
{
|
|
this.lblHeader.Text = "Tätigkeitsnachweis\r\nfür die Stadt Wesseling";
|
|
}
|
|
if (c2s.CostBearerContactPerson != null)
|
|
{
|
|
lblAbteilung.Text += c2s.CostBearerContactPerson.FirstNameLastName;
|
|
}
|
|
}
|
|
|
|
if (pRO.CustomerOid > 0)
|
|
{
|
|
var c = DAOFactory.GenericDAO.LoadByID<Customer>(pRO.CustomerOid);
|
|
}
|
|
|
|
Dictionary<String, String> empDict = new Dictionary<string, string>();
|
|
String emp = "";
|
|
if (pRO.Services != null)
|
|
{
|
|
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
|
|
{
|
|
if (!empDict.ContainsKey(s.EmployeeFullname))
|
|
{
|
|
empDict.Add(s.EmployeeFullname, s.EmployeeFullname);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empDict.Count == 1)
|
|
{
|
|
pRO.MainAttendant = emp;
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.MainAttendant))
|
|
{
|
|
pRO.MainAttendant = "IFH Cologne, " + pRO.MainAttendant;
|
|
}
|
|
else
|
|
{
|
|
pRO.MainAttendant = "IFH Cologne";
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|