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

namespace BeWo.KetteReports
{
    public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
    {
        public InvoiceCustomerReport()
        {
            InitializeComponent();
        }

        public void SetReportDataSource(InvoiceCustomerRO pRO)
        {
            lblNotice.Text = String.Format("Bitte überweisen Sie den geforderten Betrag bis zum {0:dd.MM.yyyy} auf die unten aufgeführte Bankverbindung.", pRO.InvoiceDateTime.AddDays(21));
            
            
            lblDebitor.Text = "";

            if (!String.IsNullOrEmpty(pRO.CustomerReferenceNumber) && pRO.CustomerReferenceNumber.Trim().Length > 0)
            {
                lblDebitor.Text = pRO.CustomerReferenceNumber;
            }
            if (!String.IsNullOrEmpty(pRO.RecipientDebitorNumber) && pRO.RecipientDebitorNumber.Trim().Length > 0)
            {
                if (lblDebitor.Text.Trim().Length > 0)
                    lblDebitor.Text += ", ";
                lblDebitor.Text += "Debitor: " + pRO.RecipientDebitorNumber;
            }
            this.bindingSource1.DataSource = pRO;
        }
    }
}
