using BeWo.Report;
using BeWo.Report.ReportObjects;

using DevExpress.XtraReports.UI;

namespace SPZRatingen
{
    public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
    {
        public ServiceInvoiceReport()
        {
            this.InitializeComponent();
        }

        public void SetReportDataSource(ServiceInvoiceRO pRO)
        {
			decimal hours = 0;
			if (pRO.ServiceInvoicePeriods != null)
			{
				foreach (var sip in pRO.ServiceInvoicePeriods)
				{
					foreach (var ii in sip.ServiceInvoiceItems)
					{
						hours += ii.Hours ?? 0;
					}	
				}
				
			}
			lblSum.Text = string.Format("{0:0.00}", hours);
			this.bindingSource1.DataSource = pRO;
        }
    }
}