Files
BeWoPlaner/ReportImp/InputFamilienhilfe/InvoiceCustomerReport.cs
2023-03-24 13:07:59 +01:00

62 lines
2.2 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace InputFamilienhilfe
{
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();
if (!String.IsNullOrEmpty(pRO.CustomerFirstName) || !String.IsNullOrEmpty(pRO.CustomerLastName) || pRO.CustomerBirthdate.HasValue)
{
lblKlient.Text = String.Format("[CustomerLastName], [CustomerFirstName] (*[CustomerBirthdate!dd.MM.yyyy])");
}
DateTime frist = pRO.InvoiceDateTime.AddDays(14);
lblFrist.Text = String.Format("Ich bitte Sie, den Rechnungsbetrag in Höhe von {0} bis zum {1:dd.MM.yyyy} unter Angabe der Rechnungsnummer auf das unten angegebene Konto zu überweisen.", pRO.TotalClaim, frist);
this.bindingSource1.DataSource = pRO;
}
}
}