67 lines
2.6 KiB
C#
67 lines
2.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 BeWoAmrath
|
|
{
|
|
public partial class Hilfeplanuebersicht : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SupportConceptListRO>
|
|
{
|
|
public Hilfeplanuebersicht()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(SupportConceptListRO pRO)
|
|
{
|
|
decimal zeitFkGesamt = 0;
|
|
decimal zeitNFkGesamt = 0;
|
|
foreach (var sc in pRO.SupportConceptDetailList)
|
|
{
|
|
var servicerecords = DAOFactory.SearchDAO.FindServiceRecords(null, sc.CostBearer2SupportConceptOid);
|
|
decimal zeitFk = 0;
|
|
decimal zeitNFk = 0;
|
|
decimal quote = 1;
|
|
decimal quoteNFk = 1;
|
|
foreach (var sr in servicerecords)
|
|
{
|
|
if (sr.ServiceDescription.ServiceCategory.IsBillable)
|
|
{
|
|
if (sr.Employee.IsQualified.HasValue && sr.Employee.IsQualified.Value)
|
|
{
|
|
zeitFk += sr.RoundedDuration;
|
|
zeitFkGesamt += sr.RoundedDuration;
|
|
}
|
|
else
|
|
{
|
|
zeitNFk += sr.RoundedDuration;
|
|
zeitNFkGesamt += sr.RoundedDuration;
|
|
}
|
|
}
|
|
}
|
|
if (zeitFk > 0 || zeitNFk > 0)
|
|
{
|
|
quote = Math.Round(zeitFk / (zeitNFk + zeitFk), 3, MidpointRounding.AwayFromZero);
|
|
sc.Custom1 = String.Format("{0:0.0}%", (100 * quote));
|
|
quoteNFk = Math.Round(zeitNFk / (zeitNFk + zeitFk), 3, MidpointRounding.AwayFromZero);
|
|
sc.Custom2 = String.Format("{0:0.0}%", (100 * quoteNFk));
|
|
}
|
|
}
|
|
|
|
if (zeitNFkGesamt > 0 || zeitFkGesamt > 0)
|
|
{
|
|
var quoteGesamt = Math.Round(zeitFkGesamt / (zeitNFkGesamt + zeitFkGesamt), 3, MidpointRounding.AwayFromZero);
|
|
tcQuoteGesamt.Text = String.Format("{0:0.0}%", (100 * quoteGesamt));
|
|
var quoteGesamtNfk = Math.Round(zeitNFkGesamt / (zeitNFkGesamt + zeitFkGesamt), 3, MidpointRounding.AwayFromZero);
|
|
FkQuoteGesamt.Text = String.Format("{0:0.0}%", (100 * quoteGesamtNfk));
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|