58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Data.Access;
|
|
using BS.Shared;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace SKFLeverkusen
|
|
{
|
|
public partial class Betreuungsvertrag : DevExpress.XtraReports.UI.XtraReport
|
|
{
|
|
public Betreuungsvertrag()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(CustomerDataRO pRO)
|
|
{
|
|
DateTime? vertragsStartDatum = null;
|
|
Customer customer = DAOFactory.GenericDAO.LoadByID<Customer>(pRO.CustomerOid);
|
|
foreach (var sc in customer.SupportConcepts)
|
|
{
|
|
if (sc.IsActive == ActivationTypeId.Active)
|
|
{
|
|
foreach (var c2s in sc.CostBearer2SupportConceptList)
|
|
{
|
|
if (c2s.StartDate <= DateTime.Now && c2s.EndDate >= DateTime.Now)
|
|
{
|
|
vertragsStartDatum = sc.StartDate;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
XRRichText[] textFelder = new XRRichText[] { xrRichText3, xrRichText5, xrRichText8, xrRichText12,
|
|
xrRichText14, xrRichText15, xrRichText16, xrRichText17, xrRichText18, xrRichText19, xrRichText20 };
|
|
|
|
foreach (var textFeld in textFelder)
|
|
{
|
|
textFeld.Rtf = textFeld.Rtf.Replace("[vertragsStartDatum]", String.Format("{0:dd.MM.yyyy}", vertragsStartDatum));
|
|
}
|
|
|
|
String leistungsberechtigtePerson = pRO.FirstName + " " + pRO.LastName;
|
|
textFelder = new XRRichText[] { xrRichText8, xrRichText12, xrRichText14, xrRichText15, xrRichText16, xrRichText19 };
|
|
foreach (var textFeld in textFelder)
|
|
{
|
|
textFeld.Rtf = textFeld.Rtf.Replace("[leistungsberechtigtePerson]", leistungsberechtigtePerson);
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|