diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 236660868..fe483583f 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -962,6 +962,8 @@ BSLogoControl.xaml + + @@ -995,6 +997,7 @@ + diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml index 92ae98733..e26b672d2 100644 --- a/BeWo/BeWoApp.xaml +++ b/BeWo/BeWoApp.xaml @@ -83,6 +83,16 @@ + + + + + + + + + + diff --git a/BeWo/Converter/TooltipTextConverter.cs b/BeWo/Converter/TooltipTextConverter.cs index 4292574df..f38cde2fe 100644 --- a/BeWo/Converter/TooltipTextConverter.cs +++ b/BeWo/Converter/TooltipTextConverter.cs @@ -13,7 +13,12 @@ namespace BeWo.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if(value is GkvAbrechnungVM gkv) + if (value is bool val_bool) + { + return val_bool ? null : parameter; + } + + if (value is GkvAbrechnungVM gkv) { if (parameter is string s) { @@ -34,6 +39,7 @@ namespace BeWo.Converter return mandator.CanEditIKLeistungserbringerTooltip; } + return "xxx"; } diff --git a/BeWo/Converter/ValidationConverter.cs b/BeWo/Converter/ValidationConverter.cs new file mode 100644 index 000000000..6ee6613a2 --- /dev/null +++ b/BeWo/Converter/ValidationConverter.cs @@ -0,0 +1,32 @@ +using BeWo.ViewModel; +using BS.Shared; +using BS.Shared.Core; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; + +namespace BeWo.Converter +{ + public class ValidationConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is string val_str && parameter is ValidationType val_type) + { + return Validator.IsValid(val_type, val_str); + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BeWo/Converter/ValidationToBrushConverter.cs b/BeWo/Converter/ValidationToBrushConverter.cs new file mode 100644 index 000000000..59e980295 --- /dev/null +++ b/BeWo/Converter/ValidationToBrushConverter.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; + +namespace BeWo.Converter +{ + public class ValidationToBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is null) + { + return Brushes.Black; + } + + if(value is bool val_bool) + { + return val_bool ? Brushes.Black : Brushes.Red; + } + + return Brushes.Blue; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BeWo/Converter/ValidationToTooltipConverter.cs b/BeWo/Converter/ValidationToTooltipConverter.cs new file mode 100644 index 000000000..1aa37ac78 --- /dev/null +++ b/BeWo/Converter/ValidationToTooltipConverter.cs @@ -0,0 +1,36 @@ +using BS.Shared; +using BS.Shared.Core; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; + +namespace BeWo.Converter +{ + public class ValidationToTooltipConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is null) + { + return null; + } + + if (value is bool val_bool && parameter is ValidationType val_type) + { + return val_bool ? null : Validator.InvalidTooltipTxt(val_type); + } + + return "xxx"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml index 3388c399c..7aaf8fb46 100644 --- a/BeWo/View/Detail/CustomerView.xaml +++ b/BeWo/View/Detail/CustomerView.xaml @@ -14,6 +14,7 @@ xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="clr-namespace:BeWo.Security" + xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared" xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:val="clr-namespace:BeWo.Validation" @@ -954,10 +955,28 @@ Grid.Row="5" Grid.Column="2" Content="{markup:Translate Versichertennummer}" /> +