83 lines
2.5 KiB
C#
83 lines
2.5 KiB
C#
using System;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.VisualStyles;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace VkmMenden
|
|
{
|
|
public partial class AllgemeineRechnung : XtraReport, IBeWoReport<InvoiceCustomerRO>
|
|
{
|
|
public AllgemeineRechnung()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(InvoiceCustomerRO pRO)
|
|
{
|
|
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.AppendLine(pRO.RecipientTown);
|
|
}
|
|
lblAdresse.Text = sb.ToString();
|
|
|
|
|
|
if (String.IsNullOrWhiteSpace(pRO.CustomerLastName))
|
|
{
|
|
lblCustomer1.Visible = false;
|
|
tableCustomer.Visible = false;
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(pRO.SenderPhone))
|
|
{
|
|
pRO.SenderPhone = pRO.SenderPhone.Replace("Tel.:", "").Trim();
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(pRO.SenderFax))
|
|
{
|
|
pRO.SenderFax = pRO.SenderFax.Replace("Fax:", "").Trim();
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(pRO.SenderMail))
|
|
{
|
|
pRO.SenderMail = pRO.SenderMail.Replace("E-Mail:", "").Trim();
|
|
}
|
|
|
|
cellDatum.Text = String.Format("{0:MMMM}/{0:yyyy}", pRO.AccountingPeriodStart);
|
|
|
|
if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower() == "herr")
|
|
pRO.CustomerSalutation = "Herrn";
|
|
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |