Files
BeWoPlaner/ReportImp/SchillingerReports/InvoiceCustomerReport.cs
Christian b76d6ea7d1 Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
# Conflicts:
#	Data/Access/SearchDAO.cs
2018-03-02 16:24:55 +01:00

77 lines
2.6 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace BeWo.SchillingerReports
{
public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public InvoiceCustomerReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
if (String.IsNullOrEmpty(pRO.Notice))
{
lblNotice.Visible = false;
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientFirstName) || !String.IsNullOrEmpty(pRO.RecipientLastName))
{
sb.AppendLine(String.Format("{0} {1}", pRO.RecipientFirstName, pRO.RecipientLastName).Trim());
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCode))
{
sb.Append(pRO.RecipientPostCode);
sb.Append(" ");
}
if (!String.IsNullOrEmpty(pRO.RecipientTown))
{
sb.Append(pRO.RecipientTown);
}
lblAdresse.Text = sb.ToString();
lblEigenanteilBescheid.Text = "Ihr Eigenanteil gemäß Bewilligungsbescheid";
if (pRO.InvoiceBase != null && pRO.InvoiceBase.SupportConceptOid.HasValue)
{
var sc = DAOFactory.GenericDAO.LoadByID<SupportConcept>(pRO.InvoiceBase.SupportConceptOid.Value);
if (sc.ApprovalDate.HasValue)
{
lblEigenanteilBescheid.Text += String.Format(" vom {0:dd.MM.yyyy}", sc.ApprovalDate);
}
var start = sc.StartDate;
var end = sc.EndDate;
lblBewilligungszeitraum.Text = String.Format("Bewilligungszeitraum: {0:dd.MM.yyyy} - {1:dd.MM.yyyy}", start, end);
}
this.bindingSource1.DataSource = pRO;
}
}
}