53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using DevExpress.XtraReports.UI;
|
|
using BS.Shared.Extensions;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using BeWo.Data.Access;
|
|
|
|
namespace BeWo.ChristopherusHaus
|
|
{
|
|
public partial class Hilfeplanuebersicht : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SupportConceptListRO>
|
|
{
|
|
public Hilfeplanuebersicht()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(SupportConceptListRO pRO)
|
|
{
|
|
foreach (var sc in pRO.SupportConceptDetailList)
|
|
{
|
|
var servicerecords = DAOFactory.SearchDAO.FindServiceRecords(null, sc.CostBearer2SupportConceptOid);
|
|
decimal zeitFk = 0;
|
|
decimal zeitNFk = 0;
|
|
decimal quote = 1;
|
|
foreach (var sr in servicerecords)
|
|
{
|
|
if (sr.Employee.IsQualified.HasValue && sr.Employee.IsQualified.Value)
|
|
{
|
|
zeitFk += sr.RoundedDuration;
|
|
}
|
|
else
|
|
{
|
|
zeitNFk += sr.RoundedDuration;
|
|
}
|
|
}
|
|
if (zeitFk > 0)
|
|
{
|
|
quote = zeitFk / (zeitNFk + zeitFk);
|
|
sc.Custom1 = String.Format("{0:0.0}%", (100 * quote));
|
|
}
|
|
else if (zeitNFk > 0 )
|
|
{
|
|
sc.Custom1 = "100 %";
|
|
}
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|