using System; using System.Text; using BeWo.Report; using BeWo.Report.ReportObjects; using BS.Shared.Core; using DevExpress.XtraReports.UI; namespace Akgg { public partial class ServiceInvoiceReport : XtraReport, IBeWoReport { public ServiceInvoiceReport() { this.InitializeComponent(); } public void SetReportDataSource(ServiceInvoiceRO pRO) { DateTime start = pRO.AccountingPeriodStart; DateTime end = pRO.AccountingPeriodEnd; if (start.Month == end.Month && start.Year == end.Year) { pRO.AccountingPeriod = String.Format("{0:MMMM yyyy}", start); } else { pRO.AccountingPeriod = String.Format("{0:MMMM yyyy} - {1:MMMM yyyy}", start, end); } StringBuilder sb = new StringBuilder(); if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation != "Selbstzahler") { sb.AppendLine(pRO.RecipientOrganisation); } if (!String.IsNullOrEmpty(pRO.RecipientContactPerson)) { sb.AppendLine(pRO.RecipientContactPerson); } if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation != "SELBSTZAHLER") { sb.AppendLine(pRO.RecipientDivision); } if (!String.IsNullOrEmpty(pRO.RecipientStreet)) { sb.AppendLine(pRO.RecipientStreet); } if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown)) { sb.AppendLine(""); sb.AppendLine(pRO.RecipientPostCodeAndTown); } lblAdresse.Text = sb.ToString(); this.bindingSource1.DataSource = pRO; } } }