Files
2017-06-11 16:01:01 +02:00

66 lines
2.6 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace BeWo.SozialeDienstleistungenBeckerReports
{
public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public InvoiceCustomerReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
if (pRO.AccountingPeriodStart.HasValue && pRO.AccountingPeriodEnd.HasValue)
{
if (pRO.AccountingPeriodStart.Value.Month == pRO.AccountingPeriodEnd.Value.Month && pRO.AccountingPeriodStart.Value.Year == pRO.AccountingPeriodEnd.Value.Year)
{
lblAbrechnungszeitraum.Text = String.Format("Für die im Monat {0:MMMM yyyy} geleisteten Betreuungsstunden erlaube ich mir Ihnen die Rechnung auszustellen.", pRO.AccountingPeriodStart);
}
else
{
lblAbrechnungszeitraum.Text = String.Format("Für die im Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} geleisteten Betreuungsstunden erlaube ich mir Ihnen die Rechnung auszustellen.", pRO.AccountingPeriodStart, pRO.AccountingPeriodEnd);
}
}
//if (String.IsNullOrEmpty(pRO.Notice))
//{
// lblNotice.Visible = false;
//}
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();
this.bindingSource1.DataSource = pRO;
}
}
}