using System; using System.Collections.Generic; using System.Text; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Report; using BeWo.Report.ReportObjects; using BS.Shared; using BS.Shared.Core; using DevExpress.XtraReports.UI; namespace WahlEv { [IDSpecificClass(Identifier = "RechnungStunde")] public partial class Rechnung : XtraReport, IBeWoReport { public Rechnung() { this.InitializeComponent(); } public void SetReportDataSource(ServiceInvoiceRO pRO) { StringBuilder sb = new StringBuilder(); if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && !String.IsNullOrEmpty(pRO.RecipientOrganisation.Trim())) { sb.AppendLine(pRO.RecipientOrganisation); } if (!String.IsNullOrEmpty(pRO.RecipientContactPerson) && !String.IsNullOrEmpty(pRO.RecipientContactPerson.Trim())) { sb.AppendLine(pRO.RecipientContactPerson); } if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientDivision.Trim())) { sb.AppendLine(pRO.RecipientDivision); } if (!String.IsNullOrEmpty(pRO.RecipientStreet) && !String.IsNullOrEmpty(pRO.RecipientStreet.Trim())) { sb.AppendLine(pRO.RecipientStreet); } if (!String.IsNullOrEmpty(pRO.RecipientPoBox) && !String.IsNullOrEmpty(pRO.RecipientPoBox.Trim())) { sb.AppendLine(pRO.RecipientPoBox); } if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown) && !String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown.Trim())) { sb.AppendLine(""); sb.AppendLine(pRO.RecipientPostCodeAndTown); } lblAddress.Text = sb.ToString(); lblGesamt.Text = pRO.GrossClaim.Replace("€", "").Trim(); foreach (var sip in pRO.ServiceInvoicePeriods) { foreach (var ii in sip.ServiceInvoiceItems) { ii.GrossAmount = ii.GrossAmount.Replace("€", "").Trim(); } } this.bindingSource1.DataSource = pRO; } } }