Files
BeWoPlaner/ReportImp/SchillingerReports/ServicesOverviewReport.cs
Christian b76d6ea7d1 Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
# Conflicts:
#	Data/Access/SearchDAO.cs
2018-03-02 16:24:55 +01:00

92 lines
2.6 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using BS.Shared;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace BeWo.SchillingerReports
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
Dictionary<string, string> cats = new Dictionary<string, string>();
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable)
{
servicesBillable.Add(s);
if (!cats.ContainsKey(s.ServiceCategory))
{
cats.Add(s.ServiceCategory, s.ServiceCategory);
}
}
}
pRO.Services = servicesBillable;
}
bool istAssistenz = false;
if (cats.Count == 1 && cats.ContainsKey("Assistenzleistungen"))
{
istAssistenz = true;
}
if (istAssistenz)
{
lblTitel.Text = "Quittierungsbeleg über Assistenzleistungsstunden nach §§ 53 ff. SGB XII";
}
else
{
lblTitel.Text = "Quittierungsbeleg über direkte Betreuungsleistungen nach §§ 53 ff. SGB XII";
}
var ba = GetBetreuungsart(pRO);
if (!String.IsNullOrEmpty(ba) && ba.ToLower().Contains("essen"))
{
lblAnbieter.Text = "Anbieter: TaB Essen";
}
else
{
lblAnbieter.Text = "Anbieter: Hilfe Daheim/ProBeWo";
}
this.bindingSource1.DataSource = pRO;
}
public String GetBetreuungsart(ServicesOverviewRO pRO)
{
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
{
var c2s = pRO.CostBearer2SupportConceptList[0];
foreach (var v2o in c2s.SupportConcept.Customer.ValueList)
{
if (v2o.Entry.Type == ValueListEntryType.CustomerCareType)
{
return v2o.Entry.Value;
}
}
}
return "";
}
}
}