From 1c1693de4906ed8743ff3669106032d052265a41 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 12:44:38 +0200 Subject: [PATCH 01/50] Factories --- BeWo/BeWo.csproj | 6 ++ BeWo/MainControl.xaml.cs | 60 +++++++++++++++---- BeWo/Services/BeWoControlFactory.cs | 29 +++++++++ BeWo/Services/BeWoWindowFactory.cs | 59 ++++++++++++++++++ BeWo/Services/BeWoWindowService.cs | 55 +++++++++++++++++ BeWo/Services/IControlFactory.cs | 15 +++++ BeWo/Services/IWindowFactory.cs | 18 ++++++ BeWo/Services/IWindowService.cs | 17 ++++++ .../Zeiterfassung/ServiceRecordView2.xaml.cs | 11 +--- .../Navigation/CustomerNavigationView.xaml.cs | 9 +-- .../Navigation/EmployeeNavigationView.xaml.cs | 9 +-- .../Navigation/PersonNavigationView.xaml.cs | 9 +-- BeWo/View/Windows/AiWindowBuilder.cs | 42 +------------ BeWo/View/Windows/BeWoWindowBuilder.cs | 26 -------- 14 files changed, 256 insertions(+), 109 deletions(-) create mode 100644 BeWo/Services/BeWoControlFactory.cs create mode 100644 BeWo/Services/BeWoWindowFactory.cs create mode 100644 BeWo/Services/BeWoWindowService.cs create mode 100644 BeWo/Services/IControlFactory.cs create mode 100644 BeWo/Services/IWindowFactory.cs create mode 100644 BeWo/Services/IWindowService.cs diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 71a377028..c9d53ea5c 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -96,6 +96,12 @@ + + + + + + AiConfigView.xaml diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs index 761f15d7a..0081bc5f3 100644 --- a/BeWo/MainControl.xaml.cs +++ b/BeWo/MainControl.xaml.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; +using System.Runtime.Remoting.Contexts; using System.Security.Cryptography; using System.Text; using System.Windows; @@ -19,6 +20,7 @@ using BeWo.Core.Service; using BeWo.Scheduler.View; using BeWo.SchulbegleitenderDienst; using BeWo.ServiceProxy; +using BeWo.Services; using BeWo.View; using BeWo.View.Detail; using BeWo.View.Detail.Zeiterfassung; @@ -33,6 +35,7 @@ using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.Extensions; using BS.Shared.Translation; +using DevExpress.XtraEditors; using Hyperlink = System.Windows.Documents.Hyperlink; namespace BeWo @@ -180,9 +183,35 @@ namespace BeWo #endif UpdateMandator(); + + ControlFactory = new BeWoControlFactory(); + WindowFactory = new BeWoWindowFactory(); + WindowService = new BeWoWindowService(WindowFactory, ControlFactory); } - public AnimatedBeWoWindow CurrentAnimatedBeWoWindow { get; set; } + private AnimatedBeWoWindow _CurrentAnimatedBeWoWindow; + public AnimatedBeWoWindow CurrentAnimatedBeWoWindow + { + get => _CurrentAnimatedBeWoWindow; + set + { + if (value == _CurrentAnimatedBeWoWindow) + return; + + _CurrentAnimatedBeWoWindow = value; + + if (value is null) + HideModalBackground(); + else + { + ShowModalBackground(); + } + } + } + + internal IControlFactory ControlFactory { get; set; } + internal IWindowFactory WindowFactory { get; set; } + internal IWindowService WindowService { get; set; } public List OpenedModalViewWindows { get; set; } @@ -379,8 +408,7 @@ namespace BeWo if (_ModalPopupControls.Count == 0) { - grid_main.Children.Remove(ModalPopupBackGround); - ModalPopupBackGround = null; + HideModalBackground(); } else { @@ -471,16 +499,6 @@ namespace BeWo } } - public void ShowViewAsModalPopup(string title, Control control, HorizontalAlignment horizontalAlignment = HorizontalAlignment.Center, VerticalAlignment verticalAlignment = VerticalAlignment.Center) - { - var groupbox = new GroupBox(); - - groupbox.Header = title; - groupbox.Content = control; - - ShowControlAsModalPopup(groupbox, horizontalAlignment, verticalAlignment); - } - public void ShowControlAsModalPopup(Control control) { ShowControlAsModalPopup(control, HorizontalAlignment.Center, VerticalAlignment.Center); @@ -933,6 +951,11 @@ namespace BeWo internal void ShowModalBackground() { + if (ModalPopupBackGround is Grid && grid_main.Children.Contains(ModalPopupBackGround)) + { + return; + } + ModalPopupBackGround = new Grid { IsHitTestVisible = true, @@ -948,6 +971,17 @@ namespace BeWo Panel.SetZIndex(ModalPopupBackGround, 500); } + internal void HideModalBackground() + { + if (ModalPopupBackGround is null || !grid_main.Children.Contains(ModalPopupBackGround)) + { + return; + } + + grid_main.Children.Remove(ModalPopupBackGround); + ModalPopupBackGround = null; + } + private void logoutanimation_Completed(object sender, EventArgs e) { //var navigationService = NavigationService.GetNavigationService(this); diff --git a/BeWo/Services/BeWoControlFactory.cs b/BeWo/Services/BeWoControlFactory.cs new file mode 100644 index 000000000..d09f56ba9 --- /dev/null +++ b/BeWo/Services/BeWoControlFactory.cs @@ -0,0 +1,29 @@ +using BeWo.View.Detail.AI; +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal class BeWoControlFactory : IControlFactory + { + public Control GetAiConversationControl(UIContext uIContext, Dictionary context) + { +#if !DEBUG + BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); + return null; +#endif + + var control = new AiConversationChatView(); + + control.ViewModel.UIContext = (int)uIContext; + control.ViewModel.ContextBeWoObjects = context; + + return control; + } + } +} diff --git a/BeWo/Services/BeWoWindowFactory.cs b/BeWo/Services/BeWoWindowFactory.cs new file mode 100644 index 000000000..2dfc079ce --- /dev/null +++ b/BeWo/Services/BeWoWindowFactory.cs @@ -0,0 +1,59 @@ +using BeWo.View.Detail.AI; +using BeWo.View.Windows; +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal class BeWoWindowFactory : IWindowFactory + { + public Dictionary UIContext2Header { get; set; } = new Dictionary() + { + {UIContext.ServiceRecord, "Zeiterfassung KI Chat" }, + {UIContext.Customer, "Klienten Übersicht KI Chat" }, + {UIContext.Person, "Personen Übersicht KI Chat" }, + {UIContext.Employee, "Mitarbeiter Übersicht KI Chat" }, + }; + + public AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200) + { +#if !DEBUG + BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); + return null; +#endif + + string title = null; + + UIContext2Header.TryGetValue(uIContext, out title); + + if (string.IsNullOrEmpty(title)) + title = "default"; + + var window = GetAnimatedBeWoWindow(title, control,height, width); + + return window; + } + + public AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double height = 600, double width = 600) + { + var beWoWindow = new AnimatedBeWoWindow(); + + beWoWindow.Height = height; + beWoWindow.Width = width; + + beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; + beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; + beWoWindow.Title = title + " Fenster"; + beWoWindow.rootGroupBox.Header = title; + beWoWindow.GroupBoxContent = control; + + return beWoWindow; + } + } +} diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs new file mode 100644 index 000000000..66b18cfdf --- /dev/null +++ b/BeWo/Services/BeWoWindowService.cs @@ -0,0 +1,55 @@ +using BeWo.View.Windows; +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal class BeWoWindowService : IWindowService + { + private readonly IWindowFactory _builder; + private readonly IControlFactory _controlFactory; + + public BeWoWindowService(IWindowFactory builder, IControlFactory controlFactory) + { + _builder = builder; + _controlFactory = controlFactory; + } + + public void ShowAiConversationWindow(UIContext uIContext, Dictionary bewoObjects) + { + ShowWindowDialog( + cf => cf.GetAiConversationControl(uIContext, bewoObjects), + (wf, ctrl) => wf.GetAiConversationWindow(uIContext, ctrl)); + } + public void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary bewoObjects) + { + ShowModalViewWindow(cf => cf.GetAiConversationControl(uIContext, bewoObjects)); + } + + private void ShowWindow(Func getControl, Func getWindow) + { + var control = getControl(_controlFactory); + var window = getWindow(_builder, control); + window.Show(); + } + + private void ShowWindowDialog(Func getControl, Func getWindow) + { + var control = getControl(_controlFactory); + var window = getWindow(_builder, control); + window.ShowDialog(); + } + + private void ShowModalViewWindow(Func getControl) + { + var control = getControl(_controlFactory); + BeWoApp.MainControl.ShowControlAsModalPopup(control); + } + } +} diff --git a/BeWo/Services/IControlFactory.cs b/BeWo/Services/IControlFactory.cs new file mode 100644 index 000000000..c37a86b90 --- /dev/null +++ b/BeWo/Services/IControlFactory.cs @@ -0,0 +1,15 @@ +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal interface IControlFactory + { + Control GetAiConversationControl(UIContext uIContext, Dictionary context); + } +} diff --git a/BeWo/Services/IWindowFactory.cs b/BeWo/Services/IWindowFactory.cs new file mode 100644 index 000000000..82763c0f3 --- /dev/null +++ b/BeWo/Services/IWindowFactory.cs @@ -0,0 +1,18 @@ +using BeWo.View.Windows; +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal interface IWindowFactory + { + AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200); + AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double height = 600, double width = 600); + } +} diff --git a/BeWo/Services/IWindowService.cs b/BeWo/Services/IWindowService.cs new file mode 100644 index 000000000..3612d453e --- /dev/null +++ b/BeWo/Services/IWindowService.cs @@ -0,0 +1,17 @@ +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace BeWo.Services +{ + internal interface IWindowService + { + void ShowAiConversationWindow(UIContext uIContext, Dictionary bewoObjects); + void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary bewoObjects); + } +} diff --git a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml.cs b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml.cs index 953bc7586..535a4f29e 100644 --- a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml.cs +++ b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml.cs @@ -5095,20 +5095,15 @@ namespace BeWo.View.Detail.Zeiterfassung var context = ViewModel.GetVisibleInformationReferences(records); - var window = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationWindow(UIContext.ServiceRecord, context); - - window?.ShowDialog(); - } + MainControl.WindowService.ShowAiConversationWindow(UIContext.ServiceRecord, context); + } private void Ai_Button2_Click(object sender, RoutedEventArgs e) { var records = GetVisibleRecordVMs(); var context = ViewModel.GetVisibleInformationReferences(records); - var control = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationControl(UIContext.ServiceRecord, context); - - if(control is object) - MainControl.ShowControlAsModalPopup(control); + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.ServiceRecord, context); } private IEnumerable GetVisibleRecordVMs() diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs index 75558e8df..fb2534669 100644 --- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs +++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs @@ -205,19 +205,14 @@ namespace BeWo.View.Navigation { var context = GetVisibleInformationReferences(); - var window = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationWindow(UIContext.Customer, context); - - window?.ShowDialog(); + MainControl.WindowService.ShowAiConversationWindow(UIContext.Customer, context); } private void OpenAiPopup() { var context = GetVisibleInformationReferences(); - var control = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationControl(UIContext.Customer, context); - - if (control is object) - MainControl.ShowControlAsModalPopup(control); + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Customer, context); } private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs) diff --git a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs index 4aeedae1a..1d0b623b3 100644 --- a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs +++ b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs @@ -112,19 +112,14 @@ namespace BeWo.View.Navigation { var context = GetVisibleInformationReferences(); - var window = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationWindow(UIContext.Employee, context); - - window?.ShowDialog(); + MainControl.WindowService.ShowAiConversationWindow(UIContext.Employee, context); } private void OpenAiPopup() { var context = GetVisibleInformationReferences(); - var control = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationControl(UIContext.Employee, context); - - if (control is object) - MainControl.ShowControlAsModalPopup(control); + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Employee, context); } private bool MainNavigationView_ArchiveObject(IFilterableDC obj) diff --git a/BeWo/View/Navigation/PersonNavigationView.xaml.cs b/BeWo/View/Navigation/PersonNavigationView.xaml.cs index 68753b81d..34fdce350 100644 --- a/BeWo/View/Navigation/PersonNavigationView.xaml.cs +++ b/BeWo/View/Navigation/PersonNavigationView.xaml.cs @@ -114,19 +114,14 @@ namespace BeWo.View.Navigation { var context = GetVisibleInformationReferences(); - var window = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationWindow(UIContext.Person, context); - - window?.ShowDialog(); + MainControl.WindowService.ShowAiConversationWindow(UIContext.Person, context); } private void OpenAiPopup() { var context = GetVisibleInformationReferences(); - var control = BeWoWindowBuilder.AiWindowBuilder.GetAiConversationControl(UIContext.Person, context); - - if (control is object) - MainControl.ShowControlAsModalPopup(control); + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Person, context); } private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs) diff --git a/BeWo/View/Windows/AiWindowBuilder.cs b/BeWo/View/Windows/AiWindowBuilder.cs index 9b3bca173..3dfe34cfd 100644 --- a/BeWo/View/Windows/AiWindowBuilder.cs +++ b/BeWo/View/Windows/AiWindowBuilder.cs @@ -13,46 +13,6 @@ namespace BeWo.View.Windows { public class AiWindowBuilder { - public Dictionary UIContext2Header { get; set; } = new Dictionary() - { - {UIContext.ServiceRecord, "Zeiterfassung KI Chat" }, - {UIContext.Customer, "Klienten Übersicht KI Chat" }, - }; - - public Window GetAiConversationWindow(UIContext uIContext, Dictionary context, double height = 600, double width = 1200) - { -#if !DEBUG - BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); - return null; -#endif - - string title = null; - - UIContext2Header.TryGetValue(uIContext, out title); - - if (string.IsNullOrEmpty(title)) - title = "default"; - - var control = GetAiConversationControl(uIContext, context); - - var window = GetAnimatedBeWoWindow(title, control, 400, height, 1000, 500, width, 1600); - - return window; - } - - public UserControl GetAiConversationControl(UIContext uIContext, Dictionary context) - { -#if !DEBUG - BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); - return null; -#endif - - var control = new AiConversationChatView(); - - control.ViewModel.UIContext = (int)uIContext; - control.ViewModel.ContextBeWoObjects = context; - - return control; - } + } } diff --git a/BeWo/View/Windows/BeWoWindowBuilder.cs b/BeWo/View/Windows/BeWoWindowBuilder.cs index dc32995f9..1a5b932da 100644 --- a/BeWo/View/Windows/BeWoWindowBuilder.cs +++ b/BeWo/View/Windows/BeWoWindowBuilder.cs @@ -86,32 +86,6 @@ namespace BeWo.View.Windows return beWoWindow; } - public static AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double min_height, double height, double max_height, double min_width, double width, double max_width) - { - var beWoWindow = new AnimatedBeWoWindow(); - - if (min_height > height || height > max_height) - throw new InvalidOperationException($"Window Height: {min_height} < {height} < {max_height}"); - - if (min_width > width || width > max_width) - throw new InvalidOperationException($"Window Width: {min_width} < {width} < {max_width}"); - - beWoWindow.Height = height; - beWoWindow.MinHeight = min_height; - beWoWindow.MaxHeight = max_height; - beWoWindow.Width = width; - beWoWindow.MinWidth = min_width; - beWoWindow.MaxHeight = max_width; - - beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; - beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; - beWoWindow.Title = title + " Fenster"; - beWoWindow.rootGroupBox.Header = title; - beWoWindow.GroupBoxContent = control; - - return beWoWindow; - } - public static void ShowErrorMessageBox(string text) { MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Asterisk); From 782d9f7a3a62a43ebe33ae99dff764adc96fea4e Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 13:21:03 +0200 Subject: [PATCH 02/50] Background Fade --- BeWo/MainControl.xaml.cs | 36 +++++++++++++++----- BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs | 5 --- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs index 0081bc5f3..e50af7cca 100644 --- a/BeWo/MainControl.xaml.cs +++ b/BeWo/MainControl.xaml.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; +using System.IO.Ports; using System.Linq; using System.Runtime.Remoting.Contexts; using System.Security.Cryptography; @@ -201,10 +202,10 @@ namespace BeWo _CurrentAnimatedBeWoWindow = value; if (value is null) - HideModalBackground(); + HideModalBackgroundFade(.5); else { - ShowModalBackground(); + ShowModalBackgroundFade(.5); } } } @@ -949,18 +950,26 @@ namespace BeWo } } - internal void ShowModalBackground() + internal void ShowModalBackgroundFade(double duration = 0.3, double opacity = 0.5) + { + if (ModalPopupBackGround is Grid && grid_main.Children.Contains(ModalPopupBackGround)) + return; + + ShowModalBackground(0); + DoubleAnimation lAnim = new DoubleAnimation(opacity, new Duration(TimeSpan.FromSeconds(duration))); + ModalPopupBackGround.BeginAnimation(OpacityProperty, lAnim); + } + + internal void ShowModalBackground(double start_opacity = .5) { if (ModalPopupBackGround is Grid && grid_main.Children.Contains(ModalPopupBackGround)) - { return; - } ModalPopupBackGround = new Grid { IsHitTestVisible = true, Background = Brushes.White, - Opacity = .5 + Opacity = start_opacity }; Grid.SetColumnSpan(ModalPopupBackGround, 3); @@ -971,12 +980,23 @@ namespace BeWo Panel.SetZIndex(ModalPopupBackGround, 500); } + internal void HideModalBackgroundFade(double duration = 0.3) + { + if (ModalPopupBackGround is null || !grid_main.Children.Contains(ModalPopupBackGround)) + return; + + DoubleAnimation lAnim = new DoubleAnimation(0, new Duration(TimeSpan.FromSeconds(duration))); + lAnim.Completed += (s, e) => + { + HideModalBackground(); + }; + ModalPopupBackGround.BeginAnimation(OpacityProperty, lAnim); + } + internal void HideModalBackground() { if (ModalPopupBackGround is null || !grid_main.Children.Contains(ModalPopupBackGround)) - { return; - } grid_main.Children.Remove(ModalPopupBackGround); ModalPopupBackGround = null; diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs index c1f9055e3..369de6bf3 100644 --- a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs +++ b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs @@ -64,11 +64,6 @@ namespace BeWo.View.Windows rootGroupBox.Content = fe; } - public AnimatedBeWoWindow(FrameworkElement fe, string stylestring) : this(fe) - { - rootGroupBox.Style = (Style)FindResource(stylestring); - } - public void Window_Closing(object sender, CancelEventArgs e) { if (!closeStoryBoardCompleted && !isClosing) From 61b42b3235a4516db92dfdff4617085bb1cd228b Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 13:35:45 +0200 Subject: [PATCH 03/50] Keine Exceptions --- BeWo/Services/BeWoControlFactory.cs | 5 ----- BeWo/Services/BeWoWindowFactory.cs | 5 ----- BeWo/Services/BeWoWindowService.cs | 11 +++++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BeWo/Services/BeWoControlFactory.cs b/BeWo/Services/BeWoControlFactory.cs index d09f56ba9..828f5c42c 100644 --- a/BeWo/Services/BeWoControlFactory.cs +++ b/BeWo/Services/BeWoControlFactory.cs @@ -13,11 +13,6 @@ namespace BeWo.Services { public Control GetAiConversationControl(UIContext uIContext, Dictionary context) { -#if !DEBUG - BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); - return null; -#endif - var control = new AiConversationChatView(); control.ViewModel.UIContext = (int)uIContext; diff --git a/BeWo/Services/BeWoWindowFactory.cs b/BeWo/Services/BeWoWindowFactory.cs index 2dfc079ce..2db9bcc72 100644 --- a/BeWo/Services/BeWoWindowFactory.cs +++ b/BeWo/Services/BeWoWindowFactory.cs @@ -23,11 +23,6 @@ namespace BeWo.Services public AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200) { -#if !DEBUG - BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); - return null; -#endif - string title = null; UIContext2Header.TryGetValue(uIContext, out title); diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs index 66b18cfdf..7cbb8f80f 100644 --- a/BeWo/Services/BeWoWindowService.cs +++ b/BeWo/Services/BeWoWindowService.cs @@ -23,12 +23,23 @@ namespace BeWo.Services public void ShowAiConversationWindow(UIContext uIContext, Dictionary bewoObjects) { +#if !DEBUG + BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); + return; +#endif + ShowWindowDialog( cf => cf.GetAiConversationControl(uIContext, bewoObjects), (wf, ctrl) => wf.GetAiConversationWindow(uIContext, ctrl)); + } public void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary bewoObjects) { +#if !DEBUG + BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase."); + return; +#endif + ShowModalViewWindow(cf => cf.GetAiConversationControl(uIContext, bewoObjects)); } From 4c65d206fc1f8af50162681c05a80d90c1b02c57 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 14:23:25 +0200 Subject: [PATCH 04/50] Organisation Navigation View + SupportConcept NavigationView --- BeWo/BeWo.csproj | 1 - .../OrganisationNavigationView.xaml.cs | 60 ++++++- .../SupportConceptNavigationView.xaml | 153 ++++++++++-------- .../SupportConceptNavigationView.xaml.cs | 52 +++++- BeWo/View/Windows/AiWindowBuilder.cs | 18 --- BeWo/View/Windows/BeWoWindowBuilder.cs | 2 - .../CompactOrganisationDC_Organisation.cs | 25 ++- .../CompactSupportConceptDC_SupportConcept.cs | 129 ++++++++------- Service/ServiceUtils/AiSystemBuilder.cs | 67 +++++++- 9 files changed, 342 insertions(+), 165 deletions(-) delete mode 100644 BeWo/View/Windows/AiWindowBuilder.cs diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index c9d53ea5c..35f26dfbc 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -110,7 +110,6 @@ AiConversationChatModalPopup.xaml - AnimatedBeWoWindow.xaml diff --git a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs index fc4aa08ad..c53f57b08 100644 --- a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs +++ b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows; +using System.Windows.Input; using BeWo.Core; using BeWo.Core.Service; using BeWo.ServiceProxy; @@ -13,6 +15,7 @@ using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.DataContracts.Compact; using BS.Shared.Extensions; +using DevExpress.Mvvm; using Microsoft.Win32; namespace BeWo.View.Navigation @@ -27,21 +30,64 @@ namespace BeWo.View.Navigation public OrganisationNavigationView() { - this.InitializeComponent(); + InitializeComponent(); - this.mainNavigationView.Sorter = new OrganisationSorter(); + mainNavigationView.OpenAiWindowCommand = new DelegateCommand(OpenAiWindow, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView)); + mainNavigationView.OpenAiPopupCommand = new DelegateCommand(OpenAiPopup, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView2)); - this.mainNavigationView.ArchiveButtonVisible = + mainNavigationView.Sorter = new OrganisationSorter(); + + mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Organisation_AllowArchiving); - this.mainNavigationView.ShowArchivedObjectsVisible = true; + mainNavigationView.ShowArchivedObjectsVisible = true; } private void OnLoaded(object sender, RoutedEventArgs e) { ReloadData(false); - } - private void mainNavigationView_CreateNewObject() + CommandManager.InvalidateRequerySuggested(); + } + + public Dictionary GetVisibleInformationReferences() + { + var visible = mainNavigationView.objectListBox.ItemsSource; + + return GetVisibleInformationReferences(visible); + } + + private Dictionary GetVisibleInformationReferences(IEnumerable visible_persons) + { + var oids = new List(); + foreach (var p in visible_persons) + { + var orga = p as CompactOrganisationDC; + oids.Add(orga.OrganisationOid); + } + + var dict = new Dictionary() { + { + TableID.Organisation, oids.ToArray()} + }; + + return dict; + } + + private void OpenAiWindow() + { + var context = GetVisibleInformationReferences(); + + MainControl.WindowService.ShowAiConversationWindow(UIContext.Organisation, context); + } + + private void OpenAiPopup() + { + var context = GetVisibleInformationReferences(); + + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Organisation, context); + } + + private void mainNavigationView_CreateNewObject() { VMFactory.CreateOrganisationVMAsync(cb => this.Dispatch(delegate { this.MainControl.NavigateTo(new OrganisationView(cb) { ParentView = this }); })); } diff --git a/BeWo/View/Navigation/SupportConceptNavigationView.xaml b/BeWo/View/Navigation/SupportConceptNavigationView.xaml index b857d87a1..5faa01d13 100644 --- a/BeWo/View/Navigation/SupportConceptNavigationView.xaml +++ b/BeWo/View/Navigation/SupportConceptNavigationView.xaml @@ -1,68 +1,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs index 8b414dd0e..6c3e0dd18 100644 --- a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs +++ b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs @@ -23,6 +23,9 @@ using BeWo.MultiLanguage; using BS.Shared.Translation; using Microsoft.Win32; using BeWo.View.Windows; +using DevExpress.Mvvm; +using System.Collections; +using System.Windows.Input; namespace BeWo.View.Navigation { @@ -44,7 +47,10 @@ namespace BeWo.View.Navigation { this.InitializeComponent(); - this.mainNavigationView.Sorter = new SupportConceptSorter(); + mainNavigationView.OpenAiWindowCommand = new DelegateCommand(OpenAiWindow, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView)); + mainNavigationView.OpenAiPopupCommand = new DelegateCommand(OpenAiPopup, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView2)); + + this.mainNavigationView.Sorter = new SupportConceptSorter(); this.mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConceptView_AllowArchiving); this.mainNavigationView.ShowArchivedObjectsVisible = true; @@ -194,7 +200,45 @@ namespace BeWo.View.Navigation } } - private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs) + public Dictionary GetVisibleInformationReferences() + { + var visible = mainNavigationView.objectListBox.ItemsSource; + + return GetVisibleInformationReferences(visible); + } + + private Dictionary GetVisibleInformationReferences(IEnumerable visible_persons) + { + var oids = new List(); + foreach (var p in visible_persons) + { + var scdc = p as CompactSupportConceptDC; + oids.Add(scdc.SupportConceptOid); + } + + var dict = new Dictionary() { + { + TableID.SupportConcept, oids.ToArray()} + }; + + return dict; + } + + private void OpenAiWindow() + { + var context = GetVisibleInformationReferences(); + + MainControl.WindowService.ShowAiConversationWindow(UIContext.SupportConcept, context); + } + + private void OpenAiPopup() + { + var context = GetVisibleInformationReferences(); + + MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.SupportConcept, context); + } + + private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs) { //chkShowOnlyTeamSCs.IsChecked = false; //BeWoApp.AppSettings.ShowOnlyMySupportConcepts = this.chkShowOnlyMySCs.IsChecked.Value; @@ -232,7 +276,9 @@ namespace BeWo.View.Navigation private void OnLoaded(object sender, RoutedEventArgs e) { ReloadData(false); - } + + CommandManager.InvalidateRequerySuggested(); + } private void UpdateCustomFilter() { diff --git a/BeWo/View/Windows/AiWindowBuilder.cs b/BeWo/View/Windows/AiWindowBuilder.cs deleted file mode 100644 index 3dfe34cfd..000000000 --- a/BeWo/View/Windows/AiWindowBuilder.cs +++ /dev/null @@ -1,18 +0,0 @@ -using BeWo.View.Detail.AI; -using BS.Shared; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using static BeWo.View.Windows.BeWoWindowBuilder; - -namespace BeWo.View.Windows -{ - public class AiWindowBuilder - { - - } -} diff --git a/BeWo/View/Windows/BeWoWindowBuilder.cs b/BeWo/View/Windows/BeWoWindowBuilder.cs index 1a5b932da..a58d0bc4e 100644 --- a/BeWo/View/Windows/BeWoWindowBuilder.cs +++ b/BeWo/View/Windows/BeWoWindowBuilder.cs @@ -15,8 +15,6 @@ namespace BeWo.View.Windows { public static class BeWoWindowBuilder { - public static AiWindowBuilder AiWindowBuilder { get; } = new AiWindowBuilder(); - public static BeWoWindow GetTextViewer(string title, string text, bool fixed_size = false, double height = 600, double width = 600) { if (fixed_size) diff --git a/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs b/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs index 4ab4652a5..725fcdaaa 100644 --- a/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs +++ b/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs @@ -57,12 +57,21 @@ namespace BeWo.Service.DCEntityMapper return pDC.OrganisationOid == pEntity.Oid; } - //public override CompactOrganisationDC CreateNewDC() - //{ - // CompactOrganisationDC dc = new CompactOrganisationDC(); - // dc.CostRatePeriods = new List(); - // return dc; - //} - - } + //public override CompactOrganisationDC CreateNewDC() + //{ + // CompactOrganisationDC dc = new CompactOrganisationDC(); + // dc.CostRatePeriods = new List(); + // return dc; + //} + + public override Dictionary ToJsonDictionary(CompactOrganisationDC pDC) + { + var jsonObject = new Dictionary() + { + {"BusinessPartnerId", pDC.BusinessPartnerId }, + }; + + return jsonObject; + } + } } \ No newline at end of file diff --git a/Service/DCEntityMapper/CompactSupportConceptDC_SupportConcept.cs b/Service/DCEntityMapper/CompactSupportConceptDC_SupportConcept.cs index e7e23fc2d..ab9373754 100644 --- a/Service/DCEntityMapper/CompactSupportConceptDC_SupportConcept.cs +++ b/Service/DCEntityMapper/CompactSupportConceptDC_SupportConcept.cs @@ -1,80 +1,91 @@ using System; - +using System.Collections.Generic; using BeWo.Data.Entities; using BS.Shared.DataContracts.Compact; namespace BeWo.Service.DCEntityMapper { - public class CompactSupportConceptDC_SupportConcept : AbstractIDCEntityMapper - { - #region Public Methods + public class CompactSupportConceptDC_SupportConcept : AbstractIDCEntityMapper + { + public override CompactSupportConceptDC MergeWithDC(SupportConcept pEntity, CompactSupportConceptDC pDataContract) + { + pDataContract.SupportConceptOid = pEntity.Oid.Value; + pDataContract.SupportConceptVersion = pEntity.Version.Value; + pDataContract.Customer = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(pEntity.Customer); + pDataContract.ActivationType = pEntity.IsActive; + pDataContract.ConferenceDate = pEntity.ConferenceDate; - public override CompactSupportConceptDC MergeWithDC(SupportConcept pEntity, CompactSupportConceptDC pDataContract) - { - pDataContract.SupportConceptOid = pEntity.Oid.Value; - pDataContract.SupportConceptVersion = pEntity.Version.Value; - pDataContract.Customer = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(pEntity.Customer); - pDataContract.ActivationType = pEntity.IsActive; - pDataContract.ConferenceDate = pEntity.ConferenceDate; + foreach (var iCBRel in pEntity.CostBearer2SupportConceptList) + { + CompactCostBearerDC costBearer = new CompactCostBearerDC(); - foreach (var iCBRel in pEntity.CostBearer2SupportConceptList) - { - CompactCostBearerDC costBearer = new CompactCostBearerDC(); + if (iCBRel.CostBearer.Organisation != null) + { + CompactOrganisationDC orgDC = new CompactOrganisationDC(); + orgDC.Name = iCBRel.CostBearer.Organisation.Name; + orgDC.OrganisationOid = iCBRel.CostBearer.Organisation.Oid.Value; - if (iCBRel.CostBearer.Organisation != null) - { - CompactOrganisationDC orgDC = new CompactOrganisationDC(); - orgDC.Name = iCBRel.CostBearer.Organisation.Name; - orgDC.OrganisationOid = iCBRel.CostBearer.Organisation.Oid.Value; + if (iCBRel.CostBearer.Organisation.Address != null) + { + orgDC.Street = iCBRel.CostBearer.Organisation.Address.Street; + orgDC.PostalCode = iCBRel.CostBearer.Organisation.Address.PostalCode; + orgDC.Town = iCBRel.CostBearer.Organisation.Address.Town; + } - if (iCBRel.CostBearer.Organisation.Address != null) - { - orgDC.Street = iCBRel.CostBearer.Organisation.Address.Street; - orgDC.PostalCode = iCBRel.CostBearer.Organisation.Address.PostalCode; - orgDC.Town = iCBRel.CostBearer.Organisation.Address.Town; - } + costBearer.Organisation = orgDC; + } + costBearer.CostBearerID = iCBRel.CostBearer.ID; + costBearer.CostBearerOid = iCBRel.CostBearer.Oid.Value; + costBearer.CostBearer2SupportConceptOid = iCBRel.Oid.Value; + costBearer.SupportConceptStatus = iCBRel.Status; + costBearer.RequestedStartDate = iCBRel.RequestedStartDate; + costBearer.RequestedEndDate = iCBRel.RequestedEndDate; + costBearer.ApprovedStartDate = iCBRel.ApprovedStartDate; + costBearer.ApprovedEndDate = iCBRel.ApprovedEndDate; - costBearer.Organisation = orgDC; - } - costBearer.CostBearerID = iCBRel.CostBearer.ID; - costBearer.CostBearerOid = iCBRel.CostBearer.Oid.Value; - costBearer.CostBearer2SupportConceptOid = iCBRel.Oid.Value; - costBearer.SupportConceptStatus = iCBRel.Status; - costBearer.RequestedStartDate = iCBRel.RequestedStartDate; - costBearer.RequestedEndDate = iCBRel.RequestedEndDate; - costBearer.ApprovedStartDate = iCBRel.ApprovedStartDate; - costBearer.ApprovedEndDate = iCBRel.ApprovedEndDate; + // costBearer.ApprovedFLS = iCBRel.ApprovedFLS; + // costBearer.ApprovedFLSTotal = iCBRel.ApprovedFLSTotal; + costBearer.CustomerReferenceNumber = iCBRel.CustomerReferenceNumber; + costBearer.IsCalculatingWithFactor = iCBRel.CostBearer.IsCalculatingWithFactor; -// costBearer.ApprovedFLS = iCBRel.ApprovedFLS; - // costBearer.ApprovedFLSTotal = iCBRel.ApprovedFLSTotal; - costBearer.CustomerReferenceNumber = iCBRel.CustomerReferenceNumber; - costBearer.IsCalculatingWithFactor = iCBRel.CostBearer.IsCalculatingWithFactor; + pDataContract.IsApproved = iCBRel.ApprovedStartDate.HasValue; + pDataContract.CostBearerList.Add(costBearer); + pDataContract.CostBearerOids2CostBearerRelOids.Add(costBearer.Oid.Value, iCBRel.Oid.Value); + pDataContract.CustomerReferenceNumbers.Add(iCBRel.CustomerReferenceNumber); + pDataContract.CostBearerRelOids.Add(iCBRel.Oid.Value); + } - pDataContract.IsApproved = iCBRel.ApprovedStartDate.HasValue; - pDataContract.CostBearerList.Add(costBearer); - pDataContract.CostBearerOids2CostBearerRelOids.Add(costBearer.Oid.Value, iCBRel.Oid.Value); - pDataContract.CustomerReferenceNumbers.Add(iCBRel.CustomerReferenceNumber); - pDataContract.CostBearerRelOids.Add(iCBRel.Oid.Value); - } + return pDataContract; + } - return pDataContract; - } + public override SupportConcept MergeWithEntity(CompactSupportConceptDC pDataContract, SupportConcept pEntity) + { + throw new NotImplementedException(); + } - public override SupportConcept MergeWithEntity(CompactSupportConceptDC pDataContract, SupportConcept pEntity) - { - throw new NotImplementedException(); - } - #endregion + protected override bool AreDCAndEntityEqual(CompactSupportConceptDC pDC, SupportConcept pEntity) + { + return pDC.SupportConceptOid == pEntity.Oid; + } - #region Methods + public override Dictionary ToJsonDictionary(CompactSupportConceptDC pDC) + { + var customer = MapperFactory.CompactCustomerDC_Customer.ToJsonDictionary(pDC.Customer); - protected override bool AreDCAndEntityEqual(CompactSupportConceptDC pDC, SupportConcept pEntity) - { - return pDC.SupportConceptOid == pEntity.Oid; - } + var jsonObject = new Dictionary() + { + {"Address", pDC.AddressString }, + {"AllCostBearerNames", pDC.AllCostBearerNames}, + {"CostBearer", pDC.CostBearer }, + {"CostBearerDetailStrings", pDC.CostBearerDetailStrings }, + {"Customer", customer }, + {"StartDate", pDC.StartDate }, + {"EndDate", pDC.EndDate } + }; - #endregion - } + return jsonObject; + } + } } \ No newline at end of file diff --git a/Service/ServiceUtils/AiSystemBuilder.cs b/Service/ServiceUtils/AiSystemBuilder.cs index 55df17989..1de8033a2 100644 --- a/Service/ServiceUtils/AiSystemBuilder.cs +++ b/Service/ServiceUtils/AiSystemBuilder.cs @@ -67,11 +67,11 @@ namespace BeWo.Service.ServiceUtils { switch (uicontext) { - case 0: break; + case 0: return createSupportConceptNavigationContext(bewoobjects); case 1: return createCustomerNavigationContext(bewoobjects); case 2: return createPersonNavigationContext(bewoobjects); case 3: return createEmployeeNavigationContext(bewoobjects); - case 4: break; + case 4: return createOrganisationNavigationContext(bewoobjects); case 5: break; case 6: break; case 7: break; @@ -92,6 +92,19 @@ namespace BeWo.Service.ServiceUtils throw new NotImplementedException("UI Context unknown"); } + private static Dictionary createSupportConceptNavigationContext(Dictionary bewoobjects) + { + var supports = LoadEntities(bewoobjects, TableID.SupportConcept, MapperFactory.CompactSupportConceptDC_SupportConcept); + + var dict = new Dictionary + { + { "Aktuelle Ansicht", "Hilfeplan Navigation" }, + { "Aktueller Ansichtsfilter", "Funktion noch nicht verfügbar" }, + { "Hilfeplanliste", (object)supports ?? "keine Hilfepläne sichtbar" } + }; + + return dict; + } private static Dictionary createCustomerNavigationContext(Dictionary bewoobjects) { var klienten = LoadEntities(bewoobjects, TableID.Customer, MapperFactory.CompactCustomerDC_Customer); @@ -131,6 +144,30 @@ namespace BeWo.Service.ServiceUtils return dict; } + private static Dictionary createOrganisationNavigationContext(Dictionary bewoobjects) + { + Action loadAddress = (entity, dc) => + { + if (entity.Address != null) + { + dc.AddressLine1 = entity.Address.AddressLine1; + dc.Street = entity.Address.Street; + dc.PostalCode = entity.Address.PostalCode; + dc.Town = entity.Address.Town; + } + }; + + var orgas = LoadEntities(bewoobjects, TableID.Organisation, MapperFactory.CompactOrganisationDC_Organisation, loadAddress); + + var dict = new Dictionary + { + { "Aktuelle Ansicht", "Organisation Navigation" }, + { "Aktueller Ansichtsfilter", "Funktion noch nicht verfügbar" }, + { "Organisationsliste", (object)orgas ?? "keine Organisationen sichtbar" } + }; + + return dict; + } private static Dictionary createServiceRecordContext(Dictionary bewoobjects) { var customer = LoadEntity(bewoobjects, TableID.Customer, MapperFactory.CompactCustomerDC_Customer); @@ -191,7 +228,31 @@ namespace BeWo.Service.ServiceUtils return null; var entities = DAOFactory.GenericDAO.GetByIDs(oids); - var dict = mapper.ToJsonDictionary(entities); + var dcs = mapper.MapToNewDCs(entities); + var dict = mapper.ToJsonDictionary(dcs); + + return dict; + } + + private static IList> LoadEntities + (Dictionary bewoobjects, TableID tid, IDCEntityMapper mapper, Action afterDC) + where TDC : new() where TEntity : BeWoEntityBase, new() + { + if (!bewoobjects.TryGetValue(tid, out long[] oids) || (oids?.Length ?? 0) == 0) + return null; + + var entities = DAOFactory.GenericDAO.GetByIDs(oids); + var dcs = new List(); + foreach (var entity in entities) + { + var dc = mapper.MapToNewDC(entity); + + afterDC(entity, dc); + + dcs.Add(dc); + } + + var dict = mapper.ToJsonDictionary(dcs); return dict; } From 26401d542a957fdf20345d25e58f357367f7c509 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 14:27:12 +0200 Subject: [PATCH 05/50] Organsations missing --- .../DCEntityMapper/CompactOrganisationDC_Organisation.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs b/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs index 725fcdaaa..0b4457b93 100644 --- a/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs +++ b/Service/DCEntityMapper/CompactOrganisationDC_Organisation.cs @@ -68,7 +68,14 @@ namespace BeWo.Service.DCEntityMapper { var jsonObject = new Dictionary() { - {"BusinessPartnerId", pDC.BusinessPartnerId }, + {"Name", pDC.Name }, + {"Abteilung", pDC.Name2 }, + {"Kundennummer", pDC.DebitorNumber }, + {"Geschäftspartnernummer", pDC.BusinessPartnerId }, + {"Adress", pDC.AddressString }, + {"IKDatenannahmestelle", pDC.IKDatenannahmestelle }, + {"IKKostentrager", pDC.IKKostentrager }, + {"IKKrankenkasse", pDC.IKKrankenkasse}, }; return jsonObject; From dc6195e74d67356a488cd0e42d41626653c96b36 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 16:27:30 +0200 Subject: [PATCH 06/50] Missing titles --- BeWo/Services/BeWoWindowFactory.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BeWo/Services/BeWoWindowFactory.cs b/BeWo/Services/BeWoWindowFactory.cs index 2db9bcc72..c31caebe3 100644 --- a/BeWo/Services/BeWoWindowFactory.cs +++ b/BeWo/Services/BeWoWindowFactory.cs @@ -19,13 +19,13 @@ namespace BeWo.Services {UIContext.Customer, "Klienten Übersicht KI Chat" }, {UIContext.Person, "Personen Übersicht KI Chat" }, {UIContext.Employee, "Mitarbeiter Übersicht KI Chat" }, + {UIContext.Organisation, "Organisation Übersicht KI Chat" }, + {UIContext.SupportConcept, "Hilfeplan Übersicht KI Chat" }, }; public AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200) { - string title = null; - - UIContext2Header.TryGetValue(uIContext, out title); + UIContext2Header.TryGetValue(uIContext, out string title); if (string.IsNullOrEmpty(title)) title = "default"; From b3ee2488067deb0c507b8f0e6952147ced8d5c93 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 15 Apr 2025 16:28:17 +0200 Subject: [PATCH 07/50] CustomerView Buttons --- BeWo/View/Detail/CustomerView.xaml | 37 +++++++++++++-- BeWo/View/Detail/CustomerView.xaml.cs | 46 +++++++++++++++++-- .../DCEntityMapper/AbstractIDCEntityMapper.cs | 3 +- Service/DCEntityMapper/CustomerDC_Customer.cs | 5 ++ Service/DCEntityMapper/IDCEntityMapper.cs | 5 -- Service/Interfaces/IJsonMapper.cs | 18 ++++++++ Service/Service.csproj | 3 +- .../AiEnhancedServiceImp.cs | 3 +- .../AiPromptFactory.cs} | 44 ++++++++++++++---- 9 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 Service/Interfaces/IJsonMapper.cs rename Service/{ServiceUtils/AiSystemBuilder.cs => ai/AiPromptFactory.cs} (86%) diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml index 6c398385c..120927a2c 100644 --- a/BeWo/View/Detail/CustomerView.xaml +++ b/BeWo/View/Detail/CustomerView.xaml @@ -804,6 +804,7 @@ + @@ -3786,10 +3787,10 @@ Selector.Selected="tabitem_log_Selected" /> @@ -3798,12 +3799,40 @@ + + + + + + + + + - - - - - - - - - - - - - - -