diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 9945947dc..430d603bc 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -104,6 +104,7 @@
+
AiConfigView.xaml
@@ -3519,6 +3520,7 @@
+
diff --git a/BeWo/Core/BeWoWpfUtils.cs b/BeWo/Core/BeWoWpfUtils.cs
index b78f48448..182ffb075 100644
--- a/BeWo/Core/BeWoWpfUtils.cs
+++ b/BeWo/Core/BeWoWpfUtils.cs
@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
+using System.Windows.Threading;
using BeWo.View;
using DevExpress.Xpf.Grid;
@@ -294,24 +295,30 @@ namespace BeWo.Core
return null;
}
- public static void ScrollToTop(ListBox listBox)
+ public static void ScrollToTop(ListBox listBox, DispatcherPriority priority = DispatcherPriority.Loaded)
{
- if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
- {
- Border border = (Border)VisualTreeHelper.GetChild(listBox, 0);
- ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
- scrollViewer.ScrollToTop();
- }
+ listBox.Dispatcher.InvokeAsync(() =>
+ {
+ if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
+ {
+ Border border = (Border)VisualTreeHelper.GetChild(listBox, 0);
+ ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
+ scrollViewer.ScrollToTop();
+ }
+ }, priority);
}
- public static void ScrollToBottom(ListBox listBox)
+ public static void ScrollToBottom(ListBox listBox, DispatcherPriority priority = DispatcherPriority.Loaded)
{
- if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
+ listBox.Dispatcher.InvokeAsync(() =>
{
- Border border = (Border)VisualTreeHelper.GetChild(listBox, 0);
- ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
- scrollViewer.ScrollToBottom();
- }
+ if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
+ {
+ Border border = (Border)VisualTreeHelper.GetChild(listBox, 0);
+ ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
+ scrollViewer.ScrollToBottom();
+ }
+ }, priority);
}
}
}
\ No newline at end of file
diff --git a/BeWo/DebugConfig.cs b/BeWo/DebugConfig.cs
index ad6d26b7f..badf2fb8b 100644
--- a/BeWo/DebugConfig.cs
+++ b/BeWo/DebugConfig.cs
@@ -147,9 +147,9 @@ namespace BeWo
AutoLogin = true,
//SelectView = UIContext.AiConversation,
//SelectIndex = 8,
- //DefaultLoginUsername = "m1",
- //DefaultLoginPassword = "bewobewo",
- //DefaultProfilename = "5000000000",
+ DefaultLoginUsername = "m1",
+ DefaultLoginPassword = "bewobewo",
+ DefaultProfilename = "5000000000",
EnableAutoRemoteDebugging = true
});
diff --git a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml
index dfc1e024a..453810e76 100644
--- a/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml
+++ b/BeWo/SchulbegleitenderDienst/SchulbegleitenderDienstEmployeeView.xaml
@@ -1,127 +1,236 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/BeWo/SchulbegleitenderDienst/View/AbsenceTimeEditView.xaml b/BeWo/SchulbegleitenderDienst/View/AbsenceTimeEditView.xaml
index ce581b3c9..1ae7d36ce 100644
--- a/BeWo/SchulbegleitenderDienst/View/AbsenceTimeEditView.xaml
+++ b/BeWo/SchulbegleitenderDienst/View/AbsenceTimeEditView.xaml
@@ -1,14 +1,16 @@
-
+
@@ -18,36 +20,116 @@
-
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
- Ganztägig
+
+ Ganztägig
+
-
+
-
+
-
-
-
+
+
+
diff --git a/BeWo/Services/BeWoControlFactory.cs b/BeWo/Services/BeWoControlFactory.cs
index e368896a9..51e4f1807 100644
--- a/BeWo/Services/BeWoControlFactory.cs
+++ b/BeWo/Services/BeWoControlFactory.cs
@@ -1,4 +1,6 @@
using BeWo.View.Detail.AI;
+using BeWo.ViewModel;
+using BeWo.ViewModel.View;
using BS.Shared;
using System;
using System.Collections.Generic;
@@ -12,14 +14,11 @@ namespace BeWo.Services
{
internal class BeWoControlFactory : IControlFactory
{
- public Control GetAiConversationControl(UIContext uIContext, Dictionary context, long? reference_oid = null)
+ public Control GetAiConversationControl(AiConversationChatViewModel vm)
{
- var styleString = getStyleString(uIContext);
- var control = styleString is object ? new AiConversationChatView(styleString) : new AiConversationChatView();
+ var styleString = getStyleString(vm.UIContext);
- control.ViewModel.UIContext = (int)uIContext;
- control.ViewModel.ReferenceObjectOid = reference_oid;
- control.ViewModel.ContextBeWoObjects = context;
+ var control = styleString is object ? new AiConversationChatView(vm, styleString) : new AiConversationChatView(vm);
return control;
}
diff --git a/BeWo/Services/BeWoWindowFactory.cs b/BeWo/Services/BeWoWindowFactory.cs
index 4ae304a18..9c5be9ccd 100644
--- a/BeWo/Services/BeWoWindowFactory.cs
+++ b/BeWo/Services/BeWoWindowFactory.cs
@@ -1,6 +1,8 @@
using BeWo.View.Detail.AI;
using BeWo.View.Windows;
+using BeWo.ViewModel.View;
using BS.Shared;
+using DevExpress.Mvvm.Native;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -24,9 +26,9 @@ namespace BeWo.Services
{UIContext.CustomerSingle, "KI Chat: Klient" },
};
- public AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200)
+ public AnimatedBeWoWindow GetAiConversationWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200)
{
- UIContext2Header.TryGetValue(uIContext, out string title);
+ UIContext2Header.TryGetValue(viewModel.UIContext, out string title);
if (string.IsNullOrEmpty(title))
title = "default";
@@ -52,9 +54,9 @@ namespace BeWo.Services
return beWoWindow;
}
- public Control GetAiModalViewWindow(UIContext uIContext, Control control, double height = 600, double width = 1200)
+ public Control GetAiModalViewWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200)
{
- UIContext2Header.TryGetValue(uIContext, out string title);
+ UIContext2Header.TryGetValue(viewModel.UIContext, out string title);
if (string.IsNullOrEmpty(title))
title = "default";
diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs
index ecf66a07a..fa8a1bb5c 100644
--- a/BeWo/Services/BeWoWindowService.cs
+++ b/BeWo/Services/BeWoWindowService.cs
@@ -1,5 +1,8 @@
using BeWo.View.Windows;
+using BeWo.ViewModel;
+using BeWo.ViewModel.View;
using BS.Shared;
+using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -22,26 +25,24 @@ namespace BeWo.Services
_controlFactory = controlFactory;
}
- public void ShowAiConversationWindow(UIContext uIContext, Dictionary bewoObjects, long? reference_oid = null)
+ public void ShowAiConversationWindow(AiConversationChatViewModel viewModel)
{
#if !DEBUG
BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase.");
return;
#endif
-
ShowWindowDialog(
- cf => cf.GetAiConversationControl(uIContext, bewoObjects, reference_oid),
- (wf, ctrl) => wf.GetAiConversationWindow(uIContext, ctrl));
+ cf => cf.GetAiConversationControl(viewModel),
+ (wf, ctrl) => wf.GetAiConversationWindow(viewModel, ctrl));
}
- public void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary bewoObjects, long? reference_oid = null)
+ public void ShowAiConversationModalViewWindow(AiConversationChatViewModel viewModel)
{
#if !DEBUG
BeWoApp.ShowInfoMessage("Diese Funktion befindet sich in der Testphase.");
return;
#endif
-
- ShowModalViewWindow(cf => cf.GetAiConversationControl(uIContext, bewoObjects, reference_oid),
- (wf, ctrl) => wf.GetAiModalViewWindow(uIContext, ctrl));
+ ShowModalViewWindow(cf => cf.GetAiConversationControl(viewModel),
+ (wf, ctrl) => wf.GetAiModalViewWindow(viewModel, ctrl));
}
private void ShowWindow(Func getControl, Func getWindow)
diff --git a/BeWo/Services/IControlFactory.cs b/BeWo/Services/IControlFactory.cs
index e1202ebf9..b975c88ae 100644
--- a/BeWo/Services/IControlFactory.cs
+++ b/BeWo/Services/IControlFactory.cs
@@ -1,4 +1,6 @@
-using BS.Shared;
+using BeWo.ViewModel;
+using BeWo.ViewModel.View;
+using BS.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +13,6 @@ namespace BeWo.Services
{
internal interface IControlFactory
{
- Control GetAiConversationControl(UIContext uIContext, Dictionary context, long? reference_oid = null);
+ Control GetAiConversationControl(AiConversationChatViewModel vm);
}
}
diff --git a/BeWo/Services/IWindowFactory.cs b/BeWo/Services/IWindowFactory.cs
index ad99ef312..d80d3c53c 100644
--- a/BeWo/Services/IWindowFactory.cs
+++ b/BeWo/Services/IWindowFactory.cs
@@ -1,4 +1,5 @@
using BeWo.View.Windows;
+using BeWo.ViewModel.View;
using BS.Shared;
using System;
using System.Collections.Generic;
@@ -12,7 +13,7 @@ namespace BeWo.Services
{
internal interface IWindowFactory
{
- AnimatedBeWoWindow GetAiConversationWindow(UIContext uIContext, Control control, double height = 600, double width = 1200);
- Control GetAiModalViewWindow(UIContext uIContext, Control control, double height = 600, double width = 1200);
+ AnimatedBeWoWindow GetAiConversationWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200);
+ Control GetAiModalViewWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200);
}
}
diff --git a/BeWo/Services/IWindowService.cs b/BeWo/Services/IWindowService.cs
index 4cc7c3ef9..1444e7c63 100644
--- a/BeWo/Services/IWindowService.cs
+++ b/BeWo/Services/IWindowService.cs
@@ -1,4 +1,5 @@
-using BS.Shared;
+using BeWo.ViewModel.View;
+using BS.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,7 +12,7 @@ namespace BeWo.Services
{
internal interface IWindowService
{
- void ShowAiConversationWindow(UIContext uIContext, Dictionary bewoObjects, long? reference_oid = null);
- void ShowAiConversationModalViewWindow(UIContext uIContext, Dictionary bewoObjects, long? reference_oid = null);
+ void ShowAiConversationWindow(AiConversationChatViewModel viewModel);
+ void ShowAiConversationModalViewWindow(AiConversationChatViewModel viewModel);
}
}
diff --git a/BeWo/View/BeWoFileView.xaml b/BeWo/View/BeWoFileView.xaml
index e11e8ec68..1ed7e63bd 100644
--- a/BeWo/View/BeWoFileView.xaml
+++ b/BeWo/View/BeWoFileView.xaml
@@ -1,55 +1,83 @@
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
@@ -65,72 +93,176 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Controls/NewsItemEditControl.xaml b/BeWo/View/Controls/NewsItemEditControl.xaml
index 8b171d3e3..debce2079 100644
--- a/BeWo/View/Controls/NewsItemEditControl.xaml
+++ b/BeWo/View/Controls/NewsItemEditControl.xaml
@@ -1,51 +1,93 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/AI/AiConversationChatView.xaml b/BeWo/View/Detail/AI/AiConversationChatView.xaml
index 5bf69aca8..14c1aef86 100644
--- a/BeWo/View/Detail/AI/AiConversationChatView.xaml
+++ b/BeWo/View/Detail/AI/AiConversationChatView.xaml
@@ -17,10 +17,13 @@
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
+ xmlns:vmv="clr-namespace:BeWo.ViewModel.View"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
+ d:DataContext="{d:DesignInstance Type=vmv:AiConversationChatViewModel,
+ IsDesignTimeCreatable=True}"
d:DesignHeight="900"
d:DesignWidth="900"
Focusable="True"
@@ -34,9 +37,6 @@
-
-
-
@@ -119,10 +119,10 @@
Background="Transparent"
BorderThickness="0"
ItemTemplate="{StaticResource ConversationTemplate}"
- ItemsSource="{Binding VMList}"
+ ItemsSource="{Binding ListVM.VMList}"
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- SelectedItem="{Binding SelectedVM, Mode=TwoWay}"
+ SelectedItem="{Binding ListVM.SelectedVM, Mode=TwoWay}"
SelectionChanged="listbox_conversations_SelectionChanged">
-->
-
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml b/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml
index 15f202bba..b23c9be2b 100644
--- a/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml
+++ b/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml
@@ -1,134 +1,294 @@
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Accounting/ServiceInvoiceCreatePopUpView.xaml b/BeWo/View/Detail/Accounting/ServiceInvoiceCreatePopUpView.xaml
index 22c2af212..a9cfe3578 100644
--- a/BeWo/View/Detail/Accounting/ServiceInvoiceCreatePopUpView.xaml
+++ b/BeWo/View/Detail/Accounting/ServiceInvoiceCreatePopUpView.xaml
@@ -1,26 +1,47 @@
-
+
-
-
-
+
+
+
-
+
@@ -38,41 +59,84 @@
Klicken Sie anschließend auf "Erstellen".
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/Accounting/ServiceInvoiceItemEditView.xaml b/BeWo/View/Detail/Accounting/ServiceInvoiceItemEditView.xaml
index ac45a6ae4..9e920e751 100644
--- a/BeWo/View/Detail/Accounting/ServiceInvoiceItemEditView.xaml
+++ b/BeWo/View/Detail/Accounting/ServiceInvoiceItemEditView.xaml
@@ -1,21 +1,39 @@
-
-
+
+
-
-
-
+
+
+
@@ -24,9 +42,12 @@
-
+
-
+
@@ -37,7 +58,11 @@
-
+
@@ -57,36 +82,102 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -98,41 +189,104 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -147,53 +301,101 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
@@ -238,86 +457,119 @@
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -329,23 +581,30 @@
-
+
-
+
-
+
-
+
-
+
@@ -373,8 +632,8 @@
-
-
+
+
-->
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -517,13 +821,11 @@
-
+
-
+
-
+
@@ -242,86 +475,123 @@
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -333,11 +603,26 @@
-
-
-
+
+
+
diff --git a/BeWo/View/Detail/Accounting/SettlementInvoiceView.xaml b/BeWo/View/Detail/Accounting/SettlementInvoiceView.xaml
index 209e62bb9..ac7949e53 100644
--- a/BeWo/View/Detail/Accounting/SettlementInvoiceView.xaml
+++ b/BeWo/View/Detail/Accounting/SettlementInvoiceView.xaml
@@ -1,120 +1,252 @@
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/AccountingTransactionBookingView2.xaml b/BeWo/View/Detail/AccountingTransactionBookingView2.xaml
index d3f650115..287afd736 100644
--- a/BeWo/View/Detail/AccountingTransactionBookingView2.xaml
+++ b/BeWo/View/Detail/AccountingTransactionBookingView2.xaml
@@ -1,82 +1,148 @@
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+ -->
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/AdditionalServiceView.xaml b/BeWo/View/Detail/AdditionalServiceView.xaml
index 20d1fdc34..a1a6a8dd9 100644
--- a/BeWo/View/Detail/AdditionalServiceView.xaml
+++ b/BeWo/View/Detail/AdditionalServiceView.xaml
@@ -1,49 +1,68 @@
-
+
-
-
-
-
+
+
@@ -188,44 +266,48 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
+
-
+
+
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Detail/AssessmentSheetCategoryView.xaml b/BeWo/View/Detail/AssessmentSheetCategoryView.xaml
index 137b68496..9b4ad85ef 100644
--- a/BeWo/View/Detail/AssessmentSheetCategoryView.xaml
+++ b/BeWo/View/Detail/AssessmentSheetCategoryView.xaml
@@ -1,132 +1,261 @@
-
+
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Hinzufügen
+
+ Hinzufügen
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Übernehmen
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Übernehmen
+
+
-
-
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/AssessmentSheetValueView.xaml b/BeWo/View/Detail/AssessmentSheetValueView.xaml
index 1a91435d1..150a2608e 100644
--- a/BeWo/View/Detail/AssessmentSheetValueView.xaml
+++ b/BeWo/View/Detail/AssessmentSheetValueView.xaml
@@ -1,114 +1,253 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
- Hinzufügen
+
+ Hinzufügen
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/CustomerView.xaml b/BeWo/View/Detail/CustomerView.xaml
index a7797c6ff..e3a9c1d2f 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -2618,7 +2618,10 @@
-
+
diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs
index 7d1b3db06..6b9396a91 100644
--- a/BeWo/View/Detail/CustomerView.xaml.cs
+++ b/BeWo/View/Detail/CustomerView.xaml.cs
@@ -54,6 +54,7 @@ using BeWo.AI;
using BeWo.View.Navigation;
using DevExpress.Mvvm;
using System.Collections;
+using BeWo.ViewModel.View;
namespace BeWo.View.Detail
{
@@ -313,20 +314,24 @@ namespace BeWo.View.Detail
return dict;
}
- private void OpenAiWindow()
- {
- var customer_oid = ViewModel.DataContract.CustomerOid;
+ private AiConversationChatViewModel getAiConversationChatViewModel()
+ {
+ var customer_oid = ViewModel.DataContract.CustomerOid;
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.CustomerSingle, context, customer_oid);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.CustomerSingle, context, customer_oid);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var customer_oid = ViewModel.DataContract.CustomerOid;
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.CustomerSingle, context, customer_oid);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
void Image_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
diff --git a/BeWo/View/Detail/EmployeeView.xaml b/BeWo/View/Detail/EmployeeView.xaml
index 6b6e4e884..d9ed4ce59 100644
--- a/BeWo/View/Detail/EmployeeView.xaml
+++ b/BeWo/View/Detail/EmployeeView.xaml
@@ -210,14 +210,18 @@
-
+
-
+
@@ -1144,16 +1148,111 @@
SelectedValue="{Binding Path=HourlyRateCostRatePeriod, Mode=TwoWay}"
Visibility="{Binding IsHourlyRateComboVisible, Converter={StaticResource BoolVisibilityConverter}}" />
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
@@ -22,39 +34,92 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
-
+
-
+
-
+
-
+
-
+
diff --git a/BeWo/View/Detail/InvoiceView.xaml b/BeWo/View/Detail/InvoiceView.xaml
index 8a475226e..7bdbd6624 100644
--- a/BeWo/View/Detail/InvoiceView.xaml
+++ b/BeWo/View/Detail/InvoiceView.xaml
@@ -1,243 +1,567 @@
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/MassnahmenTreeViewView.xaml b/BeWo/View/Detail/MassnahmenTreeViewView.xaml
index 4acc21489..7b634a0a4 100644
--- a/BeWo/View/Detail/MassnahmenTreeViewView.xaml
+++ b/BeWo/View/Detail/MassnahmenTreeViewView.xaml
@@ -1,48 +1,60 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -77,43 +89,108 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
@@ -124,18 +201,34 @@
-
+
-
-
+
+
diff --git a/BeWo/View/Detail/MedRecordEditView.xaml b/BeWo/View/Detail/MedRecordEditView.xaml
index 6dba224f3..dda8f7660 100644
--- a/BeWo/View/Detail/MedRecordEditView.xaml
+++ b/BeWo/View/Detail/MedRecordEditView.xaml
@@ -1,26 +1,40 @@
-
-
+
+
-
+
-
+
@@ -41,50 +55,139 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
diff --git a/BeWo/View/Detail/MedikamentenverordnungslistenEditView.xaml b/BeWo/View/Detail/MedikamentenverordnungslistenEditView.xaml
index 4c99c4cfa..876357167 100644
--- a/BeWo/View/Detail/MedikamentenverordnungslistenEditView.xaml
+++ b/BeWo/View/Detail/MedikamentenverordnungslistenEditView.xaml
@@ -1,197 +1,451 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bedarfsmedikationsliste
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bedarfsmedikationsliste
+
+
+
+
+
diff --git a/BeWo/View/Detail/NewsItemView.xaml b/BeWo/View/Detail/NewsItemView.xaml
index 3e756d26f..bc83c4960 100644
--- a/BeWo/View/Detail/NewsItemView.xaml
+++ b/BeWo/View/Detail/NewsItemView.xaml
@@ -1,84 +1,190 @@
-
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- Hinzufügen
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/SupportConceptGoalRatingView.xaml b/BeWo/View/Detail/SupportConceptGoalRatingView.xaml
index 785b1d33b..7a99df808 100644
--- a/BeWo/View/Detail/SupportConceptGoalRatingView.xaml
+++ b/BeWo/View/Detail/SupportConceptGoalRatingView.xaml
@@ -2,39 +2,30 @@
x:Class="BeWo.View.Detail.SupportConceptGoalRatingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:localView="clr-namespace:BeWo.View"
- xmlns:view="clr-namespace:BeWo.View.Detail"
- xmlns:core="clr-namespace:BeWo.Core"
- xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
- xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
- xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
+ xmlns:core="clr-namespace:BeWo.Core"
xmlns:core1="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
- xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
+ xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
+ xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
+ xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
+ xmlns:localView="clr-namespace:BeWo.View"
xmlns:localViewModel="clr-namespace:BeWo.ViewModel"
- Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="True">
+ xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:view="clr-namespace:BeWo.View.Detail"
+ Width="Auto"
+ Height="Auto"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ Focusable="True">
-
-
-
-
+
+
+
+
-
-
+
+
@@ -46,22 +37,37 @@
-
-
+
+
-
-
-
-
+
+
+
-
+
-
+
@@ -73,29 +79,56 @@
-
-
-
-
+
+
+
+
-
+
-
+
-
+
@@ -112,25 +145,72 @@
-
+
-
-
-
-
-
+
+
+
+
+
@@ -138,94 +218,119 @@
-
+
-
+
-
+
+ MinHeight="23"
+ MaxHeight="300"
+ HorizontalAlignment="Stretch"
+ EditValueChanged="ListBoxGoals_OnEditValueChanged"
+ SelectedIndex="0"
+ ShowCustomItems="False">
-
+
- Alle auswählen
- Alle abwählen
+
+ Alle auswählen
+
+
+ Alle abwählen
+
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+ ValueDataMember="Rating">
+
-
+
@@ -235,11 +340,10 @@
-
+
-
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/UserGroupView.xaml b/BeWo/View/Detail/UserGroupView.xaml
index ce53c562e..ce133ddd1 100644
--- a/BeWo/View/Detail/UserGroupView.xaml
+++ b/BeWo/View/Detail/UserGroupView.xaml
@@ -1,108 +1,221 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Focusable="True"
+ mc:Ignorable="d">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml
index 25fb91a3e..1a40318a5 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungEditPopup.xaml
@@ -1,16 +1,20 @@
-
+ xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
+ xmlns:local="clr-namespace:BeWo.View.Controls"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
+ x:Name="root_Popup"
+ Height="400"
+ d:DataContext="{d:DesignInstance Type=viewmodel:WohnheimVM}"
+ Closed="root_Popup_Closed"
+ Opened="Popup_Opened"
+ Placement="MousePoint"
+ StaysOpen="True"
+ mc:Ignorable="d">
@@ -18,11 +22,16 @@
-
+
+ x:Name="groupbox_newBelegung"
+ Header="Belegung erstellen"
+ Style="{StaticResource ObjectEditGroupBox}">
@@ -35,12 +44,12 @@
-
-
+
+
-
-
-
+
+
+
@@ -48,66 +57,66 @@
Klient
+ x:Name="customer_selection_control"
+ Grid.Row="0"
+ Grid.Column="2"
+ Grid.ColumnSpan="5"
+ ItemSelected="CustomerSelectionControl_ItemSelected" />
+ x:Name="combobox_Wohneinheit"
+ Grid.Row="1"
+ Grid.Column="2"
+ Grid.ColumnSpan="5"
+ Height="27"
+ ItemsSource="{Binding WohneinheitListVM.VMList}"
+ SelectedItem="{Binding WohneinheitBelegungListVM.CurrentVM.Wohneinheit}" />
+ Grid.Row="3"
+ Grid.Column="2"
+ EditValue="{Binding Path=WohneinheitBelegungListVM.CurrentVM.StartDate, UpdateSourceTrigger=PropertyChanged}"
+ ShowClearButton="False" />
+ Grid.Row="3"
+ Grid.Column="6"
+ EditValue="{Binding Path=WohneinheitBelegungListVM.CurrentVM.EndDate, UpdateSourceTrigger=PropertyChanged}"
+ ShowClearButton="True" />
+ Grid.Row="5"
+ Grid.Column="2"
+ Grid.ColumnSpan="5"
+ Style="{StaticResource TextBoxNoticeLarge}"
+ Text="{Binding Path=WohneinheitBelegungListVM.CurrentVM.Kommentar, UpdateSourceTrigger=PropertyChanged}" />
-
+ HorizontalAlignment="Right"
+ Orientation="Horizontal">
+
Hinzufügen
+ x:Name="btn_cancel"
+ Margin="3"
+ Click="Cancel_Button_Click">
Abbrechen
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml
index 76dc67ae7..abc26e2f7 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitEditPopup.xaml
@@ -5,9 +5,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:BeWo.View.Controls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewmodel="clr-namespace:BeWo.ViewModel.ListViewModel"
- d:DataContext="{d:DesignInstance Type=viewmodel:WohneinheitListVM}"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:viewmodel="clr-namespace:BeWo.ViewModel.ListViewModel"
Width="500"
+ d:DataContext="{d:DesignInstance Type=viewmodel:WohneinheitListVM}"
Closed="Popup_Closed"
Opened="Popup_Opened"
Placement="MousePoint"
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
index d3d1e8b2b..76c67419b 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
@@ -179,55 +179,55 @@
EditValue="{Binding Path=Kaution, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource TextEditCurrencyStyleManage}" />
-
-
-
-
-
-
-
-
-
-
-
+
+ Grid.Row="6"
+ Grid.Column="1"
+ EditValue="{Binding Path=Miete, UpdateSourceTrigger=PropertyChanged}"
+ Style="{StaticResource TextEditCurrencyStyleManage}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
index 54bcfb308..bd9375e0c 100644
--- a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
+++ b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
@@ -1219,7 +1219,7 @@
x:Name="panelGoalTree"
Grid.Row="1"
Grid.Column="1"
- Margin="0" >
+ Margin="0">
GetVisibleRecordVMs()
diff --git a/BeWo/View/EmployeeArbeitszeitView.xaml b/BeWo/View/EmployeeArbeitszeitView.xaml
index 081e5c693..852269735 100644
--- a/BeWo/View/EmployeeArbeitszeitView.xaml
+++ b/BeWo/View/EmployeeArbeitszeitView.xaml
@@ -1,119 +1,145 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -121,22 +147,77 @@
- Gültig von
- Gültig bis
+
+ Gültig von
+
+
+ Gültig bis
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
@@ -153,45 +234,133 @@
-
- Tag
- Uhrzeit von
- Uhrzeit bis
- Bemerkungen
+
+
+ Tag
+
+
+ Uhrzeit von
+
+
+ Uhrzeit bis
+
+
+ Bemerkungen
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
@@ -201,39 +370,81 @@
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/HomeView.xaml b/BeWo/View/HomeView.xaml
index 12e8b7c37..5cb6f7f29 100644
--- a/BeWo/View/HomeView.xaml
+++ b/BeWo/View/HomeView.xaml
@@ -1,642 +1,1168 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Offene Aufgaben
- Erledigte Aufgaben
- Alle Aufgaben
- Termine
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+ Offene Aufgaben
+
+
+ Erledigte Aufgaben
+
+
+ Alle Aufgaben
+
+
+ Termine
+
+
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Master/FinanceView.xaml b/BeWo/View/Master/FinanceView.xaml
index 525ec10c4..471518a8e 100644
--- a/BeWo/View/Master/FinanceView.xaml
+++ b/BeWo/View/Master/FinanceView.xaml
@@ -9,7 +9,7 @@
xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:val="clr-namespace:BeWo.Validation"
- xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
+ xmlns:viewmodel="clr-namespace:BeWo.ViewModel"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
index fb2534669..5b3dfafca 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
@@ -31,6 +31,7 @@ using System;
using BeWo.View.Windows;
using System.Collections;
using System.Windows.Input;
+using BeWo.ViewModel.View;
namespace BeWo.View.Navigation
{
@@ -201,18 +202,23 @@ namespace BeWo.View.Navigation
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Customer, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.Customer, context);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Customer, context);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs)
diff --git a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
index 1d0b623b3..8a935eb7d 100644
--- a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
@@ -14,7 +14,7 @@ using BeWo.View.Detail;
using BeWo.View.Navigation.Sorter;
using BeWo.View.Windows;
using BeWo.ViewModel;
-
+using BeWo.ViewModel.View;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -108,18 +108,23 @@ namespace BeWo.View.Navigation
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Employee, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.Employee, context);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Employee, context);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
private bool MainNavigationView_ArchiveObject(IFilterableDC obj)
diff --git a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
index c53f57b08..751a3b0d6 100644
--- a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
@@ -10,6 +10,7 @@ using BeWo.ServiceProxy;
using BeWo.View.Detail;
using BeWo.View.Navigation.Sorter;
using BeWo.ViewModel;
+using BeWo.ViewModel.View;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -73,18 +74,23 @@ namespace BeWo.View.Navigation
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Organisation, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.Organisation, context);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Organisation, context);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
private void mainNavigationView_CreateNewObject()
diff --git a/BeWo/View/Navigation/PersonNavigationView.xaml.cs b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
index 34fdce350..4ccfbec55 100644
--- a/BeWo/View/Navigation/PersonNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
@@ -19,6 +19,7 @@ using DevExpress.Mvvm;
using BeWo.View.Windows;
using System.Collections;
using System.Windows.Input;
+using BeWo.ViewModel.View;
namespace BeWo.View.Navigation
{
@@ -110,18 +111,23 @@ namespace BeWo.View.Navigation
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Person, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.Person, context);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Person, context);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs)
diff --git a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
index 6c3e0dd18..ca4049112 100644
--- a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
@@ -26,6 +26,7 @@ using BeWo.View.Windows;
using DevExpress.Mvvm;
using System.Collections;
using System.Windows.Input;
+using BeWo.ViewModel.View;
namespace BeWo.View.Navigation
{
@@ -224,18 +225,23 @@ namespace BeWo.View.Navigation
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.SupportConcept, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(UIContext.SupportConcept, context);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void OpenAiPopup()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.SupportConcept, context);
+ MainControl.WindowService.ShowAiConversationModalViewWindow(getAiConversationChatViewModel());
}
private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs)
diff --git a/BeWo/ViewModel/AiConversationVM.cs b/BeWo/ViewModel/AiConversationVM.cs
index 9df9179d9..edf07026b 100644
--- a/BeWo/ViewModel/AiConversationVM.cs
+++ b/BeWo/ViewModel/AiConversationVM.cs
@@ -75,11 +75,11 @@ namespace BeWo.ViewModel
}
}
- [JsonProperty]
public DateTime Created => DataContract.Created;
-
- [JsonProperty]
public AiModelDC Modell => DataContract.Modell;
+ public string Context => DataContract.Context;
+ public Dictionary ContextBeWoObjects => DataContract.ContextBeWoObjects;
+ public UIContext UIContext => (UIContext)DataContract.UIContext;
protected override void InitByDataContract(AiConversationDC pDataContract)
{
diff --git a/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs b/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
index 564e0d5ed..ca2884544 100644
--- a/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
@@ -25,16 +25,6 @@ namespace BeWo.ViewModel.ListViewModel
{
public class AiConversationListVM : AbstractDCListMapperVM
{
- private bool _IsSettingsOpen;
- private bool _IsCloneOpen;
- private bool _IsSending;
-
- private string _MessageInput;
- private string _ContextInput;
-
- private AiModelDC _SelectedModel;
- private AiConfigVM _Config;
-
public AiConversationListVM() : this(null)
{
if (BeWoApp.IsInDesignMode)
@@ -45,390 +35,9 @@ namespace BeWo.ViewModel.ListViewModel
public AiConversationListVM(List pDCs) : base(pDCs)
{
- Models = new ObservableSortCollection();
-
- SendNewMessageCommand = new DelegateCommand(SendNewMessage, () => SelectedVM is object && !string.IsNullOrWhiteSpace(MessageInput) && !IsSending);
- OpenNewConversationCommand = new DelegateCommand(OpenNewConversation, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatAdd));
- StartConversationWithMessageCommand = new DelegateCommand(StartConversationWithMessage, () => !string.IsNullOrWhiteSpace(MessageInput) && !IsSending);
-
- ReloadConfigCommand = new DelegateCommand(ReloadConfig);
- ReloadConversationsCommand = new DelegateCommand(ReloadConversations);
- ReloadModelsCommand = new DelegateCommand(ReloadModels);
-
- OpenSettingCommand = new DelegateCommand(OpenSetting, () => (BeWoApp.AppSettings?.ModuleAiSettingsEnabled ?? true) && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleViewSetting));
- OpenCloneCommand = new DelegateCommand(OpenClone, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatClone) && SelectedVM is object);
- CloneCommand = new DelegateCommand(Clone);
-
- AskDeleteCommand = new DelegateCommand(AskDelete, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatDelete) && SelectedVM is object);
-
- SelectedVMChanged += (s, e) => FirePropertyChanged(nameof(IsNewConversationVisible));
+
}
- public event EventHandler SendNewMessageSuccess;
-
- public DelegateCommand SendNewMessageCommand { get; set; }
- public DelegateCommand OpenNewConversationCommand { get; set; }
- public DelegateCommand StartConversationWithMessageCommand { get; set; }
- public DelegateCommand RequestNewConversationCommand { get; set; }
- public DelegateCommand TestCommand { get; set; }
- public DelegateCommand AskDeleteCommand { get; set; }
- public DelegateCommand ReloadConfigCommand { get; set; }
- public DelegateCommand ReloadConversationsCommand { get; set; }
- public DelegateCommand ReloadModelsCommand { get; set; }
-
- public DelegateCommand OpenSettingCommand { get; set; }
- public DelegateCommand OpenCloneCommand { get; set; }
- public DelegateCommand CloneCommand { get; set; }
-
- public ObservableCollection Models { get; set; }
- public AiModelDC SelectedModel
- {
- get { return _SelectedModel; }
- set
- {
- if (_SelectedModel == value)
- return;
-
- _SelectedModel = value;
- FirePropertyChanged(nameof(SelectedModel));
- }
- }
- public AiConfigVM Config
- {
- get { return _Config; }
- set
- {
- if (Config == value)
- return;
-
- _Config = value;
- FirePropertyChanged(nameof(Config));
- }
- }
-
- public string MessageInput
- {
- get { return _MessageInput; }
- set
- {
- if (MessageInput == value)
- return;
-
- _MessageInput = value;
- FirePropertyChanged(nameof(MessageInput));
- }
- }
- public string ContextInput
- {
- get { return _ContextInput; }
- set
- {
- if (ContextInput == value)
- return;
-
- _ContextInput = value;
- FirePropertyChanged(nameof(ContextInput));
- }
- }
-
- public bool IsSettingsOpen
- {
- get => _IsSettingsOpen;
- set
- {
- _IsSettingsOpen = value;
- FirePropertyChanged(nameof(IsSettingsOpen));
- }
- }
- public bool IsCloneOpen
- {
- get => _IsCloneOpen;
- set
- {
- _IsCloneOpen = value;
- FirePropertyChanged(nameof(IsCloneOpen));
- }
- }
- public bool IsSending
- {
- get => _IsSending;
- set
- {
- _IsSending = value;
- FirePropertyChanged(nameof(IsSending));
- }
- }
- public bool IsNewConversationVisible => SelectedVM is null;
-
- public int UIContext { get; set; }
- public long? ReferenceObjectOid { get; set; }
- public Dictionary ContextBeWoObjects { get; set; }
-
- private void StartConversationWithMessage()
- {
- StartSending();
-
- try
- {
- var message = MessageInput;
-
- var conv = new AiConversationDC();
-
- conv.Created = DateTime.Now;
- conv.Updated = DateTime.Now;
- conv.UIContext = UIContext;
- conv.ContextBeWoObjects = ContextBeWoObjects;
- conv.Messages = new List()
- {
- new AiConversationMessageDC()
- {
- Message = message,
- Role = AiConversationMessageRole.User
- }
- };
-
- var vm = InsertConverstion(conv);
-
- ServiceFacade.DoAiEnhancedServiceAsnyc(
- x => x.CreateAiConversationWithMessage(conv, Config.SelectedModel.Oid.Value, message),
- dc => UpdateConverstion(vm, dc),
- e => EndSending());
- }
- catch(Exception ex)
- {
- EndSending();
- }
- }
- private void OpenNewConversation()
- {
- SelectedVM = null;
- }
- private void SendNewMessage()
- {
- StartSending();
-
- try
- {
- var conv = SelectedVM;
-
- var msg_dc = new AiConversationMessageDC();
-
- msg_dc.Message = MessageInput;
- msg_dc.Role = BS.Shared.AiConversationMessageRole.User;
- msg_dc.Created = DateTime.Now;
-
- var msg_vm = new AiConversationMessageVM(msg_dc);
-
- conv.Messages.VMList.Add(msg_vm);
-
- ServiceFacade.DoAiEnhancedServiceAsnyc(
- x => x.SendNewMessage(conv.DataContract.Oid.Value, MessageInput),
- (messages) =>
- {
- if (messages.Count != 2)
- throw new InvalidOperationException("message count: " + messages.Count);
-
- msg_vm.DataContract = messages[0];
-
- conv.Messages.VMList.Add(new AiConversationMessageVM(messages[1]));
-
- MessageInput = string.Empty;
-
- EndSending();
-
- SendNewMessageSuccess?.Invoke(this, EventArgs.Empty);
- },
- (exception) =>
- {
- conv.Messages.VMList.Remove(msg_vm);
-
- EndSending();
- }
- );
- }
- catch (Exception ex) {
- EndSending();
- }
- }
- private void StartSending()
- {
- if (IsSending)
- throw new InvalidOperationException("Sendet bereits");
-
- IsSending = true;
- }
- private void EndSending()
- {
- if (!IsSending)
- throw new InvalidOperationException("Sendet nicht");
-
- IsSending = false;
- }
- private void Test()
- {
- throw new NotImplementedException();
-
- //var limit = 5;
-
- //var models = ServiceFacade.DoOperationsEnhancedServiceSnyc(x => x.GetAiModels());
- //Models.MakeEqualTo(models);
-
- //VMList.Clear();
-
- //foreach (var vm in Models)
- //{
- // var dc = new AiConversationDC();
-
- // dc.Created = DateTime.Now;
- // dc.Displayname = "Example";
- // dc.Modell = vm.ToString();
-
- // var pvm = new AiConversationVM(dc);
-
- // VMList.Add(pvm);
- //}
-
- //var msg = "Wie alt ist Frau Müller?";
- //var context = "Frau Müller wurde am 1.1.1950 geboren. Aktuelle haben wir folgende Universalzeit: " + DateTime.Now.ToUniversalTime();
-
- //for (var i = 0; i < limit; i++)
- //{
- // foreach (var vm in VMList)
- // {
- // ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(vm.CommitToDataContract(), context, msg), (message) =>
- // {
- // vm.Messages.VMList.Add(new AiConversationMessageVM(message));
- // });
- // }
- //}
- }
-
- private AiConversationVM InsertConverstion(AiConversationDC dc)
- {
- var vm = new AiConversationVM(dc);
- VMList.Insert(0, vm);
- SelectedVM = vm;
-
- return vm;
- }
-
- private void UpdateConverstion(AiConversationVM vm, AiConversationDC dc)
- {
- vm.UpdateByDataContract(dc);
-
- MessageInput = string.Empty;
-
- EndSending();
-
- SendNewMessageSuccess?.Invoke(this, EventArgs.Empty);
- }
-
- private void ReloadConfig()
- {
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiConfig(), (x) =>
- {
- if (Config is null)
- Config = new AiConfigVM(x);
- else
- Config.Update(x);
- });
- }
- public void UpdateConfig()
- {
- if (!Config.IsDirty)
- return;
-
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.UpdateAiConfig(Config.CommitToDataContract()), (x) =>
- {
- Config.Update(x);
- });
- }
-
- private void ReloadModels()
- {
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiModels(), (x) =>
- {
- Models.MakeEqualTo(x);
-
- if (Config.SelectedModel is null && Models.Any())
- Config.SelectedModel = Models.First();
- });
- }
- private void ReloadConversations()
- {
- var ui_context = UIContext;
- var reference = ReferenceObjectOid;
-
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiConversations(ui_context, reference), (x) =>
- {
- x.Reverse();
- var vms = new AiConversationListVM(x);
- VMList.MakeEqualTo(vms.VMList);
- });
- }
-
- private void OpenSetting()
- {
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiModels(), (x) =>
- {
- Models.MakeEqualTo(x);
- IsSettingsOpen = true;
- });
- }
- private void OpenClone()
- {
- foreach (var message in SelectedVM.Messages.VMList)
- {
- message.IsChecked = true;
- }
-
- IsCloneOpen = true;
- }
- private void Clone()
- {
- var conv = SelectedVM;
-
- AiConversationMessageVM last = null;
- foreach (var msg in conv.Messages.VMList)
- {
- if (!msg.IsChecked)
- break;
-
- last = msg;
- }
-
- var conv_oid = conv.DataContract.Oid.Value;
- var msg_oid = last?.DataContract.Oid;
-
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.CloneAiConversation(conv_oid, msg_oid), dc =>
- {
- InsertConverstion(dc);
- CloseClone();
- });
- }
- private void CloseClone()
- {
- IsCloneOpen = false;
- }
-
- public void AskDelete()
- {
- var selected = SelectedVM;
-
- var oid = selected.DataContract.Oid.Value;
-
- var msg = $"Wollen Sie die ausgewählte Konversation ({oid}) löschen?";
-
- if (MessageBox.Show(msg, "Konversation löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning) ==
- MessageBoxResult.Yes)
- {
- ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.DeleteAiConversation(oid), () => {
- VMList.Remove(selected);
- CommandManager.InvalidateRequerySuggested();
- //SelectedVM = VMList.FirstOrDefault();
- });
- }
- }
#region Designer
private void InitDesigner()
{
@@ -489,7 +98,7 @@ namespace BeWo.ViewModel.ListViewModel
InitDummyConversations(10);
- //SelectedVM = conversation_vm;
+ SelectedVM = conversation_vm;
}
private void InitDummyConversations(int count)
{
diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs
index ef34318d1..6d5a6669e 100644
--- a/BeWo/ViewModel/VMFactory.cs
+++ b/BeWo/ViewModel/VMFactory.cs
@@ -6,7 +6,7 @@ using BeWo.Core.Service;
using BeWo.SchulbegleitenderDienst.ViewModel;
using BeWo.ServiceProxy;
using BeWo.ViewModel.ListViewModel;
-
+using BeWo.ViewModel.View;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -17,890 +17,912 @@ using DevExpress.XtraEditors.Filtering.Templates;
namespace BeWo.ViewModel
{
- public static class VMFactory
- {
- public static void CreateAbsenceReasonListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetAllAbsenceReasons(), r => pCallBack(new AbsenceReasonListVM(r)));
- }
-
- public static void CreateAbsenceTimeListVMAsync(IEnumerable pDCs, AbsenceReasonVisibilityType? type, Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetAllAbsenceReasons(), cb => pCallBack(new AbsenceTimeListVM(pDCs, cb.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList())));
- }
-
- public static AbsenceTimeListVM CreateAbsenceTimeListVM(IEnumerable pDCs, AbsenceReasonVisibilityType? type)
- {
- var list = ServiceFacade.DoCustomerServiceSync(s => s.GetAllAbsenceReasons());
-
- return new AbsenceTimeListVM(pDCs, list.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList());
- }
-
- public static void CreateOvertimeListVMAsync(IEnumerable pDCs, Action pCallBack)
- {
- //ServiceFacade.DoValueListServiceAsync(v => v.GetAllValueListEntrysByType(ValueListEntryType.Auszahlungsart), cb => pCallBack(new OvertimeListVM(pDCs)));
- ServiceFacade.DoEmployeeServiceAsync(v => v.GetAllOvertimes(), cb => pCallBack(new OvertimeListVM(pDCs)));
- }
-
- public static void CreateAccountingBookingVMAsnyc(Action pCallBack)
- {
- Cache.GetInstance().GetSupportConceptTree(
- tree => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.AccountingTransactionType, categories => pCallBack(new AccountingBookingVM(tree, categories))));
- }
-
- public static void CreateAccountingTransactionListVMAsnyc(DateTimeSpan pSpan, long? pSupportConceptOid, long? pCostBearerSupportConceptRelOid, Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAccountingTransactions(pSpan, pSupportConceptOid, pCostBearerSupportConceptRelOid), r => pCallBack(new AccountingTransactionListVM(r)));
- }
-
- public static void CreateAssessmentSheetCategoryListVM(Action cb)
- {
- ServiceFacade.DoEmployeeServiceAsync(
- s1 => s1.GetAllAssessmentSheetValues(), v => ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAssessmentSheetCategories(), dcs => cb(new AssessmentSheetCategoryListVM(dcs, v))));
- }
-
- public static void CreateAssessmentSheetValueListVM(Action cb)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAssessmentSheetValues(), dcs => cb(new AssessmentSheetValueListVM(dcs)));
- }
-
- public static void CreateBookingVMAsync(DateTimeSpan pSpan, Action pCallBack)
- {
- ServiceFacade.DoResourceServiceAsync(s => s.GetAllBookings(pSpan.StartDateTime, pSpan.EndDateTime), r => pCallBack(new BookingVM(r)));
- }
-
- public static CustomerEmployeeRelationListVM CreateCustomerEmployeeRelationListVM(List pList)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
- return new CustomerEmployeeRelationListVM(pList, valueList);
- }
-
- public static WohnheimEmployeeRelationListVM CreateWohnheimEmployeeRelationListVM(List pList)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
- return new WohnheimEmployeeRelationListVM(pList, valueList);
- }
-
- public static WohnheimCustomerRelationListVM CreateWohnheimCustomerRelationListVM(List pList)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
- return new WohnheimCustomerRelationListVM(pList, valueList);
- }
-
- public static GoalRatingListVM CreateGoalRatingListVM(List ratingList)
- {
- var typeList = Cache.GetInstance().GetAllRatingTypeList();
- return new GoalRatingListVM(ratingList, typeList);
- }
-
- public static void CreateOrganisationPersonRelationListVMAsync(List pDCs, Action pCallBack)
- {
- pCallBack(new OrganisationPersonRelationListVM(pDCs));
- }
-
- public static CustomerPersonRelationListVM CreateCustomerEnvironmentPersonRelListVM(List pList, ValueListEntryType vtype)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(vtype);
-
- return new CustomerPersonRelationListVM(pList, valueList);
- }
-
- public static void CreateCustomerEnvironmentOrganisationRelListVMAsync(List pList, Action pCallBack)
- {
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.EnvironmentOrganisationType, r => pCallBack(new CustomerOrganisationRelationListVM(pList, r)));
- }
-
- public static CustomerOrganisationRelationListVM CreateCustomerEnvironmentOrganisationRelListVM(List pList)
- {
- var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.EnvironmentOrganisationType);
-
- return new CustomerOrganisationRelationListVM(pList, valueList);
- }
-
- public static MedikamentenverordnungslisteListVM CreateMedikementenverordnungslisteListVM(IEnumerable pList)
- {
- var darreichungsformen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDarreichungsformen());
- var depotrhythmen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDepotRhythmen());
-
- return new MedikamentenverordnungslisteListVM(pList, darreichungsformen, depotrhythmen);
- }
-
- public static BargeldtransaktionsListVM CreateBargeldtransaktionsListVM(IEnumerable pList)
- {
- return new BargeldtransaktionsListVM(pList);
- }
-
- public static void CreateCustomerVMAsync(long pOid, Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.LoadCustomer(pOid), cb => CreateCustomerVMAsync(cb, pCallBack));
- }
-
- public static void CreateCustomerVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetVarFieldDefs(TableID.Customer),
- cb => CreateCustomerVMAsync(
- new CustomerDC
- {
- CustomerVarFields = cb
- },
- pCallBack));
- }
-
- public static void CreateCustomerVMAsync(CustomerDC pCustomerDC, Action pCallBack)
- {
- if (BeWoApp.ICD10Diagnosis == null)
- {
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetCompressedICD10Diagnosis(),
- st =>
- {
- st = Utils.Decompress(st);
- var ds = st.Split(Environment.NewLine).ToDictionary(line => line.Substring(0, line.IndexOf(';')), line => line.Substring(line.IndexOf(';') + 1));
-
- BeWoApp.ICD10Diagnosis = ds;
- InternalCreateCustomerVM(pCustomerDC, pCallBack);
- });
- }
- else
- {
- InternalCreateCustomerVM(pCustomerDC, pCallBack);
- }
- }
-
- public static void CreateEmployeeVMAsync(long pOid, Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(
- s => s.LoadEmployee(pOid),
- r =>
- {
- CreateEmployeeVMAsync(r, pCallBack);
- });
- }
-
- public static void CreateEmployeeVMAsync(EmployeeDC pEmployeeDC, Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(),
- r1 =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.StaffQualificationsType,
- r2 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.StaffActivityFocusType,
- r3 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.ContractType,
- r4 =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
- nat =>
- Cache.GetInstance()
- .GetAllValueListEntrysByTypeAsync(ValueListEntryType.NotizenKategorieEmployee,
- r7 =>
- ServiceFacade.DoEmployeeServiceAsync(
- e =>
- e.GetAllAuszahlungsarten(),
- r6 =>
- ServiceFacade.DoOperationsServiceAsync(
- s =>
- s.GetSbdConfig(),
- config =>
- pCallBack(new EmployeeVM(pEmployeeDC, r1, nat, r2, r3, r6, r4, config.Stundensaetze, r7))))))))));
- }
-
- public static void CreateEmployeeVMAsync(Action pCallBack)
- {
- CreateEmployeeVMAsync(new EmployeeDC(), pCallBack);
- }
-
- public static void CreateWohnheimVMAsync(long pOid, List customers, Action pCallBack)
- {
- ServiceFacade.DoWohnheimServiceAsync(
- s => s.LoadWohnheim(pOid),
- r =>
- {
- CreateWohnheimVMAsync(r, customers, pCallBack);
- });
- }
-
- public static void CreateWohnheimVMAsync(WohnheimDC pWohnheimDC, List customers, Action pCallBack)
- {
- pCallBack(new WohnheimVM(pWohnheimDC, customers));
- }
-
- public static void CreateWohnheimVMAsync(List customers, Action pCallBack)
- {
- CreateWohnheimVMAsync(new WohnheimDC(), customers, pCallBack);
- }
-
- public static void CreateEquityInvoiceBaselListVMAsync(long supportconeptOid, Action callback)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetInvoiceBasesForSupportConcept(InvoiceType.CustomerEquity, supportconeptOid),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new InvoiceBaseListVM(r));
- });
- }
-
- public static void CreateGeneralInvoiceBaselListVMAsync(CompactCustomerDC customer, CompactOrganisationDC organisation, CompactPersonDC person, Action callback)
- {
- if (organisation != null)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForOrganisation(organisation.OrganisationOid),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new InvoiceBaseListVM(r));
- });
- }
- else if (person != null)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForPerson(person.PersonOid),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new InvoiceBaseListVM(r));
- });
- }
- else if (customer != null)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetGeneralInvoiceBasesForCustomer(customer.CustomerOid),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new InvoiceBaseListVM(r));
- });
- }
- }
-
- public static void CreateInvoiceListVMAsync(Action callback)
- {
- ServiceFacade.DoCustomerServiceAsync(
- s1 => s1.GetAllActiveSupportConceptsCompact(),
- r1 =>
- ServiceFacade.DoCustomerServiceAsync(
- s2 => s2.GetAllActiveOrganisationsCompact(), r2 => ServiceFacade.DoOperationsServiceAsync(s3 => s3.GetAllActiveInvoices(), r3 => callback(new InvoiceListVM(r2, r1, r3)))));
- }
-
- public static void CreateInvoiceOverviewListVM(Action callback)
- {
- ServiceFacade.DoAccountingServiceAsync(s => s.GetAllActiveInvoiceBases(), cb => callback(new InvoiceBaseListVM(cb)));
- }
-
- public static void CreateOrganisationVMAsync(long pOid, Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(
- s => s.LoadOrganisation(pOid),
- r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType), r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType,
- r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
- r3 => pCallBack(new OrganisationVM(r1, r2, r4, r3))))));
- }
-
- public static void CreateOrganisationVMAsync(Action pCallBack)
- {
- ServiceFacade.DoValueListServiceAsync(
- s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),
- r1 =>
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetVarFieldDefs(TableID.Organisation),
- r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.OrganisationFunctionType,
- r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.RoleInOrganisationType,
- r3 => pCallBack(new OrganisationVM(
- new OrganisationDC
- {
- VarFields = r2
- }, r1, r4, r3))))));
- }
-
- //public static void CreatePersonOrganisationRelationVMAsync(CompactOrganisationDC pOrganisation, Action pCallBack)
- //{
- // pCallBack(
- // new PersonOrganisationRelationVM(
- // new Organisation2PersonDC
- // {
- // OrganisationOid = pOrganisation.OrganisationOid,
- // OrganisationName = pOrganisation.Name,
- // OrganisationVersion = pOrganisation.OrganisationVersion
- // }));
- //}
-
- public static void CreatePersonVMAsync(Action pCallBack)
- {
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.TitleType,
- r1 =>
- ServiceFacade.DoOperationsServiceAsync(
- s => s.GetVarFieldDefs(TableID.Person),
- r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.FunctionType,
- r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.RoleInOrganisationType,
- r5 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.Nationality,
- r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.Aufenthaltsstatus,
- r6 => pCallBack(
- new PersonVM(
- new PersonDC
- {
- VarFields = r2
- },
- r1,
- r4,
- r5,
- r3,
- r6))))))));
- }
-
- public static void CreatePersonVMAsync(long pOid, Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(
- s => s.LoadPerson(pOid),
- cb =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.TitleType,
- r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.FunctionType,
- r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
- r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
- r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Aufenthaltsstatus,
- r5 => pCallBack(new PersonVM(cb, r1, r3, r4, r2, r5))))))));
- }
-
- public static void CreateResourceListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoResourceServiceAsync(
- s => s.GetAllResources(),
- r1 => ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(ValueListEntryType.ResourceCategory), r2 => pCallBack(new ResourceListVM(r1, r2))));
- }
-
- public static void CreateServiceCategoryListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllServiceCategories(),
- r => pCallBack(new ServiceCategoryListVM(r.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList())));
- }
-
- public static void CreateAdditionalServiceListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalService(),
- r => pCallBack(new AdditionalServiceListVM(r.ToList())));
- }
-
- public static void CreateAuszahlungsartenListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAuszahlungsarten(),
- r => pCallBack(new AuszahlungsartListVM(r.ToList())));
- }
-
- public static void CreateBudgetListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
- r => pCallBack(new BudgetListVM(r.ToList())));
- }
-
- public static void CreatePreisListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllPreise(),
- r => pCallBack(new PreisListVM(r.ToList())));
- }
-
- public static void CreateDienstListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllDienste(null),
- r => pCallBack(new DienstInfoListVM(r.ToList())));
- }
-
- public static void CreateRatingTypeListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllRatingTypes(),
- r => pCallBack(new RatingTypeListVM(r.ToList())));
- }
-
- public static void CreateTextModuleListVMAsync(Action pCallBack, bool pIsInAdministrationView = false, bool pIsInTextModuleEditor = false)
- {
- ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetTextModules(pIsInTextModuleEditor, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen), pIsInAdministrationView), r1 => ServiceFacade.DoOperationsServiceAsync(
- s2 => s2.GetAllServiceCategories(),
- s3 =>
- {
- var x = r1.FirstOrDefault(tm => tm.TextModuleOid == 41);
-
- pCallBack(new TextModuleListVM(r1.OrderBy(o => o.Name), s3));
- }));
- }
-
- public static void CreateMedArtListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetAllMedArten(),
- r => pCallBack(new MedArtListVM(r.ToList())));
- }
-
- public static void CreateServiceDescriptionListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(
- s1 => s1.GetAllServiceDescriptions(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllServiceCategories(),
- r2 => pCallBack(new ServiceDescriptionListVM(r1.Where(sr => sr.ScopeType == ScopeTypeId.Global).ToList(), r2.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList()))));
- }
-
- public static void CreateAdditionalServiceRegionListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetAllAdditionalServiceRegion(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllAdditionalService(), r2 => pCallBack(new AdditionalServiceRegionListVM(r1.ToList(), r2.ToList()))));
- }
-
- public static void CreateServiceRecordVMAsync(long pEmployeeOid, Action pCallBack)
- {
- Cache.GetInstance().GetServiceCategoryDescriptionDict(
- dict =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.SupportConceptGoalCategoryType,
- goalCats =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.SupportConceptIndividualGoalCategoryType,
- iGoalCats =>
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.SupportConceptGoalType,
- goals => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.DocumentType,
- docTypes =>
- ServiceFacade.DoCustomerServiceAsync(
- s => s.GetAllActiveWohnheimeCompact(), cb => ServiceFacade.DoCustomerServiceAsync(s2 => s2.GetAllDarreichungsformen(), abc => pCallBack(new ServiceRecordListVM(dict, goalCats, iGoalCats, goals, cb, docTypes, abc)))))))));
- }
-
- public static void CreateMedRecordVMAsync(long pCustomerOid, Action pCallback)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetMedRecordsForCustomer(pCustomerOid), cb => pCallback(new MedRecordListVM(cb)), true);
- }
-
- public static void CreateSettlementListForCostBearerAndPeriod(long costBearerOid, DateTime periodStart, DateTime periodEnd, Action callback)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetSettlementInvoicesForCostBearerAndPeriod(costBearerOid, periodStart, periodEnd),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new SettlementListVM(r));
- });
- }
-
- public static void CreateSettlementListForSupportConceptVMAsync(long supportconceptOid, Action callback)
- {
- ServiceFacade.DoAccountingServiceAsync(
- s => s.GetSettlementInvoicesForSupportConcept(supportconceptOid),
- r =>
- {
- r.Sort(
- (dc1, dc2) =>
- {
- if (dc2.InvoiceDate == null)
- {
- return -1;
- }
-
- if (dc1.InvoiceDate == null)
- {
- return 1;
- }
-
- return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
- });
- callback(new SettlementListVM(r));
- });
- }
-
- public static void CreateSettlementVMAsync(long pSupportConcept2CostBearerOid, Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GenerateInitialSettlementDC(pSupportConcept2CostBearerOid), r => pCallBack(new SettlementVM(r)));
- }
-
- public static void CreateSupportConceptCostBearerRelVMAsync(List pList, ObservableSortCollection budgets, Action pCallBack)
- {
- pCallBack(new SupportConceptCostBearerRelListVM(pList, budgets));
- }
-
- public static void CreateSupportConceptGoalListVMAsync(ValueListEntryType pType, ValueListEntryType pParentType, Action pCallBack)
- {
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pType, r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pParentType, r2 => pCallBack(new SupportConceptGoalListVM(r1, r2))));
- }
-
- public static void CreateSupportConceptVMAsync(Action pCallback)
- {
- CreateSupportConceptVMAsync(new SupportConceptDC(), pCallback, true);
- }
-
- public static void CreateSupportConceptVMAsync(long pOid, Action pCallback)
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.LoadSupportConcept(pOid),
- r => CreateSupportConceptVMAsync(r, pCallback, false));
- }
-
- public static void CreateSupportConceptVMAsync(SupportConceptDC dc, Action pCallBack, bool initOriginator)
- {
- Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.SupportConceptGoalCategoryType,
- r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
- ValueListEntryType.SupportConceptGoalType,
- r2 => Cache.GetInstance().GetServiceCategoryDescriptionDict(
- dict => ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
- r3 =>
- {
- var vm = new SupportConceptVM(dc, r1, r2, dict, r3);
- if (initOriginator)
- {
- vm.Originator = BeWoApp.LoggedOnUser.Employee;
- }
-
- pCallBack(vm);
- }))));
- }
-
- public static void CreateTeamVMAsync(Action pCallBack)
- {
- pCallBack(new TeamVM(new TeamDC()));
- }
-
- public static void CreateTeamVMAsync(long pTeamOid, Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.LoadTeam(pTeamOid), cb => pCallBack(new TeamVM(cb)));
- }
-
- public static void CreateGroupOfPeopleVMAsync(Action pCallBack)
- {
- pCallBack(new GroupOfPeopleVM(new GroupOfPeopleDC()));
- }
-
- public static void CreateGroupOfPeopleVMAsync(long pGroupOfPeopleOid, Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.LoadGroupOfPeople(pGroupOfPeopleOid), cb => pCallBack(new GroupOfPeopleVM(cb)));
- }
-
- public static void CreateGroupOfPeopleListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllGroups(BeWoApp.LoggedOnEmployee.EmployeeOid), cb => pCallBack(new GroupOfPeopleListVM(cb)));
- }
-
- public static void CreateAdditinoalServiceGroupOfPeopleListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalServiceGroupOfPeople(), cb => pCallBack(new AdditionalServiceGroupOfPeopleListVM(cb)));
- }
-
- public static void CreateUserGroupVMAsync(long pOid, Action pCallBack)
- {
- ServiceFacade.DoUserServiceAsync(s => s.LoadUserGroup(pOid), r => pCallBack(new UserGroupVM(r)), true);
- }
-
- public static void CreateUserGroupVMAsync(Action pCallBack)
- {
- pCallBack(new UserGroupVM(new UserGroupDC()));
- }
-
- public static void CreateUserVMAsync(long pUserOid, Action pCallBack)
- {
- ServiceFacade.DoUserServiceAsync(s => s.LoadUser(pUserOid), r1 => ServiceFacade.DoUserServiceAsync(s => s.GetAllUserGroups(), r2 => pCallBack(new UserVM(r1, r2)), true), true);
- }
-
- public static void CreateUserVMAsync(Action pCallBack)
- {
- ServiceFacade.DoUserServiceAsync(s => s.GetAllUserGroups(), cb => pCallBack(new UserVM(new UserDC(), cb)), true);
- }
-
- public static void CreateValueListVMAsync(ValueListEntryType pType, Action pCallBack)
- {
- ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(pType), r => pCallBack(new ValueListEntryListVM(pType, r)));
- }
-
-
- public static void CreateGoalCategoryVMAsync(Action pCallBack, bool pIsIncludingIndividualGoals = false)
- {
- var typeList = new List { ValueListEntryType.SupportConceptGoalType, ValueListEntryType.SupportConceptGoalCategoryType };
- if (pIsIncludingIndividualGoals)
- {
- typeList.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
- typeList.Add(ValueListEntryType.SupportConceptIndividualGoalType);
- }
-
- ServiceFacade.DoValueListServiceAsync(
- s => s.GetAllValueListEntrysByTypes(typeList),
- cb => pCallBack(new GenericValueListEntryListVM(cb)));
- }
-
- public static void CreateEmploymentTypeListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(), r => pCallBack(new EmploymentTypeListVM(r)));
- }
-
- private static void InternalCreateCustomerVM(CustomerDC pCustomerDC, Action pCallBack)
- {
- var list = new List
- {
- ValueListEntryType.DisabilityType,
- ValueListEntryType.CustomerCareType,
- ValueListEntryType.PlacementObjectiveType,
- ValueListEntryType.TerminationReasonType,
- ValueListEntryType.Nationality,
- ValueListEntryType.Aufenthaltsstatus,
- ValueListEntryType.RoleInFamily,
- ValueListEntryType.NotizenKategorieCustomer,
- ValueListEntryType.Auftragsherkunft,
- ValueListEntryType.Vermittlungsgrundlage
- };
-
- ServiceFacade.DoValueListServiceAsync(
- s => s.GetAllValueListEntrysByTypes(list),
- cb => ServiceFacade.DoEmployeeServiceAsync(s2 => s2.GetAllAssessmentSheetCategories(),
- cb2 => ServiceFacade.DoEmployeeServiceAsync(s3 => s3.GetAllAssessmentSheetValues(),
- cb3 => ServiceFacade.DoCustomerServiceAsync(s4 => s4.GetAllMedArten(),
- cb4 => pCallBack(new CustomerVM(pCustomerDC, cb, cb2, cb3, cb4))))));
- }
-
- public static void CreateAppointmentCategoryListVMAsync(Action pCallBack)
- {
- ServiceFacade.DoCustomerServiceAsync(
- s => s.GetAllAppointmentCategories(), cats => pCallBack(new AppointmentCategoryListVM(cats)));
- }
-
- public static WohnheimbuchungEmployeeRelListVM CreateEmployeeWohnheimbuchungsListVM(IEnumerable pList)
- {
- return new WohnheimbuchungEmployeeRelListVM(pList);
- }
-
- public static Wohnheimbuchung2Costbearer2SupportConceptRelListVM CreateSupportConceptWohnheimbuchungsListVM(IEnumerable pList)
- {
- return new Wohnheimbuchung2Costbearer2SupportConceptRelListVM(pList);
- }
-
- public static void CreateWohnheimbuchungsVMAsync(long? pOid, Action pCallBack)
- {
- Cache.GetInstance().GetServiceCategoryDescriptionDict(
- dict =>
- {
- if (pOid == null)
- {
- pCallBack(new WohnheimbuchungsVM(new WohnheimbuchungDC(), dict));
- }
- else
- {
- ServiceFacade.DoCustomerServiceAsync(s => s.GetWohnheimbuchung(pOid.Value), cb => pCallBack(new WohnheimbuchungsVM(cb, dict)));
- }
- });
- }
-
- public static SupportConceptApprovalPeriodEmployeeRelListVM CreateSupportConceptApprovalPeriodEmployeeRelListVM(IEnumerable pList)
- {
- return new SupportConceptApprovalPeriodEmployeeRelListVM(pList);
- }
-
- public static ArbeitszeitEintragListVM CreateArbeitszeitEintragListVm(IEnumerable pList)
- {
- return new ArbeitszeitEintragListVM(pList);
- }
-
- public static void CreateSbdAdminVMAsync(Action pCallBack)
- {
- ServiceFacade.DoOperationsServiceAsync(s => s.GetSbdConfig(), r =>
- {
- pCallBack(new SbdConfigVM(r));
- });
- }
-
- public static List CreateSupportConceptList()
- {
- List allSupportConcepts = new List();
- List activeSupportConcepts = new List();
-
- allSupportConcepts = ServiceFacade.DoCustomerServiceSync(
- s => s.GetAllSupportConceptsCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
-
- foreach (var sc in allSupportConcepts)
- {
- if (!sc.IsDeleted)
- activeSupportConcepts.Add(sc);
- }
-
- return activeSupportConcepts;
- }
- public static List CreateCustomerList()
- {
- List allCustomers = new List();
- List activeCustomers = new List();
-
- allCustomers = ServiceFacade.DoCustomerServiceSync(
- s => s.GetAllCustomersCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
-
- foreach (var customer in allCustomers)
- {
- if (!customer.IsDeleted)
- activeCustomers.Add(customer);
- }
-
- return activeCustomers;
- }
- public static List CreateOrganisationList()
- {
- List allOrganisations = new List();
-
- allOrganisations = ServiceFacade.DoCustomerServiceSync(s => s.GetAllActiveOrganisationsCompact());
-
- return allOrganisations;
- }
- public static List CreatePeopleList()
- {
- List allPeople = new List();
- List activePeople = new List();
-
- allPeople = ServiceFacade.DoCustomerServiceSync(s => s.GetAllPersonsByTypeCompact(PersonType.Others));
-
- foreach (var person in allPeople)
- {
- if (!person.IsDeleted)
- activePeople.Add(person);
- }
-
- return activePeople;
- }
- public static List CreateEmployeeList()
- {
- List allEmployee = new List();
-
- allEmployee = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllActiveEmployeesCompact());
-
- return allEmployee;
- }
- public static List CreateTeamList()
- {
- List allTeams = new List();
-
- allTeams = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllTeamsCompact());
-
- return allTeams;
-
- }
- public static List CreateUserList()
- {
- List allUsers = new List();
-
- allUsers = ServiceFacade.DoUserServiceSync(s => s.GetAllUsersCompact());
-
- return allUsers;
- }
- public static List CreateUserGroupList()
- {
- List allUserGroups = new List();
-
- allUserGroups = ServiceFacade.DoUserServiceSync(s => s.GetAllUserGroups());
- return allUserGroups;
- }
-
- public static List CreateFolderList(TableID tid, long objectOid)
- {
- List folderList = new List();
- folderList = ServiceFacade.DoOperationsServiceSync(s => s.GetFolderTree(tid, objectOid));
-
- return folderList;
- }
-
- public static void CreateWohneinheitListVMs(List dcs, out WohneinheitListVM einheit_vm_list, out WohneinheitBelegungListVM beleg_vm_list)
- {
- einheit_vm_list = new WohneinheitListVM(dcs);
-
- var beleg_dc_list = new List();
- var beleg_dc2einheit_vm = new Dictionary();
- foreach (var einheit_vm in einheit_vm_list.VMList)
- {
- var einheit_dc = einheit_vm.DataContract;
-
- if (einheit_dc.Belegungen is null)
- continue;
-
- foreach (var beleg_dc in einheit_dc.Belegungen)
- {
- beleg_dc_list.Add(beleg_dc);
- beleg_dc2einheit_vm.Add(beleg_dc, einheit_vm);
- }
- }
-
- beleg_vm_list = new WohneinheitBelegungListVM(beleg_dc_list.OrderBy(x => x.Oid).ToList());
-
- foreach (var beleg_vm in beleg_vm_list.VMList)
- {
- var beleg_dc = beleg_vm.DataContract;
-
- beleg_vm.Wohneinheit = beleg_dc2einheit_vm[beleg_dc];
- }
-
- einheit_vm_list.VMList.Sort(WohneinheitVM.Compare);
- }
- }
+ public static class VMFactory
+ {
+ public static void CreateAbsenceReasonListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetAllAbsenceReasons(), r => pCallBack(new AbsenceReasonListVM(r)));
+ }
+
+ public static void CreateAbsenceTimeListVMAsync(IEnumerable pDCs, AbsenceReasonVisibilityType? type, Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetAllAbsenceReasons(), cb => pCallBack(new AbsenceTimeListVM(pDCs, cb.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList())));
+ }
+
+ public static AbsenceTimeListVM CreateAbsenceTimeListVM(IEnumerable pDCs, AbsenceReasonVisibilityType? type)
+ {
+ var list = ServiceFacade.DoCustomerServiceSync(s => s.GetAllAbsenceReasons());
+
+ return new AbsenceTimeListVM(pDCs, list.Where(a => !a.Sichtbarkeit.HasValue || a.Sichtbarkeit.Value == AbsenceReasonVisibilityType.All || a.Sichtbarkeit.Value == type).ToList());
+ }
+
+ public static void CreateOvertimeListVMAsync(IEnumerable pDCs, Action pCallBack)
+ {
+ //ServiceFacade.DoValueListServiceAsync(v => v.GetAllValueListEntrysByType(ValueListEntryType.Auszahlungsart), cb => pCallBack(new OvertimeListVM(pDCs)));
+ ServiceFacade.DoEmployeeServiceAsync(v => v.GetAllOvertimes(), cb => pCallBack(new OvertimeListVM(pDCs)));
+ }
+
+ public static void CreateAccountingBookingVMAsnyc(Action pCallBack)
+ {
+ Cache.GetInstance().GetSupportConceptTree(
+ tree => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.AccountingTransactionType, categories => pCallBack(new AccountingBookingVM(tree, categories))));
+ }
+
+ public static void CreateAccountingTransactionListVMAsnyc(DateTimeSpan pSpan, long? pSupportConceptOid, long? pCostBearerSupportConceptRelOid, Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAccountingTransactions(pSpan, pSupportConceptOid, pCostBearerSupportConceptRelOid), r => pCallBack(new AccountingTransactionListVM(r)));
+ }
+
+ public static void CreateAssessmentSheetCategoryListVM(Action cb)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(
+ s1 => s1.GetAllAssessmentSheetValues(), v => ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAssessmentSheetCategories(), dcs => cb(new AssessmentSheetCategoryListVM(dcs, v))));
+ }
+
+ public static void CreateAssessmentSheetValueListVM(Action cb)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAssessmentSheetValues(), dcs => cb(new AssessmentSheetValueListVM(dcs)));
+ }
+
+ public static void CreateBookingVMAsync(DateTimeSpan pSpan, Action pCallBack)
+ {
+ ServiceFacade.DoResourceServiceAsync(s => s.GetAllBookings(pSpan.StartDateTime, pSpan.EndDateTime), r => pCallBack(new BookingVM(r)));
+ }
+
+ public static CustomerEmployeeRelationListVM CreateCustomerEmployeeRelationListVM(List pList)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
+ return new CustomerEmployeeRelationListVM(pList, valueList);
+ }
+
+ public static WohnheimEmployeeRelationListVM CreateWohnheimEmployeeRelationListVM(List pList)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
+ return new WohnheimEmployeeRelationListVM(pList, valueList);
+ }
+
+ public static WohnheimCustomerRelationListVM CreateWohnheimCustomerRelationListVM(List pList)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.StaffRoleType);
+ return new WohnheimCustomerRelationListVM(pList, valueList);
+ }
+
+ public static GoalRatingListVM CreateGoalRatingListVM(List ratingList)
+ {
+ var typeList = Cache.GetInstance().GetAllRatingTypeList();
+ return new GoalRatingListVM(ratingList, typeList);
+ }
+
+ public static void CreateOrganisationPersonRelationListVMAsync(List pDCs, Action pCallBack)
+ {
+ pCallBack(new OrganisationPersonRelationListVM(pDCs));
+ }
+
+ public static CustomerPersonRelationListVM CreateCustomerEnvironmentPersonRelListVM(List pList, ValueListEntryType vtype)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(vtype);
+
+ return new CustomerPersonRelationListVM(pList, valueList);
+ }
+
+ public static void CreateCustomerEnvironmentOrganisationRelListVMAsync(List pList, Action pCallBack)
+ {
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.EnvironmentOrganisationType, r => pCallBack(new CustomerOrganisationRelationListVM(pList, r)));
+ }
+
+ public static CustomerOrganisationRelationListVM CreateCustomerEnvironmentOrganisationRelListVM(List pList)
+ {
+ var valueList = Cache.GetInstance().GetAllValueListEntrysByTypeSync(ValueListEntryType.EnvironmentOrganisationType);
+
+ return new CustomerOrganisationRelationListVM(pList, valueList);
+ }
+
+ public static MedikamentenverordnungslisteListVM CreateMedikementenverordnungslisteListVM(IEnumerable pList)
+ {
+ var darreichungsformen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDarreichungsformen());
+ var depotrhythmen = ServiceFacade.DoCustomerServiceSync(s => s.GetAllDepotRhythmen());
+
+ return new MedikamentenverordnungslisteListVM(pList, darreichungsformen, depotrhythmen);
+ }
+
+ public static BargeldtransaktionsListVM CreateBargeldtransaktionsListVM(IEnumerable pList)
+ {
+ return new BargeldtransaktionsListVM(pList);
+ }
+
+ public static void CreateCustomerVMAsync(long pOid, Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.LoadCustomer(pOid), cb => CreateCustomerVMAsync(cb, pCallBack));
+ }
+
+ public static void CreateCustomerVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetVarFieldDefs(TableID.Customer),
+ cb => CreateCustomerVMAsync(
+ new CustomerDC
+ {
+ CustomerVarFields = cb
+ },
+ pCallBack));
+ }
+
+ public static void CreateCustomerVMAsync(CustomerDC pCustomerDC, Action pCallBack)
+ {
+ if (BeWoApp.ICD10Diagnosis == null)
+ {
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetCompressedICD10Diagnosis(),
+ st =>
+ {
+ st = Utils.Decompress(st);
+ var ds = st.Split(Environment.NewLine).ToDictionary(line => line.Substring(0, line.IndexOf(';')), line => line.Substring(line.IndexOf(';') + 1));
+
+ BeWoApp.ICD10Diagnosis = ds;
+ InternalCreateCustomerVM(pCustomerDC, pCallBack);
+ });
+ }
+ else
+ {
+ InternalCreateCustomerVM(pCustomerDC, pCallBack);
+ }
+ }
+
+ public static void CreateEmployeeVMAsync(long pOid, Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(
+ s => s.LoadEmployee(pOid),
+ r =>
+ {
+ CreateEmployeeVMAsync(r, pCallBack);
+ });
+ }
+
+ public static void CreateEmployeeVMAsync(EmployeeDC pEmployeeDC, Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(),
+ r1 =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.StaffQualificationsType,
+ r2 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.StaffActivityFocusType,
+ r3 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.ContractType,
+ r4 =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
+ nat =>
+ Cache.GetInstance()
+ .GetAllValueListEntrysByTypeAsync(ValueListEntryType.NotizenKategorieEmployee,
+ r7 =>
+ ServiceFacade.DoEmployeeServiceAsync(
+ e =>
+ e.GetAllAuszahlungsarten(),
+ r6 =>
+ ServiceFacade.DoOperationsServiceAsync(
+ s =>
+ s.GetSbdConfig(),
+ config =>
+ pCallBack(new EmployeeVM(pEmployeeDC, r1, nat, r2, r3, r6, r4, config.Stundensaetze, r7))))))))));
+ }
+
+ public static void CreateEmployeeVMAsync(Action pCallBack)
+ {
+ CreateEmployeeVMAsync(new EmployeeDC(), pCallBack);
+ }
+
+ public static void CreateWohnheimVMAsync(long pOid, List customers, Action pCallBack)
+ {
+ ServiceFacade.DoWohnheimServiceAsync(
+ s => s.LoadWohnheim(pOid),
+ r =>
+ {
+ CreateWohnheimVMAsync(r, customers, pCallBack);
+ });
+ }
+
+ public static void CreateWohnheimVMAsync(WohnheimDC pWohnheimDC, List customers, Action pCallBack)
+ {
+ pCallBack(new WohnheimVM(pWohnheimDC, customers));
+ }
+
+ public static void CreateWohnheimVMAsync(List customers, Action pCallBack)
+ {
+ CreateWohnheimVMAsync(new WohnheimDC(), customers, pCallBack);
+ }
+
+ public static void CreateEquityInvoiceBaselListVMAsync(long supportconeptOid, Action callback)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetInvoiceBasesForSupportConcept(InvoiceType.CustomerEquity, supportconeptOid),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new InvoiceBaseListVM(r));
+ });
+ }
+
+ public static void CreateGeneralInvoiceBaselListVMAsync(CompactCustomerDC customer, CompactOrganisationDC organisation, CompactPersonDC person, Action callback)
+ {
+ if (organisation != null)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetGeneralInvoiceBasesForOrganisation(organisation.OrganisationOid),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new InvoiceBaseListVM(r));
+ });
+ }
+ else if (person != null)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetGeneralInvoiceBasesForPerson(person.PersonOid),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new InvoiceBaseListVM(r));
+ });
+ }
+ else if (customer != null)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetGeneralInvoiceBasesForCustomer(customer.CustomerOid),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new InvoiceBaseListVM(r));
+ });
+ }
+ }
+
+ public static void CreateInvoiceListVMAsync(Action callback)
+ {
+ ServiceFacade.DoCustomerServiceAsync(
+ s1 => s1.GetAllActiveSupportConceptsCompact(),
+ r1 =>
+ ServiceFacade.DoCustomerServiceAsync(
+ s2 => s2.GetAllActiveOrganisationsCompact(), r2 => ServiceFacade.DoOperationsServiceAsync(s3 => s3.GetAllActiveInvoices(), r3 => callback(new InvoiceListVM(r2, r1, r3)))));
+ }
+
+ public static void CreateInvoiceOverviewListVM(Action callback)
+ {
+ ServiceFacade.DoAccountingServiceAsync(s => s.GetAllActiveInvoiceBases(), cb => callback(new InvoiceBaseListVM(cb)));
+ }
+
+ public static void CreateOrganisationVMAsync(long pOid, Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(
+ s => s.LoadOrganisation(pOid),
+ r1 => ServiceFacade.DoValueListServiceAsync(s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType), r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.OrganisationFunctionType,
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
+ r3 => pCallBack(new OrganisationVM(r1, r2, r4, r3))))));
+ }
+
+ public static void CreateOrganisationVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoValueListServiceAsync(
+ s1 => s1.GetAllValueListEntrysByType(ValueListEntryType.StaffQualificationsType),
+ r1 =>
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetVarFieldDefs(TableID.Organisation),
+ r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.OrganisationFunctionType,
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.RoleInOrganisationType,
+ r3 => pCallBack(new OrganisationVM(
+ new OrganisationDC
+ {
+ VarFields = r2
+ }, r1, r4, r3))))));
+ }
+
+ //public static void CreatePersonOrganisationRelationVMAsync(CompactOrganisationDC pOrganisation, Action pCallBack)
+ //{
+ // pCallBack(
+ // new PersonOrganisationRelationVM(
+ // new Organisation2PersonDC
+ // {
+ // OrganisationOid = pOrganisation.OrganisationOid,
+ // OrganisationName = pOrganisation.Name,
+ // OrganisationVersion = pOrganisation.OrganisationVersion
+ // }));
+ //}
+
+ public static void CreatePersonVMAsync(Action pCallBack)
+ {
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.TitleType,
+ r1 =>
+ ServiceFacade.DoOperationsServiceAsync(
+ s => s.GetVarFieldDefs(TableID.Person),
+ r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.FunctionType,
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.RoleInOrganisationType,
+ r5 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.Nationality,
+ r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.Aufenthaltsstatus,
+ r6 => pCallBack(
+ new PersonVM(
+ new PersonDC
+ {
+ VarFields = r2
+ },
+ r1,
+ r4,
+ r5,
+ r3,
+ r6))))))));
+ }
+
+ public static void CreatePersonVMAsync(long pOid, Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(
+ s => s.LoadPerson(pOid),
+ cb =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.TitleType,
+ r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.FunctionType,
+ r3 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.RoleInOrganisationType,
+ r4 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Nationality,
+ r2 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.Aufenthaltsstatus,
+ r5 => pCallBack(new PersonVM(cb, r1, r3, r4, r2, r5))))))));
+ }
+
+ public static void CreateResourceListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoResourceServiceAsync(
+ s => s.GetAllResources(),
+ r1 => ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(ValueListEntryType.ResourceCategory), r2 => pCallBack(new ResourceListVM(r1, r2))));
+ }
+
+ public static void CreateServiceCategoryListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllServiceCategories(),
+ r => pCallBack(new ServiceCategoryListVM(r.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList())));
+ }
+
+ public static void CreateAdditionalServiceListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalService(),
+ r => pCallBack(new AdditionalServiceListVM(r.ToList())));
+ }
+
+ public static void CreateAuszahlungsartenListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllAuszahlungsarten(),
+ r => pCallBack(new AuszahlungsartListVM(r.ToList())));
+ }
+
+ public static void CreateBudgetListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
+ r => pCallBack(new BudgetListVM(r.ToList())));
+ }
+
+ public static void CreatePreisListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllPreise(),
+ r => pCallBack(new PreisListVM(r.ToList())));
+ }
+
+ public static void CreateDienstListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllDienste(null),
+ r => pCallBack(new DienstInfoListVM(r.ToList())));
+ }
+
+ public static void CreateRatingTypeListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllRatingTypes(),
+ r => pCallBack(new RatingTypeListVM(r.ToList())));
+ }
+
+ public static void CreateTextModuleListVMAsync(Action pCallBack, bool pIsInAdministrationView = false, bool pIsInTextModuleEditor = false)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetTextModules(pIsInTextModuleEditor, BeWoApp.LoggedOnEmployee.EmployeeOid.Value, BeWoApp.LoggedOnUser.HasRight(UserRightType.TextbausteineAlleAnsehen), pIsInAdministrationView), r1 => ServiceFacade.DoOperationsServiceAsync(
+ s2 => s2.GetAllServiceCategories(),
+ s3 =>
+ {
+ var x = r1.FirstOrDefault(tm => tm.TextModuleOid == 41);
+
+ pCallBack(new TextModuleListVM(r1.OrderBy(o => o.Name), s3));
+ }));
+ }
+
+ public static void CreateMedArtListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetAllMedArten(),
+ r => pCallBack(new MedArtListVM(r.ToList())));
+ }
+
+ public static void CreateServiceDescriptionListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(
+ s1 => s1.GetAllServiceDescriptions(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllServiceCategories(),
+ r2 => pCallBack(new ServiceDescriptionListVM(r1.Where(sr => sr.ScopeType == ScopeTypeId.Global).ToList(), r2.Where(sc => sc.ScopeType == ScopeTypeId.Global).ToList()))));
+ }
+
+ public static void CreateAdditionalServiceRegionListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s1 => s1.GetAllAdditionalServiceRegion(), r1 => ServiceFacade.DoOperationsServiceAsync(s2 => s2.GetAllAdditionalService(), r2 => pCallBack(new AdditionalServiceRegionListVM(r1.ToList(), r2.ToList()))));
+ }
+
+ public static void CreateServiceRecordVMAsync(long pEmployeeOid, Action pCallBack)
+ {
+ Cache.GetInstance().GetServiceCategoryDescriptionDict(
+ dict =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.SupportConceptGoalCategoryType,
+ goalCats =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.SupportConceptIndividualGoalCategoryType,
+ iGoalCats =>
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.SupportConceptGoalType,
+ goals => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(ValueListEntryType.DocumentType,
+ docTypes =>
+ ServiceFacade.DoCustomerServiceAsync(
+ s => s.GetAllActiveWohnheimeCompact(), cb => ServiceFacade.DoCustomerServiceAsync(s2 => s2.GetAllDarreichungsformen(), abc => pCallBack(new ServiceRecordListVM(dict, goalCats, iGoalCats, goals, cb, docTypes, abc)))))))));
+ }
+
+ public static void CreateMedRecordVMAsync(long pCustomerOid, Action pCallback)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetMedRecordsForCustomer(pCustomerOid), cb => pCallback(new MedRecordListVM(cb)), true);
+ }
+
+ public static void CreateSettlementListForCostBearerAndPeriod(long costBearerOid, DateTime periodStart, DateTime periodEnd, Action callback)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetSettlementInvoicesForCostBearerAndPeriod(costBearerOid, periodStart, periodEnd),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new SettlementListVM(r));
+ });
+ }
+
+ public static void CreateSettlementListForSupportConceptVMAsync(long supportconceptOid, Action callback)
+ {
+ ServiceFacade.DoAccountingServiceAsync(
+ s => s.GetSettlementInvoicesForSupportConcept(supportconceptOid),
+ r =>
+ {
+ r.Sort(
+ (dc1, dc2) =>
+ {
+ if (dc2.InvoiceDate == null)
+ {
+ return -1;
+ }
+
+ if (dc1.InvoiceDate == null)
+ {
+ return 1;
+ }
+
+ return dc2.InvoiceDate.Value.CompareTo(dc1.InvoiceDate.Value);
+ });
+ callback(new SettlementListVM(r));
+ });
+ }
+
+ public static void CreateSettlementVMAsync(long pSupportConcept2CostBearerOid, Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GenerateInitialSettlementDC(pSupportConcept2CostBearerOid), r => pCallBack(new SettlementVM(r)));
+ }
+
+ public static void CreateSupportConceptCostBearerRelVMAsync(List pList, ObservableSortCollection budgets, Action pCallBack)
+ {
+ pCallBack(new SupportConceptCostBearerRelListVM(pList, budgets));
+ }
+
+ public static void CreateSupportConceptGoalListVMAsync(ValueListEntryType pType, ValueListEntryType pParentType, Action pCallBack)
+ {
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pType, r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(pParentType, r2 => pCallBack(new SupportConceptGoalListVM(r1, r2))));
+ }
+
+ public static void CreateSupportConceptVMAsync(Action pCallback)
+ {
+ CreateSupportConceptVMAsync(new SupportConceptDC(), pCallback, true);
+ }
+
+ public static void CreateSupportConceptVMAsync(long pOid, Action pCallback)
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.LoadSupportConcept(pOid),
+ r => CreateSupportConceptVMAsync(r, pCallback, false));
+ }
+
+ public static void CreateSupportConceptVMAsync(SupportConceptDC dc, Action pCallBack, bool initOriginator)
+ {
+ Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.SupportConceptGoalCategoryType,
+ r1 => Cache.GetInstance().GetAllValueListEntrysByTypeAsync(
+ ValueListEntryType.SupportConceptGoalType,
+ r2 => Cache.GetInstance().GetServiceCategoryDescriptionDict(
+ dict => ServiceFacade.DoOperationsServiceAsync(s => s.GetAllBudgets(),
+ r3 =>
+ {
+ var vm = new SupportConceptVM(dc, r1, r2, dict, r3);
+ if (initOriginator)
+ {
+ vm.Originator = BeWoApp.LoggedOnUser.Employee;
+ }
+
+ pCallBack(vm);
+ }))));
+ }
+
+ public static void CreateTeamVMAsync(Action pCallBack)
+ {
+ pCallBack(new TeamVM(new TeamDC()));
+ }
+
+ public static void CreateTeamVMAsync(long pTeamOid, Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.LoadTeam(pTeamOid), cb => pCallBack(new TeamVM(cb)));
+ }
+
+ public static void CreateGroupOfPeopleVMAsync(Action pCallBack)
+ {
+ pCallBack(new GroupOfPeopleVM(new GroupOfPeopleDC()));
+ }
+
+ public static void CreateGroupOfPeopleVMAsync(long pGroupOfPeopleOid, Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.LoadGroupOfPeople(pGroupOfPeopleOid), cb => pCallBack(new GroupOfPeopleVM(cb)));
+ }
+
+ public static void CreateGroupOfPeopleListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllGroups(BeWoApp.LoggedOnEmployee.EmployeeOid), cb => pCallBack(new GroupOfPeopleListVM(cb)));
+ }
+
+ public static void CreateAdditinoalServiceGroupOfPeopleListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetAllAdditionalServiceGroupOfPeople(), cb => pCallBack(new AdditionalServiceGroupOfPeopleListVM(cb)));
+ }
+
+ public static void CreateUserGroupVMAsync(long pOid, Action pCallBack)
+ {
+ ServiceFacade.DoUserServiceAsync(s => s.LoadUserGroup(pOid), r => pCallBack(new UserGroupVM(r)), true);
+ }
+
+ public static void CreateUserGroupVMAsync(Action pCallBack)
+ {
+ pCallBack(new UserGroupVM(new UserGroupDC()));
+ }
+
+ public static void CreateUserVMAsync(long pUserOid, Action pCallBack)
+ {
+ ServiceFacade.DoUserServiceAsync(s => s.LoadUser(pUserOid), r1 => ServiceFacade.DoUserServiceAsync(s => s.GetAllUserGroups(), r2 => pCallBack(new UserVM(r1, r2)), true), true);
+ }
+
+ public static void CreateUserVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoUserServiceAsync(s => s.GetAllUserGroups(), cb => pCallBack(new UserVM(new UserDC(), cb)), true);
+ }
+
+ public static void CreateValueListVMAsync(ValueListEntryType pType, Action pCallBack)
+ {
+ ServiceFacade.DoValueListServiceAsync(s => s.GetAllValueListEntrysByType(pType), r => pCallBack(new ValueListEntryListVM(pType, r)));
+ }
+
+
+ public static void CreateGoalCategoryVMAsync(Action pCallBack, bool pIsIncludingIndividualGoals = false)
+ {
+ var typeList = new List { ValueListEntryType.SupportConceptGoalType, ValueListEntryType.SupportConceptGoalCategoryType };
+ if (pIsIncludingIndividualGoals)
+ {
+ typeList.Add(ValueListEntryType.SupportConceptIndividualGoalCategoryType);
+ typeList.Add(ValueListEntryType.SupportConceptIndividualGoalType);
+ }
+
+ ServiceFacade.DoValueListServiceAsync(
+ s => s.GetAllValueListEntrysByTypes(typeList),
+ cb => pCallBack(new GenericValueListEntryListVM(cb)));
+ }
+
+ public static void CreateEmploymentTypeListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoEmployeeServiceAsync(s => s.GetAllEmploymentTypes(), r => pCallBack(new EmploymentTypeListVM(r)));
+ }
+
+ private static void InternalCreateCustomerVM(CustomerDC pCustomerDC, Action pCallBack)
+ {
+ var list = new List
+ {
+ ValueListEntryType.DisabilityType,
+ ValueListEntryType.CustomerCareType,
+ ValueListEntryType.PlacementObjectiveType,
+ ValueListEntryType.TerminationReasonType,
+ ValueListEntryType.Nationality,
+ ValueListEntryType.Aufenthaltsstatus,
+ ValueListEntryType.RoleInFamily,
+ ValueListEntryType.NotizenKategorieCustomer,
+ ValueListEntryType.Auftragsherkunft,
+ ValueListEntryType.Vermittlungsgrundlage
+ };
+
+ ServiceFacade.DoValueListServiceAsync(
+ s => s.GetAllValueListEntrysByTypes(list),
+ cb => ServiceFacade.DoEmployeeServiceAsync(s2 => s2.GetAllAssessmentSheetCategories(),
+ cb2 => ServiceFacade.DoEmployeeServiceAsync(s3 => s3.GetAllAssessmentSheetValues(),
+ cb3 => ServiceFacade.DoCustomerServiceAsync(s4 => s4.GetAllMedArten(),
+ cb4 => pCallBack(new CustomerVM(pCustomerDC, cb, cb2, cb3, cb4))))));
+ }
+
+ public static void CreateAppointmentCategoryListVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoCustomerServiceAsync(
+ s => s.GetAllAppointmentCategories(), cats => pCallBack(new AppointmentCategoryListVM(cats)));
+ }
+
+ public static WohnheimbuchungEmployeeRelListVM CreateEmployeeWohnheimbuchungsListVM(IEnumerable pList)
+ {
+ return new WohnheimbuchungEmployeeRelListVM(pList);
+ }
+
+ public static Wohnheimbuchung2Costbearer2SupportConceptRelListVM CreateSupportConceptWohnheimbuchungsListVM(IEnumerable pList)
+ {
+ return new Wohnheimbuchung2Costbearer2SupportConceptRelListVM(pList);
+ }
+
+ public static void CreateWohnheimbuchungsVMAsync(long? pOid, Action pCallBack)
+ {
+ Cache.GetInstance().GetServiceCategoryDescriptionDict(
+ dict =>
+ {
+ if (pOid == null)
+ {
+ pCallBack(new WohnheimbuchungsVM(new WohnheimbuchungDC(), dict));
+ }
+ else
+ {
+ ServiceFacade.DoCustomerServiceAsync(s => s.GetWohnheimbuchung(pOid.Value), cb => pCallBack(new WohnheimbuchungsVM(cb, dict)));
+ }
+ });
+ }
+
+ public static SupportConceptApprovalPeriodEmployeeRelListVM CreateSupportConceptApprovalPeriodEmployeeRelListVM(IEnumerable pList)
+ {
+ return new SupportConceptApprovalPeriodEmployeeRelListVM(pList);
+ }
+
+ public static ArbeitszeitEintragListVM CreateArbeitszeitEintragListVm(IEnumerable pList)
+ {
+ return new ArbeitszeitEintragListVM(pList);
+ }
+
+ public static void CreateSbdAdminVMAsync(Action pCallBack)
+ {
+ ServiceFacade.DoOperationsServiceAsync(s => s.GetSbdConfig(), r =>
+ {
+ pCallBack(new SbdConfigVM(r));
+ });
+ }
+
+ public static List CreateSupportConceptList()
+ {
+ List allSupportConcepts = new List();
+ List activeSupportConcepts = new List();
+
+ allSupportConcepts = ServiceFacade.DoCustomerServiceSync(
+ s => s.GetAllSupportConceptsCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
+
+ foreach (var sc in allSupportConcepts)
+ {
+ if (!sc.IsDeleted)
+ activeSupportConcepts.Add(sc);
+ }
+
+ return activeSupportConcepts;
+ }
+ public static List CreateCustomerList()
+ {
+ List allCustomers = new List();
+ List activeCustomers = new List();
+
+ allCustomers = ServiceFacade.DoCustomerServiceSync(
+ s => s.GetAllCustomersCompact(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
+
+ foreach (var customer in allCustomers)
+ {
+ if (!customer.IsDeleted)
+ activeCustomers.Add(customer);
+ }
+
+ return activeCustomers;
+ }
+ public static List CreateOrganisationList()
+ {
+ List allOrganisations = new List();
+
+ allOrganisations = ServiceFacade.DoCustomerServiceSync(s => s.GetAllActiveOrganisationsCompact());
+
+ return allOrganisations;
+ }
+ public static List CreatePeopleList()
+ {
+ List allPeople = new List();
+ List activePeople = new List();
+
+ allPeople = ServiceFacade.DoCustomerServiceSync(s => s.GetAllPersonsByTypeCompact(PersonType.Others));
+
+ foreach (var person in allPeople)
+ {
+ if (!person.IsDeleted)
+ activePeople.Add(person);
+ }
+
+ return activePeople;
+ }
+ public static List CreateEmployeeList()
+ {
+ List allEmployee = new List();
+
+ allEmployee = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllActiveEmployeesCompact());
+
+ return allEmployee;
+ }
+ public static List