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

namespace BeWo.LebenshilfeDuisburgReports
{
    public partial class StundenzettelTBT : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
    {
		public StundenzettelTBT()
        {
            InitializeComponent();
        }

        public void SetReportDataSource(ServicesOverviewRO pRO)
        {
			double minTotal = 0;

            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);
		                minTotal += s.Minutes;
	                }
	                
                }

                pRO.Services = servicesBillable;
            }
			
	        lblFLSTotal.Text = String.Format("{0:0.00}", minTotal / 60);

			bindingSource1.DataSource = pRO;
			
        }
    }
}
