MH: Nous Rechnung

This commit is contained in:
2023-12-19 10:51:48 +01:00
parent 0625b6056f
commit cd08a151c0

View File

@@ -23,26 +23,37 @@ namespace Nous
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
var custDC = DAOFactory.SearchDAO.FindCustomer(pRO.CustomerFirstName, pRO.CustomerLastName, pRO.CustomerBirthdate.Value).ToList();
if (custDC.Count > 0)
if (pRO.CustomerBirthdate.HasValue)
{
if (custDC.Count == 1)
var custDC = DAOFactory.SearchDAO.FindCustomer(pRO.CustomerFirstName, pRO.CustomerLastName, pRO.CustomerBirthdate.Value).ToList();
if (custDC.Count > 0)
{
var dc = MapperFactory.CustomerDC_Customer.MapToNewDC(custDC[0]);
// Wenn InvoiceAddressTown Leverkusen, dann Leverkusener-Standort mit Logo und Adresse
if (dc.InvoiceAddressTown.ToLower().Contains("leverkusen"))
if (custDC.Count == 1)
{
pbLeverkusen.Visible = true;
lblAdresseLeverkusen.Visible = true;
}
else
{
pbStandard.Visible = true;
lblStandard.Visible = true;
lblAdresseStandard.Visible = true;
var dc = MapperFactory.CustomerDC_Customer.MapToNewDC(custDC[0]);
// Wenn InvoiceAddressTown Leverkusen, dann Leverkusener-Standort mit Logo und Adresse
if (dc.InvoiceAddressTown != null && dc.InvoiceAddressTown.ToLower().Contains("leverkusen"))
{
pbLeverkusen.Visible = true;
lblAdresseLeverkusen.Visible = true;
}
else
{
pbStandard.Visible = true;
lblStandard.Visible = true;
lblAdresseStandard.Visible = true;
}
}
}
}
else
{
pbStandard.Visible = true;
lblStandard.Visible = true;
lblAdresseStandard.Visible = true;
}
SetBewilligung(pRO);
SetzeEmpfaengerAdresse(pRO);