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

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

        public void SetReportDataSource(ServicesOverviewRO pRO)
        {
            lblApprovedMinutes.Text = String.Format("{0:0}/{1:0.00}", pRO.ApprovedFLSPerWeek * 60, pRO.ApprovedFLSPerWeek);
            
            if (pRO.Services != null)
            {
                foreach (var item in pRO.Services)
                {
                    if (item.CustomerCount > 1)
                    {
                        item.ServiceDescription += " (" + item.CustomerCount + " Teilnehmer)";
                    }
                }
            }
            this.bindingSource1.DataSource = pRO;
        }
    }
}
