Files
BeWoPlaner/ReportImp/EvVereinFürWohnraumhilfe/InvoiceCustomerReport.cs

70 lines
2.5 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace EvVereinFürWohnraumhilfe
{
public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public InvoiceCustomerReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && !String.IsNullOrEmpty(pRO.RecipientOrganisation.Trim()))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientDivision.Trim()))
{
sb.AppendLine(pRO.RecipientDivision);
}
if ((!String.IsNullOrEmpty(pRO.RecipientFirstName) && !String.IsNullOrEmpty(pRO.RecipientFirstName.Trim()))
|| (!String.IsNullOrEmpty(pRO.RecipientLastName) && !String.IsNullOrEmpty(pRO.RecipientLastName.Trim())))
{
sb.AppendLine(String.Format("{0} {1}", pRO.RecipientFirstName, pRO.RecipientLastName).Trim());
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet) && !String.IsNullOrEmpty(pRO.RecipientStreet.Trim()))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCode) && !String.IsNullOrEmpty(pRO.RecipientPostCode.Trim()))
{
sb.Append(pRO.RecipientPostCode);
sb.Append(" ");
}
if (!String.IsNullOrEmpty(pRO.RecipientTown) && !String.IsNullOrEmpty(pRO.RecipientTown.Trim()))
{
sb.Append(pRO.RecipientTown);
}
lblAddress.Text = sb.ToString();
// Sonderreglung: Kontostand als erste Mahnung, Abstufung im Text für 2. Mahnung
// Wenn das Wort Mahnung nicht auftaucht handelt es sich um eine Kündigung
if (pRO.InvoiceItems != null)
{
if (pRO.InvoiceItems[0].ItemDescription.Contains("Mahnung"))
{
lblBetreff.Text = "Mahnung";
lblMahnung1.Text = "Um weitere Unannehmlichkeiten zu vermeiden, vereinbaren Sie bitte bis zum [Zahlziel!dd.MM.yyyy] eine Ratenzahlungsvereinbarung" +
" mit Ihrer Bezugsperson oder zahlen Sie diese Summe in einem Betrag auf unser Konto:";
lblMahnung1.Visible = true;
lblBank.Visible = true;
}
else if (pRO.InvoiceItems[0].ItemDescription.Contains("Kündigung"))
{
lblBetreff.Text = "Kündigung";
lblNutzung.Text = "der Nutzung der Wohnung in";
lblMahnung1.Visible = false;
lblMahnung2.Visible = true;
}
}
this.bindingSource1.DataSource = pRO;
}
}
}