diff --git a/BeWo/View/BeWoWindowBuilder.cs b/BeWo/View/BeWoWindowBuilder.cs index 78b14db8a..230f13e79 100644 --- a/BeWo/View/BeWoWindowBuilder.cs +++ b/BeWo/View/BeWoWindowBuilder.cs @@ -1,5 +1,6 @@ using BeWo.View.Controls; using BeWo.ViewModel; +using BS.Shared.Extensions; using System; using System.Collections.Generic; using System.Linq; @@ -55,11 +56,6 @@ namespace BeWo.View return beWoWindow; } - public static void ShowErrorMessageBox(string text) - { - MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Asterisk); - } - private static BeWoWindow GetGenericBeWoWindow(string title, double min_height, double height, double max_height, double min_width, double width, double max_width) { var beWoWindow = new BeWoWindow(); @@ -78,5 +74,18 @@ namespace BeWo.View return beWoWindow; } + + public static void ShowErrorMessageBox(string text) + { + MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Asterisk); + } + + public static void ShowTitleErrorMessageBox(string text, string title) + { + if (title.IsNullOrWhiteSpace()) + ShowErrorMessageBox(text); + else + MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Asterisk); + } } } diff --git a/BeWo/View/Controls/Utils/ColorPicker.xaml b/BeWo/View/Controls/Utils/ColorPicker.xaml index b03225071..35c3cf42a 100644 --- a/BeWo/View/Controls/Utils/ColorPicker.xaml +++ b/BeWo/View/Controls/Utils/ColorPicker.xaml @@ -14,26 +14,26 @@ x:Name="btn" Height="24" Padding="0" - Background="Transparent" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" dx:ThemeManager.ThemeName="None" + Background="Transparent" BorderBrush="Black" BorderThickness="1" Click="button_select_color_Click" Style="{x:Null}"> - - + + diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs index 95aa55fa7..e5ab3bbf5 100644 --- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs +++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs @@ -165,7 +165,7 @@ namespace BeWo.View.Detail.Accounting } else { - BeWoWindowBuilder.ShowErrorMessageBox(cb.Message); + BeWoWindowBuilder.ShowTitleErrorMessageBox(cb.Message, cb.TitleMessage); } })); } diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs index d786d3735..39ad7908c 100644 --- a/Service/ServiceImplementations/AccountingServiceImp.cs +++ b/Service/ServiceImplementations/AccountingServiceImp.cs @@ -861,7 +861,9 @@ namespace BeWo.Service.ServiceImplementations } catch (GkvException exc) { - response.Message = exc.Message; + if (exc.Title.IsNotNullOrWhiteSpace()) + response.TitleMessage = exc.Title; + response.Message = exc.Message; } catch (Exception e) { diff --git a/Shared/DataContracts/AppResponseDC.cs b/Shared/DataContracts/AppResponseDC.cs index f088fa02b..90994c38b 100644 --- a/Shared/DataContracts/AppResponseDC.cs +++ b/Shared/DataContracts/AppResponseDC.cs @@ -12,6 +12,7 @@ namespace BS.Shared.DataContracts { [DataMember] public bool Success { get; set; } [DataMember] public string Message { get; set; } + [DataMember] public string TitleMessage { get; set; } public AppResponseDC(bool success) { @@ -22,5 +23,10 @@ namespace BS.Shared.DataContracts { Message = message; } + + public AppResponseDC(bool success, string message, string title) : this(success, message) + { + TitleMessage = title; + } } } diff --git a/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs b/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs index 123384dc0..8e51ff31d 100644 --- a/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs +++ b/Shared/DataContracts/GkvAbrechnung/GkvResponseDC.cs @@ -13,5 +13,6 @@ namespace BS.Shared.DataContracts.GkvAbrechnung public GkvResponseDC() : base(false) { } public GkvResponseDC(bool success) : base(success) { } public GkvResponseDC(bool success, string message) : base(success, message) { } + public GkvResponseDC(bool success, string message, string title) : base(success, message, title) { } } } diff --git a/Shared/Extensions/StringExtensions.cs b/Shared/Extensions/StringExtensions.cs index cb8fa89e2..1634cc959 100644 --- a/Shared/Extensions/StringExtensions.cs +++ b/Shared/Extensions/StringExtensions.cs @@ -88,10 +88,12 @@ namespace BS.Shared.Extensions return pString?.Replace("ẞ", "ß"); } + public static bool IsNotNullOrWhiteSpace(this string pString) + => !pString.IsNullOrWhiteSpace(); + public static bool IsNullOrWhiteSpace(this string str) + => string.IsNullOrEmpty(str); public static string ToNullIfEmpty(this string str) - { - return string.IsNullOrWhiteSpace(str) ? null : str; - } + => str.IsNullOrWhiteSpace() ? null : str; public static string ToFormatFollows(this string str1, string str2, char seperator = ' ') {