Files
BeWoPlaner/ReportImp/PhoenixBeWo/ServiceInvoiceReport.cs

52 lines
1.7 KiB
C#

using System;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using DevExpress.XtraReports.UI;
namespace PhoenixBeWo
{
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);
}
string team = "";
Customer c;
if (pRO.ServiceInvoicePeriods.Count > 0 && pRO.ServiceInvoicePeriods[0].Customer.Oid.HasValue)
{
c = DAOFactory.GenericDAO.LoadByID<Customer>(pRO.ServiceInvoicePeriods[0].Customer.Oid ?? 0);
if (c.Team2CustomerList.Count > 0)
{
team = c.Team2CustomerList[0].Team.Name;
}
if (team.Contains("SPFH"))
{
lblBriefkopfSPFH.Visible = true;
FußzeileSPFH.Visible = true;
lblBriefkopf.Visible = false;
Fußzeile.Visible = false;
}
}
this.bindingSource1.DataSource = pRO;
}
}
}