Files
BeWoPlaner/ReportImp/TrialogReports/ServicesOverviewReport.cs

109 lines
3.6 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared;
namespace BeWo.TrialogReports
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
bool showGfUnterschrift = false;
if (!String.IsNullOrWhiteSpace(pRO.Costbearer))
{
if (pRO.Costbearer.ToLower().Contains("jugendamt düsseldorf") && pRO.Costbearer.ToLower().Contains("weh") && (pRO.Costbearer.ToLower().Contains("27") || pRO.Costbearer.ToLower().Contains("35") || pRO.Costbearer.ToLower().Contains("ass")))
{
showGfUnterschrift = true;
}
}
bool isJugendamt = !String.IsNullOrWhiteSpace(pRO.Costbearer) && pRO.Costbearer.ToLower().Contains("jugendamt");
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable || s.ServiceDescription.ToLower().Contains("fehlkontakt"))
{
if (isJugendamt)
{
ServicesOverviewRO.CreateGoalList(s);
}
s.Notice = "";
if (s.ServiceDescription.ToLower().Contains("fehlkontakt"))
s.Notice = "Fehlkontakt";
else if (s.IsGroup)
s.Notice = String.Format("Gruppe {0:0}", s.CustomerCount);
else if (!s.IsGroup)
s.Notice = "Einzelkontakt";
servicesBillable.Add(s);
}
}
pRO.Services = servicesBillable;
}
if (!isJugendamt)
{
lblBewilligt.Visible = false;
cellDokHeader.Visible = false;
cellGoal.Visible = false;
}
else
{
this.Landscape = true;
cellDokHeader.Width = 500;
cellGoal.Width = 500;
BerechneBewilligteStundenProMonat(pRO);
}
if (showGfUnterschrift)
{
//
}
else
{
lblGfUnterschrift.Visible = false;
lblGfUnterschrift2.Visible = false;
ReportFooter.Height = 180;
}
this.bindingSource1.DataSource = pRO;
}
private void BerechneBewilligteStundenProMonat(ServicesOverviewRO pRo)
{
if (pRo.SupportConceptCostBearer != null && pRo.SupportConceptCostBearer.ApprovalPeriodList != null)
{
foreach (var ap in pRo.SupportConceptCostBearer.ApprovalPeriodList)
{
if (ap.ApprovedBEInterval.HasValue && ap.ApprovedBEPerInterval.HasValue && ap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
{
if (ap.StartDate <= pRo.EndDate && ap.EndDate >= pRo.StartDate)
{
pRo.ApprovedFLSPerMonth = ap.ApprovedBEPerInterval.Value;
}
}
}
}
}
}
}