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

namespace BeWo.AssistenzaReports.Alt
{
    public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
    {
        public Spitzabrechnung()
        {
            InitializeComponent();
        }

        public void SetReportDataSource(SettlementRO pRO)
        {
            this.bindingSource1.DataSource = pRO;

            panel2.Location = panel1.Location;
	        panel3.Location = panel1.Location;

            if (pRO.DifferentHourlyRateCount > 2)
            {
                panel1.Visible = false;
                panel2.Visible = false;
	            panel3.Visible = true;
            }
			else if (pRO.DifferentHourlyRateCount == 2)
            {
                panel1.Visible = false;
                panel2.Visible = true;
				panel3.Visible = false;
            }
            else
            {
                panel1.Visible = true;
                panel2.Visible = false;
				panel3.Visible = false;
            }
        }
    }
}
