using System; using System.Text; using BeWo.Report; using BeWo.Report.ReportObjects; using DevExpress.XtraReports.UI; namespace SPZLeverkusen { 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) { lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Monat {0:MMMM yyyy} folgende erbrachte Tätigkeiten:", start); } else { lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end); }*/ StringBuilder sb = new StringBuilder(); if (!String.IsNullOrEmpty(pRO.RecipientOrganisation)) { sb.AppendLine(pRO.RecipientOrganisation); } if (!String.IsNullOrEmpty(pRO.RecipientDivision)) { sb.AppendLine(pRO.RecipientDivision); } if (!String.IsNullOrEmpty(pRO.RecipientContactPerson)) { sb.AppendLine(pRO.RecipientContactPerson); } if (!String.IsNullOrEmpty(pRO.RecipientStreet)) { sb.AppendLine(pRO.RecipientStreet); } if (!String.IsNullOrEmpty(pRO.RecipientPoBox)) { sb.Append("Postfach "); sb.AppendLine(pRO.RecipientPoBox.Replace("Postfach", "").Trim()); } if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown)) { sb.AppendLine(pRO.RecipientPostCodeAndTown); } lblAdresse.Text = sb.ToString(); if (pRO.RecipientOrganisation == "Stadtverwaltung Leverkusen") { txtZeichen.Text = "112-Reg.III-ASDSW20-scha"; txtFachbereich.Text = "Kinder und Jugend / Hr. Schaal"; } else { txtZeichen.Text = pRO.CustomerReferenceNumber; if (String.IsNullOrEmpty(txtZeichen.Text)) { lblZeichen.Text = null; } txtFachbereich.Text = null; lblFachbereich.Text = null; } if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.Contains("Leverkusen") && pRO.RecipientOrganisation.Contains("Jugendamt")) { lblBemerkung.Text = lblBemerkung.Text.Replace("Nr. 16e", "Nr. 25"); } String datum = ""; if (pRO.InvoiceDateTime.HasValue) { datum = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceDateTime.Value.AddDays(14)); } lblBemerkung.Text = lblBemerkung.Text.Replace("{Datum}", datum); this.bindingSource1.DataSource = pRO; } } }