using System;
using System.Collections.Generic;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;

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

        public void SetReportDataSource(SupportConceptListRO pRO)
        {
	        if (pRO.SupportConceptDetailList != null)
	        {
				List<SupportConceptListRO.SupportConceptDetail> newList = new List<SupportConceptListRO.SupportConceptDetail>();

		        foreach (var supportConceptDetail in pRO.SupportConceptDetailList)
		        {
			        if (!String.IsNullOrEmpty(supportConceptDetail.Costbearer))
			        {
						if (supportConceptDetail.Costbearer.ToLower() == "lwv" || supportConceptDetail.Costbearer.ToLower() == "jugendamt gießen")
				        {
					        newList.Add(supportConceptDetail);
				        }
			        }
		        }

		        pRO.SupportConceptDetailList = newList;
	        }
            this.bindingSource1.DataSource = pRO;
        }
    }
}
