Files
BeWoPlaner/ReportImp/BellaDonna/Rechnung67.cs

67 lines
2.0 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
namespace BellaDonna
{
[IDSpecificClass(Identifier = "Rechnung67")]
public partial class Rechnung67 : XtraReport, IBeWoReport<ServiceInvoiceRO>
{
public Rechnung67()
{
this.InitializeComponent();
}
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
lblRechnungnr.Text = pRO.InvoiceNumber;
String text = "";
if (start.Month == end.Month && start.Year == end.Year)
{
text = String.Format("Monat {0:MMMM yyyy}", start);
}
else
{
text = String.Format("Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy}", start, end);
}
lblAbrechnungszeitraum.Text = lblAbrechnungszeitraum.Text.Replace("#####", text);
this.bindingSource1.DataSource = pRO;
}
private void ChangeName(object sender, System.ComponentModel.CancelEventArgs e)
{
PrintingSystem.Document.Name = String.Format("Rechnung {0}", lblRechnungnr.Text);
}
}
}