Files
BeWoPlaner/Report/DefaultReports/ServiceInvoiceReport.cs

73 lines
2.6 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
using System;
using System.Text;
2016-06-27 01:45:38 +02:00
using BeWo.Report.ReportObjects;
using BS.Shared.Extensions;
2016-06-27 01:45:38 +02:00
using DevExpress.XtraReports.UI;
namespace BeWo.Report.DefaultReports
{
public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
{
public ServiceInvoiceReport()
{
this.InitializeComponent();
}
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
if (start.Month == end.Month && start.Year == end.Year)
{
lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir f<>r den Monat {0:MMMM yyyy} folgende erbrachte T<>tigkeiten:", start);
}
else
{
lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir f<>r den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte T<>tigkeiten:", start, end);
}
if (pRO.CustomerSalutation.IsNullOrEmpty())
{
2025-06-26 14:09:44 +02:00
lblAnrede.Text = "Guten Tag,";
}
SetzeAdresse(pRO);
2016-06-27 01:45:38 +02:00
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();
}
2016-06-27 01:45:38 +02:00
}
}