Files
BeWoPlaner/ReportImp/VereinZurIntegrationChemnitz/RechnungWBWEinzel.cs

65 lines
2.2 KiB
C#

using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.Core;
using BS.Shared.Extensions;
using DevExpress.XtraReports.UI;
using System;
using System.Text;
namespace VereinZurIntegrationChemnitz
{
//[IDSpecificClass(Identifiers = new string[] { "RechnungABW67" })]
public partial class RechnungWBW : XtraReport, IBeWoReport<ServiceInvoiceRO>
{
public RechnungWBW()
{
this.InitializeComponent();
}
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
SetzeAdresse(pRO);
if (pRO.AmountEquityContribution == null || pRO.AmountEquityContribution == "0.00 €")
{
GroupFooterEigenanteil.Visible = false;
}
this.bindingSource1.DataSource = pRO;
}
private void SetzeAdresse(ServiceInvoiceRO pRO)
{
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.ToLower().Trim() != "selbstzahler")
{
sb.AppendLine(pRO.RecipientOrganisation);
}
//if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1))
//{
// sb.AppendLine(pRO.RecipientAddressLine1);
//}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.ToLower().Trim() != "selbstzahler")
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
{
sb.AppendLine(pRO.RecipientPoBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
}
}
}