From 959b8ca1c01bb5e04a50bbe37a2843eaddc628f5 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Mon, 28 Jul 2025 11:58:52 +0200 Subject: [PATCH] Added address --- .../EntryMapper/CustomerContextEntryMapper.cs | 2 +- .../CustomerNavigationContextEntryMapper.cs | 4 ++-- ...OrganisationNavigationContextEntryMapper.cs | 2 +- .../PersonNavigationContextEntryMapper.cs | 2 +- BeWo/BeWoApp.xaml.cs | 2 +- Data/Entities/Address.cs | 18 ++++++++++++++++++ 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/AICore/Context/EntryMapper/CustomerContextEntryMapper.cs b/AICore/Context/EntryMapper/CustomerContextEntryMapper.cs index 3156411b8..3653afd99 100644 --- a/AICore/Context/EntryMapper/CustomerContextEntryMapper.cs +++ b/AICore/Context/EntryMapper/CustomerContextEntryMapper.cs @@ -29,7 +29,7 @@ namespace AICore.Context.EntryMapper pContext.PostalCode = pObject.Person.Address.PostalCode; pContext.Town = pObject.Person.Address.Town; pContext.DistanceInMeter = pObject.DistanceInMeter; - pContext.InvoiceAddress = "---"; + pContext.InvoiceAddress = pObject.Person.InvoiceAddress?.ToSingleLine() ?? "null"; } } } diff --git a/AICore/Context/EntryMapper/CustomerNavigationContextEntryMapper.cs b/AICore/Context/EntryMapper/CustomerNavigationContextEntryMapper.cs index 490ffb1b3..41448ca28 100644 --- a/AICore/Context/EntryMapper/CustomerNavigationContextEntryMapper.cs +++ b/AICore/Context/EntryMapper/CustomerNavigationContextEntryMapper.cs @@ -9,13 +9,13 @@ namespace AICore.Context.EntryMapper { public override void MergeWithObject(Customer pObject, CustomerNavigationContextEntry pContext) { - pContext.AddressString = "---"; + pContext.AddressString = pObject.Person.Address?.ToSingleLine() ?? "null"; pContext.CustomerAlias = pObject.CustomerAlias; pContext.CustomerOid = pObject.Oid.Value; pContext.DateOfBirth = pObject.Person.DateOfBirth; pContext.EquityContribution = pObject.EquityContribution; pContext.FullName = pObject.Person.FirstNameLastName; - pContext.InvoiceAddressString = "---"; + pContext.InvoiceAddressString = pObject.Person.InvoiceAddress?.ToSingleLine() ?? "null"; } } } diff --git a/AICore/Context/EntryMapper/OrganisationNavigationContextEntryMapper.cs b/AICore/Context/EntryMapper/OrganisationNavigationContextEntryMapper.cs index e32eeadba..2d38bda77 100644 --- a/AICore/Context/EntryMapper/OrganisationNavigationContextEntryMapper.cs +++ b/AICore/Context/EntryMapper/OrganisationNavigationContextEntryMapper.cs @@ -14,7 +14,7 @@ namespace AICore.Context.EntryMapper pContext.Name2 = pObject.Name2; pContext.DebitorNumber = pObject.DebitorNumber; pContext.BusinessPartnerId = pObject.BusinessPartnerId; - pContext.AddressString = "---"; + pContext.AddressString = pObject.Address?.ToSingleLine() ?? "null"; pContext.IKDatenannahmestelle = pObject.IKDatenannahmestelle; pContext.IKKostentrager = pObject.IKKostentrager; pContext.IKKrankenkasse = pObject.IKKrankenkasse; diff --git a/AICore/Context/EntryMapper/PersonNavigationContextEntryMapper.cs b/AICore/Context/EntryMapper/PersonNavigationContextEntryMapper.cs index e25219a9a..f49b0a704 100644 --- a/AICore/Context/EntryMapper/PersonNavigationContextEntryMapper.cs +++ b/AICore/Context/EntryMapper/PersonNavigationContextEntryMapper.cs @@ -9,7 +9,7 @@ namespace AICore.Context.EntryMapper { public override void MergeWithObject(Person pObject, PersonNavigationContextEntry pContext) { - pContext.AddressString = "---"; + pContext.AddressString = pObject.Address?.ToSingleLine() ?? "null"; pContext.DateOfBirth = pObject.DateOfBirth; //pContext.CustomerOid = "---"; //pContext.EmployeeOid = "---"; diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs index 428799441..74bf1e253 100644 --- a/BeWo/BeWoApp.xaml.cs +++ b/BeWo/BeWoApp.xaml.cs @@ -59,7 +59,7 @@ namespace BeWo public static string ShortVersion = "3.26"; - public static string Version = "Version 3.26 - 1.1 Test"; + public static string Version = "Version 3.26 - 1.2 Test"; public static int RenderTier = 0; public static bool IsInDesignMode = DesignerProperties.GetIsInDesignMode(new DependencyObject()); diff --git a/Data/Entities/Address.cs b/Data/Entities/Address.cs index 6796e4ef7..f564fd113 100644 --- a/Data/Entities/Address.cs +++ b/Data/Entities/Address.cs @@ -1,5 +1,7 @@ using BS.Shared; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; namespace BeWo.Data.Entities { @@ -56,5 +58,21 @@ namespace BeWo.Data.Entities { return string.IsNullOrWhiteSpace(Street + Town + PostalCode); } + + public virtual string ToSingleLine() + { + var parts = new List + { + AddressLine1, + AddressLine2, + Street, + PostalCode, + Town, + State, + Country + }; + + return string.Join(", ", parts.Where(p => !string.IsNullOrWhiteSpace(p))); + } } } \ No newline at end of file