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;

namespace BeWo.Club74
{
    public partial class Hilfeplanuebersicht : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SupportConceptListRO>
    {
        public Hilfeplanuebersicht()
        {
            InitializeComponent();
        }

        public void SetReportDataSource(SupportConceptListRO pRO)
        {
	        if (pRO.SupportConceptDetailList != null)
	        {
		        foreach (var sd in pRO.SupportConceptDetailList)
		        {
			        if (sd.OpenWeeks != 0)
			        {
				        sd.FLSPerWeekIst = sd.FLSRemaining/sd.OpenWeeks;
			        }
			        else
			        {
				        sd.FLSPerWeekIst = sd.FLSRemaining;
			        }

			        if (sd.FLSApprovedTillNow != 0)
			        {
				        sd.DurationPercentage = (sd.FLSTotalRecordedBillable/sd.FLSApprovedTillNow) * 100;
			        }
		        }
	        }
            this.bindingSource1.DataSource = pRO;
        }
    }
}
