Files
BeWoPlaner/ReportImp/HausDuelken/Finanzauswertung.cs

64 lines
1.9 KiB
C#

using System;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace HausDuelken
{
public partial class Finanzauswertung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<FinanceRO>
{
public Finanzauswertung()
{
InitializeComponent();
}
public void SetReportDataSource(FinanceRO pRO)
{
pRO.CalculateBillableAmountInReportTimeSpan();
if (pRO.ReportStartDate.HasValue && pRO.ReportEndDate.HasValue)
{
DateTime start = pRO.ReportStartDate.Value;
DateTime end = pRO.ReportEndDate.Value;
if (start.Year == end.Year && start.Month == end.Month && start.Day == 1 &&
end.Day == DateTime.DaysInMonth(end.Year, end.Month))
{
lblTitel.Text = String.Format("Finanzauswertung {0:MMMM yyyy}", start);
cellBewilligtImZeitraumHeader.Text = String.Format("bewilligte FLS {0:MMMM}", start);
cellGeleistetImZeitraumHeader.Text = String.Format("geleistete Std. {0:MMMM}", start);
}
else
{
lblTitel.Text = String.Format("Finanzauswertung {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
cellBewilligtImZeitraumHeader.Text = String.Format("bewilligte FLS {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
cellGeleistetImZeitraumHeader.Text = String.Format("geleistete Std. {0:dd.MM.yyyy}-{1:dd.MM.yyyy}", start, end);
}
if (pRO.RateFactor.HasValue)
{
cellRateFactorHeader.Text = String.Format("geleistete Std. x {0:0.##}", pRO.RateFactor);
}
else
{
cellRateFactorHeader.Visible = false;
cellRateFactor.Visible = false;
}
}
else
{
cellBewilligtImZeitraumHeader.Visible = false;
cellBewilligteFLSImBereich.Visible = false;
cellGeleistetImBereich.Visible = false;
cellGeleistetImZeitraumHeader.Visible = false;
cellRateFactorHeader.Visible = false;
cellRateFactor.Visible = false;
}
this.bindingSource1.DataSource = pRO;
}
}
}