42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System;
|
|
using System.Linq;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
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;
|
|
|
|
lblHeader1.Text = string.Format("Betreutes Wohnen und Assistenzleistungen für den Monat {0:MMMM yyyy}", pRO.AccountingPeriodStart);
|
|
lblHeader2.Text = string.Format("Verwendungszweck: Betreutes Wohnen und Assistenzleistungen für {0} {1}", pRO.CustomerFirstName, pRO.CustomerLastName);
|
|
|
|
bool nurAssistenz = true;
|
|
foreach (var ip in pRO.ServiceInvoicePeriods)
|
|
{
|
|
if (ip.ServiceInvoiceItems.Any(i => !i.ServiceDescription.ToLower().Contains("assistenz")))
|
|
nurAssistenz = false;
|
|
}
|
|
|
|
if (nurAssistenz)
|
|
{
|
|
lblMailBeiSZ.Visible = false;
|
|
lblNummernBeiSZ.Visible = false;
|
|
lblHeader1.Text = string.Format("Assistenzleistungen für den Monat {0:MMMM yyyy}", pRO.AccountingPeriodStart);
|
|
lblHeader2.Text = string.Format("Verwendungszweck: Assistenzleistungen für {0} {1}", pRO.CustomerFirstName, pRO.CustomerLastName);
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |