From 0b281b5290fa19f01a51b1911fe5ca7854a0a3f8 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Mon, 6 Jul 2026 14:48:54 +0200 Subject: [PATCH] MailUtils wird noch von DakotaSender verwendet --- DakotaSender/DakotaSender.csproj | 4 +++ DakotaSender/Program.cs | 3 ++- DakotaUnitTest/DakotaUnitTest.csproj | 4 +++ DakotaUnitTest/MailUnitTest.cs | 14 ++-------- .../ServerUtils}/Core/AppSettingReader.cs | 2 +- .../Components/ServerUtils}/Core/MailUtils.cs | 4 +-- .../Components/ServerUtils/ServerUtils.csproj | 2 ++ Service/Core/Utils.cs | 1 + Service/Plugins/AiFunctionService.cs | 1 - Service/Service.csproj | 2 -- .../JsonError/JsonErrorHandler.cs | 1 - .../WCFError/WCFErrorHandler.cs | 1 - .../GkvAccountingServiceImp.cs | 1 + Shared/Extensions/DictionaryExtensions.cs | 26 +++++++++++++++++++ Shared/Shared.csproj | 1 + 15 files changed, 46 insertions(+), 21 deletions(-) rename {Service => Server/Components/ServerUtils}/Core/AppSettingReader.cs (98%) rename {Service => Server/Components/ServerUtils}/Core/MailUtils.cs (98%) create mode 100644 Shared/Extensions/DictionaryExtensions.cs diff --git a/DakotaSender/DakotaSender.csproj b/DakotaSender/DakotaSender.csproj index 730438015..c2b9a62bc 100644 --- a/DakotaSender/DakotaSender.csproj +++ b/DakotaSender/DakotaSender.csproj @@ -57,6 +57,10 @@ + + {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57} + ServerUtils + {2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4} Shared diff --git a/DakotaSender/Program.cs b/DakotaSender/Program.cs index 53cb9e178..8c7462676 100644 --- a/DakotaSender/Program.cs +++ b/DakotaSender/Program.cs @@ -1,4 +1,5 @@ -using BS.Shared; +using BeWo.ServerUtils.Core; +using BS.Shared; using BS.Shared.AppSender; using BS.Shared.Core; using BS.Shared.DataContracts; diff --git a/DakotaUnitTest/DakotaUnitTest.csproj b/DakotaUnitTest/DakotaUnitTest.csproj index 7b8cf05e7..496915c0c 100644 --- a/DakotaUnitTest/DakotaUnitTest.csproj +++ b/DakotaUnitTest/DakotaUnitTest.csproj @@ -65,6 +65,10 @@ {47331732-DD96-4075-869F-83AA9F3F9937} Dakota + + {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57} + ServerUtils + {094331c3-ecee-4c89-bbfd-4c9ded89f0ef} Service diff --git a/DakotaUnitTest/MailUnitTest.cs b/DakotaUnitTest/MailUnitTest.cs index f0bf077bd..972703ca4 100644 --- a/DakotaUnitTest/MailUnitTest.cs +++ b/DakotaUnitTest/MailUnitTest.cs @@ -1,4 +1,5 @@ -using BS.Shared.Core; +using BeWo.ServerUtils.Core; +using BS.Shared.Core; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace DakotaUnitTest @@ -16,16 +17,5 @@ namespace DakotaUnitTest Assert.IsTrue(success); } - - [TestMethod] - public void SendGkvViaSupportMail() - { - var title = "UnitTest - TITLE - ViaSupport"; - var body = "UnitTest - BODY - ViaSupport"; - - var success = MailUtils.SendGkvModuleTestErrorMail(title, body, "UnitTest - ViaSupport"); - - Assert.IsTrue(success); - } } } diff --git a/Service/Core/AppSettingReader.cs b/Server/Components/ServerUtils/Core/AppSettingReader.cs similarity index 98% rename from Service/Core/AppSettingReader.cs rename to Server/Components/ServerUtils/Core/AppSettingReader.cs index 75dc3022f..762be45e6 100644 --- a/Service/Core/AppSettingReader.cs +++ b/Server/Components/ServerUtils/Core/AppSettingReader.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BeWo.Service.Core +namespace BeWo.ServerUtils.Core { internal struct Module { diff --git a/Service/Core/MailUtils.cs b/Server/Components/ServerUtils/Core/MailUtils.cs similarity index 98% rename from Service/Core/MailUtils.cs rename to Server/Components/ServerUtils/Core/MailUtils.cs index 45353eddc..98dad08b6 100644 --- a/Service/Core/MailUtils.cs +++ b/Server/Components/ServerUtils/Core/MailUtils.cs @@ -1,5 +1,4 @@ using BS.Shared.AppSender; -using DevExpress.Mvvm.Native; using System; using System.Collections.Generic; using System.Configuration; @@ -10,8 +9,9 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using BS.Shared.Core; +using BS.Shared.Extensions; -namespace BeWo.Service.Core +namespace BeWo.ServerUtils.Core { public static class MailUtils { diff --git a/Server/Components/ServerUtils/ServerUtils.csproj b/Server/Components/ServerUtils/ServerUtils.csproj index 2f9f32144..a671547f1 100644 --- a/Server/Components/ServerUtils/ServerUtils.csproj +++ b/Server/Components/ServerUtils/ServerUtils.csproj @@ -89,7 +89,9 @@ + + diff --git a/Service/Core/Utils.cs b/Service/Core/Utils.cs index 319e06103..ebb8786e8 100644 --- a/Service/Core/Utils.cs +++ b/Service/Core/Utils.cs @@ -16,6 +16,7 @@ using System.Xml; using BeWo.Data; using BeWo.Data.Entities; using BeWo.Data.Security; +using BeWo.ServerUtils.Core; using BS.Shared; using BS.Shared.Core; using BS.Shared.Extensions; diff --git a/Service/Plugins/AiFunctionService.cs b/Service/Plugins/AiFunctionService.cs index d07b30ba5..1379d9baa 100644 --- a/Service/Plugins/AiFunctionService.cs +++ b/Service/Plugins/AiFunctionService.cs @@ -12,7 +12,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using AICore.Prompt.SystemPrompts; -using BeWo.Service.Core; using DevExpress.XtraCharts.Native; using System.IO; using BS.Shared.Interface; diff --git a/Service/Service.csproj b/Service/Service.csproj index 00a82a3da..ddef7c116 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -233,12 +233,10 @@ - - diff --git a/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs b/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs index 9e95e81f9..e9def75a7 100644 --- a/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs +++ b/Service/ServiceBehavior/JsonError/JsonErrorHandler.cs @@ -1,6 +1,5 @@ using BeWo.Data.Access; using BeWo.ServerUtils.Core; -using BeWo.Service.Core; using BS.Shared.Core; using System; using System.Collections.Generic; diff --git a/Service/ServiceBehavior/WCFError/WCFErrorHandler.cs b/Service/ServiceBehavior/WCFError/WCFErrorHandler.cs index 326e4705d..b26f69654 100644 --- a/Service/ServiceBehavior/WCFError/WCFErrorHandler.cs +++ b/Service/ServiceBehavior/WCFError/WCFErrorHandler.cs @@ -1,5 +1,4 @@ using BeWo.ServerUtils.Core; -using BeWo.Service.Core; using BS.Shared.Core; using DevExpress.CodeParser.Diagnostics; using log4net; diff --git a/Service/ServiceImplementations/GkvAccountingServiceImp.cs b/Service/ServiceImplementations/GkvAccountingServiceImp.cs index 09b8c2cfe..308a15b65 100644 --- a/Service/ServiceImplementations/GkvAccountingServiceImp.cs +++ b/Service/ServiceImplementations/GkvAccountingServiceImp.cs @@ -2,6 +2,7 @@ using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Data.Entities.Light; +using BeWo.ServerUtils.Core; using BeWo.Service.Core; using BeWo.Service.DCEntityMapper; using BeWo.Service.Plugins; diff --git a/Shared/Extensions/DictionaryExtensions.cs b/Shared/Extensions/DictionaryExtensions.cs new file mode 100644 index 000000000..4d38d97bb --- /dev/null +++ b/Shared/Extensions/DictionaryExtensions.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace BS.Shared.Extensions +{ + public static class DictionaryExtensions + { + public static T2 GetValueOrDefault(this Dictionary dictionary, T1 key, T2 t_default) + { + if (dictionary is null || !dictionary.Any()) + return t_default; + + if (dictionary.TryGetValue(key, out var val)) + { + return val; + } + + return t_default; + } + } +} diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 854f5ea31..f846f2666 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -425,6 +425,7 @@ +