Files
BeWoPlaner/ReportImp/Club74/GeneralReport.cs
Christian cf90774667 bugfixing
2017-06-11 15:50:31 +02:00

68 lines
2.1 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace BeWo.Club74
{
public partial class GeneralReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public GeneralReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
if (!String.IsNullOrEmpty(pRO.RecipientSalutationAddressField))
{
if (pRO.RecipientSalutationAddressField == "Herrn")
{
pRO.RecipientSalutationAddressField = "Herr";
}
}
if (!String.IsNullOrEmpty(pRO.RecipientSalutationAddressField))
{
if (pRO.RecipientSalutationAddressField == "Herrn")
{
pRO.RecipientSalutationAddressField = "Herr";
}
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrWhiteSpace(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrWhiteSpace(pRO.RecipientSalutationAddressField) && !String.IsNullOrWhiteSpace(pRO.RecipientLastName))
{
sb.AppendLine(String.Format("{0} {1} {2}", pRO.RecipientSalutationAddressField, pRO.RecipientFirstName, pRO.RecipientLastName));
}
if (!String.IsNullOrWhiteSpace(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrWhiteSpace(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrWhiteSpace(pRO.RecipientPostCode) || !String.IsNullOrWhiteSpace(pRO.RecipientTown))
{
sb.Append(String.Format("{0} {1}", pRO.RecipientPostCode, pRO.RecipientTown));
}
lblAddress.Text = sb.ToString();
if (String.IsNullOrEmpty(pRO.Notice))
{
lblBemerkung.Visible = false;
}
this.bindingSource1.DataSource = pRO;
}
}
}