diff --git a/AiCoreUnitTest/AiCoreUnitTest.csproj b/AiCoreUnitTest/AiCoreUnitTest.csproj
new file mode 100644
index 000000000..ef40b1a70
--- /dev/null
+++ b/AiCoreUnitTest/AiCoreUnitTest.csproj
@@ -0,0 +1,89 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+ {68C1F8EA-7828-4E46-8F04-91105C55860E}
+ Library
+ Properties
+ AiCoreUnitTest
+ AiCoreUnitTest
+ v4.7.2
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 15.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
+ False
+ UnitTest
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}
+ Data
+
+
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}
+ AICore
+
+
+ {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}
+ Service
+
+
+ {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}
+ Shared
+
+
+
+
+
+
+ Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AiCoreUnitTest/Ollama2FacadeTest.cs b/AiCoreUnitTest/Ollama2FacadeTest.cs
new file mode 100644
index 000000000..c9fb6fe4f
--- /dev/null
+++ b/AiCoreUnitTest/Ollama2FacadeTest.cs
@@ -0,0 +1,54 @@
+using AICore.Facade.LLM;
+using BeWo.Service.Core;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;
+using System;
+using System.Net;
+using System.Runtime.InteropServices;
+
+namespace AiCoreUnitTest
+{
+ [TestClass]
+ public class Ollama2FacadeTest
+ {
+ public OllamaApiClient Client { get; set; }
+
+ [TestInitialize]
+ public void TestInitialize()
+ {
+ var url = "https://ai3.ownsoft.de";
+ var key = "mu9ZPuUXJ4aVGLU1WL2RfPCeSMRmJREwyjVJBP7bHfSz8quZRqN7e7UwnwCDi8GZ";
+
+ Client = new OllamaApiClient(url, key, BS.Shared.AiModelSource.ollama2);
+ }
+
+ [TestMethod]
+ public void GetModels()
+ {
+ var response = Client.GetAiModelle();
+
+ Assert.IsTrue(response?.Success);
+ }
+
+ [TestMethod]
+ public void SendMessage()
+ {
+ // Build Payload
+ var payload = new
+ {
+ model = "gemma3:12b",
+ messages = new[] {
+ new {
+ role = "user",
+ message = "why is the sky blue?"
+ }
+ }
+ };
+
+ var logger = ServiceLogger.GetRequestLogger();
+ var response = Client.SendAiMessageRequest(payload, out string message, out string model, out int? duration, logger);
+
+ Assert.IsTrue(response?.Success);
+ }
+ }
+}
diff --git a/AiCoreUnitTest/OllamaFacadeTest.cs b/AiCoreUnitTest/OllamaFacadeTest.cs
new file mode 100644
index 000000000..7948d1b22
--- /dev/null
+++ b/AiCoreUnitTest/OllamaFacadeTest.cs
@@ -0,0 +1,62 @@
+using AICore.Facade.LLM;
+using BeWo.Data.Security;
+using BeWo.Service.Core;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;
+using System;
+using System.Net;
+using System.Runtime.InteropServices;
+
+namespace AiCoreUnitTest
+{
+ [TestClass]
+ public class OllamaFacadeTest
+ {
+ public string OllamaUrl { get; set; }
+ public string OllamaKey { get; set; }
+
+ [TestInitialize]
+ public void TestInitialize()
+ {
+ OllamaUrl = "https://w2.ownchat.de";
+ OllamaKey = "mu9ZPuUXJ4aVGLU1WL2RfPCeSMRmJREwyjVJBP7bHfSz8quZRqN7e7UwnwCDi8GZ";
+ }
+
+ public OllamaApiClient GetClient()
+ => new OllamaApiClient(OllamaUrl, OllamaKey);
+
+ [TestMethod]
+ public void GetModels()
+ {
+ var client = GetClient();
+
+ var response = client.GetAiModelle();
+
+ Assert.IsTrue(response?.Success);
+ }
+
+ [TestMethod]
+ public void SendMessage()
+ {
+ var client = GetClient();
+
+ // Build Payload
+ var payload = new
+ {
+ model = "llama3:latest",
+ messages = new[] {
+ new {
+ role = "user",
+ message = "Say 'Hi'!"
+ }
+ },
+ customerid = UserRightHelper.GetTenant()
+ };
+
+ var logger = ServiceLogger.GetRequestLogger();
+ var response = client.SendAiMessageRequest(payload, out string message, out string model, out int? duration, logger);
+
+ Assert.IsTrue(response?.Success);
+ }
+ }
+}
diff --git a/AiCoreUnitTest/OpenWebUIFacadeTest.cs b/AiCoreUnitTest/OpenWebUIFacadeTest.cs
new file mode 100644
index 000000000..e460ea5ca
--- /dev/null
+++ b/AiCoreUnitTest/OpenWebUIFacadeTest.cs
@@ -0,0 +1,56 @@
+using AICore.Facade.LLM;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Net;
+
+namespace AiCoreUnitTest
+{
+ //[TestClass]
+ //public class OpenWebUIFacadeTest
+ //{
+ // public string OpenWebUIUrl { get; set; }
+ // public string OpenWebUIKey { get; set; }
+
+ // [TestInitialize]
+ // public void TestInitialize()
+ // {
+ // OpenWebUIUrl = "https://owui1.ownsoft.de";
+ // OpenWebUIKey = "sk-7f5d8c418630448dbe31ab1c7e8b100a";
+ // }
+
+ // public OpenWebApiClient GetClient()
+ // => new OpenWebApiClient(OpenWebUIUrl, OpenWebUIKey);
+
+ // [TestMethod]
+ // public void GetModels()
+ // {
+ // var client = GetClient();
+
+ // var models = client.GetAiModelle();
+
+ // Assert.IsNotNull(models);
+ // }
+
+ // [TestMethod]
+ // public void SendMessage()
+ // {
+ // var client = GetClient();
+
+ // // Build Payload
+ // var payload = new
+ // {
+ // model = "llama3.2:latest",
+ // messages = new[] {
+ // new {
+ // role = "user",
+ // content = "Say Hi!"
+ // }
+ // }
+ // };
+
+ // var response = client.SendAiMessageRequest(payload, out string message, out string model, out int? duration);
+
+ // Assert.IsTrue(response?.Success);
+ // }
+ //}
+}
diff --git a/AiCoreUnitTest/Properties/AssemblyInfo.cs b/AiCoreUnitTest/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..e6db92c1a
--- /dev/null
+++ b/AiCoreUnitTest/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("AiCoreUnitTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AiCoreUnitTest")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("68c1f8ea-7828-4e46-8f04-91105c55860e")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/AiCoreUnitTest/app.config b/AiCoreUnitTest/app.config
new file mode 100644
index 000000000..6afd7c217
--- /dev/null
+++ b/AiCoreUnitTest/app.config
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AiCoreUnitTest/packages.config b/AiCoreUnitTest/packages.config
new file mode 100644
index 000000000..36cbc3e9e
--- /dev/null
+++ b/AiCoreUnitTest/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo.sln b/BeWo.sln
index 5896d25d3..6f5aa1aad 100644
--- a/BeWo.sln
+++ b/BeWo.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30523.141
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35707.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{E7543C39-A44C-40C9-82C9-E7FAA2D9A852}"
EndProject
@@ -601,6 +601,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MalteserJohanniterJohannesh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dakota", "Dakota\Dakota.csproj", "{47331732-DD96-4075-869F-83AA9F3F9937}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Components", "Components", "{7C7F1E62-B72D-419B-98A5-26A307456638}"
+ ProjectSection(SolutionItems) = preProject
+ Server\Components\README.txt = Server\Components\README.txt
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerUtils", "Server\Components\ServerUtils\ServerUtils.csproj", "{EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AICore", "Server\Components\AICore\AICore.csproj", "{69D70CA9-0DF9-419E-BFAF-F4539F129BD9}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
@@ -4796,6 +4805,38 @@ Global
{47331732-DD96-4075-869F-83AA9F3F9937}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{47331732-DD96-4075-869F-83AA9F3F9937}.Release|x86.ActiveCfg = Release|Any CPU
{47331732-DD96-4075-869F-83AA9F3F9937}.Release|x86.Build.0 = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|.NET.Build.0 = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Debug|x86.Build.0 = Debug|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|.NET.ActiveCfg = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|.NET.Build.0 = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|x86.ActiveCfg = Release|Any CPU
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57}.Release|x86.Build.0 = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|.NET.ActiveCfg = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|.NET.Build.0 = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Debug|x86.Build.0 = Debug|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|.NET.ActiveCfg = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|.NET.Build.0 = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|x86.ActiveCfg = Release|Any CPU
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -5092,6 +5133,9 @@ Global
{AD3876F3-40C0-47CF-BA36-687139903F87} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{28331CB1-17FD-4B58-A837-E0249CAAC535} = {D8A691C5-146D-4613-86CC-438F02FE9106}
{47331732-DD96-4075-869F-83AA9F3F9937} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
+ {7C7F1E62-B72D-419B-98A5-26A307456638} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A}
+ {EC2349FB-7FE0-4AD1-B28B-A7A27AF80A57} = {7C7F1E62-B72D-419B-98A5-26A307456638}
+ {69D70CA9-0DF9-419E-BFAF-F4539F129BD9} = {7C7F1E62-B72D-419B-98A5-26A307456638}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBE985BB-9F0F-4DBB-8F94-ABC37A803FF9}
diff --git a/BeWo/AI/AiChatController.cs b/BeWo/AI/AiChatController.cs
deleted file mode 100644
index 437ac29a5..000000000
--- a/BeWo/AI/AiChatController.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using BeWo.AI.View;
-using BeWo.View;
-using BeWo.View.Windows;
-using BS.Shared;
-using BS.Shared.Translation;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BeWo.AI
-{
- class AiChatController
- {
- private static void CreateAiChatWindow(AiChatView view, double height, double width)
- {
- var beWoWindow = BeWoWindowBuilder.GetBeWoWindow(Translator.Translate("Frage unsere KI"), view, height, width);
-
- view.CloseButtonClicked += () => beWoWindow.Close();
-
- beWoWindow.ShowDialog();
- }
-
- public static void ShowAiChatViewForServiceRecords(long c2sOid, DateTime start, DateTime end, double height, double width)
- {
- var ctrl = new AiChatView();
- ctrl.InitServiceRecordQuery(c2sOid, start, end);
- CreateAiChatWindow(ctrl, height, width);
- }
-
- public static void ShowAiChatViewForSingleCustomer(long customerOid, double height, double width)
- {
- var ctrl = new AiChatView();
- ctrl.InitSingleCustomerQuery(customerOid);
- CreateAiChatWindow(ctrl, height, width);
- }
-
- public static void ShowAiChatViewForObjects(TableID tableId, double height, double width)
- {
- var ctrl = new AiChatView();
- ctrl.InitObjectQuery(tableId);
- CreateAiChatWindow(ctrl, height, width);
- }
- }
-}
diff --git a/BeWo/AI/Controls/VoiceToTextButtonControl.xaml b/BeWo/AI/Controls/VoiceToTextButtonControl.xaml
index f27da309c..0b3e6948e 100644
--- a/BeWo/AI/Controls/VoiceToTextButtonControl.xaml
+++ b/BeWo/AI/Controls/VoiceToTextButtonControl.xaml
@@ -8,7 +8,7 @@
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Übernehmen
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Übernehmen
+
+
-
-
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/AssessmentSheetEntryView.xaml b/BeWo/View/Detail/AssessmentSheetEntryView.xaml
index 5325065ff..f8f77e8f2 100644
--- a/BeWo/View/Detail/AssessmentSheetEntryView.xaml
+++ b/BeWo/View/Detail/AssessmentSheetEntryView.xaml
@@ -1,22 +1,37 @@
-
+
-
+
-
+
@@ -29,96 +44,352 @@
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
@@ -149,16 +437,32 @@
-
+
-
-
-
+
+
+
-
-
+
+
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 a867fa235..90e6fd681 100644
--- a/BeWo/View/Detail/CustomerView.xaml
+++ b/BeWo/View/Detail/CustomerView.xaml
@@ -923,9 +923,9 @@
Content="Geburtstag" />
-
-
-
+
+
+
-
+
+ UpdateSourceTrigger=PropertyChanged}" />
-
+
-
-
-
-
-
-
-
-
-
!ViewModel.IsNew);
- OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2, () => !ViewModel.IsNew);
BehinderungsartenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupBehinderungsarten.IsOpen = false; })));
MerkzeichenSelection.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => this.Dispatch(() => { PopupMerkzeichen.IsOpen = false; })));
@@ -167,14 +166,6 @@ namespace BeWo.View.Detail
}
- if (BeWoApp.AppSettings.ShowAIInternal)
- {
- ButtonOpenAiChat.Visibility = Visibility.Visible;
- }
- else
- {
- ButtonOpenAiChat.Visibility = Visibility.Collapsed;
- }
#if DEBUG
tabitem_stundenplan.Visibility = Visibility.Visible;
#endif
@@ -296,7 +287,6 @@ namespace BeWo.View.Detail
}
public DelegateCommand OpenAiWindowCommand { get; }
- public DelegateCommand OpenAiPopupCommand { get; }
public Dictionary GetVisibleInformationReferences()
{
@@ -314,20 +304,19 @@ namespace BeWo.View.Detail
return dict;
}
- private void OpenAiWindow()
- {
- var customer_oid = ViewModel.DataContract.CustomerOid;
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationWindow(UIContext.CustomerSingle, context, customer_oid);
- }
-
- private void OpenAiPopup()
- {
+ private AiConversationChatViewModel getAiConversationChatViewModel()
+ {
var customer_oid = ViewModel.DataContract.CustomerOid;
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.CustomerSingle, context, customer_oid);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.CustomerDetail, context, customer_oid);
+
+ return vm;
+ }
+
+ private void OpenAiWindow()
+ {
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
void Image_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
@@ -1936,13 +1925,6 @@ namespace BeWo.View.Detail
BeWoUtils.ShowImageForm(Img.Source);
}
- private void OpenAiChat(object sender, MouseButtonEventArgs e)
- {
-
- AiChatController.ShowAiChatViewForSingleCustomer(ViewModel.DataContract.CustomerOid.Value, Math.Min(800, this.ActualHeight), Math.Min(1200, this.ActualWidth));
-
- }
-
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
diff --git a/BeWo/View/Detail/DateiBearbeiten.xaml.cs b/BeWo/View/Detail/DateiBearbeiten.xaml.cs
index 59ec504bf..5159a07ce 100644
--- a/BeWo/View/Detail/DateiBearbeiten.xaml.cs
+++ b/BeWo/View/Detail/DateiBearbeiten.xaml.cs
@@ -16,9 +16,6 @@ using BeWo.Core.Service;
using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
diff --git a/BeWo/View/Detail/EmployeeView.xaml b/BeWo/View/Detail/EmployeeView.xaml
index 7e4a79b1a..2e1aa998e 100644
--- a/BeWo/View/Detail/EmployeeView.xaml
+++ b/BeWo/View/Detail/EmployeeView.xaml
@@ -210,14 +210,18 @@
-
+
-
+
@@ -619,6 +623,7 @@
+
@@ -635,18 +640,24 @@
Grid.Row="1"
Grid.Column="0"
Margin="3"
+ VerticalAlignment="Center"
+ Content="{t:Translate EmployeeViewAdresszusatz2}" />
+
diff --git a/BeWo/View/Detail/GoalImportControl.xaml.cs b/BeWo/View/Detail/GoalImportControl.xaml.cs
index 204a12851..6f2571d5e 100644
--- a/BeWo/View/Detail/GoalImportControl.xaml.cs
+++ b/BeWo/View/Detail/GoalImportControl.xaml.cs
@@ -14,14 +14,11 @@ using System.Windows.Controls;
using System.Windows.Data;
using BeWo.ViewModel;
using BS.Shared;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
using DevExpress.Data;
using DevExpress.Mvvm.Native;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Scheduler.UI;
using DevExpress.XtraExport.Xls;
-using static BeWo.View.Detail.Report.FlexibleReportView;
namespace BeWo.View.Detail
{
diff --git a/BeWo/View/Detail/InformationView.xaml.cs b/BeWo/View/Detail/InformationView.xaml.cs
index 27376f2a5..75b9b90e6 100644
--- a/BeWo/View/Detail/InformationView.xaml.cs
+++ b/BeWo/View/Detail/InformationView.xaml.cs
@@ -17,8 +17,6 @@ using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
diff --git a/BeWo/View/Detail/InvoiceNumberView.xaml b/BeWo/View/Detail/InvoiceNumberView.xaml
index 9262e69f8..893c390de 100644
--- a/BeWo/View/Detail/InvoiceNumberView.xaml
+++ b/BeWo/View/Detail/InvoiceNumberView.xaml
@@ -1,16 +1,28 @@
-
+
-
+
@@ -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/MandatorView.xaml.cs b/BeWo/View/Detail/MandatorView.xaml.cs
index e2811ea29..eeb61eeca 100644
--- a/BeWo/View/Detail/MandatorView.xaml.cs
+++ b/BeWo/View/Detail/MandatorView.xaml.cs
@@ -27,7 +27,11 @@ namespace BeWo.View.Detail
if (BeWoApp.LoggedOnUser.HasRight(BS.Shared.UserRightType.ChatAdminSettings))
{
var url = ServiceFacade.DoOperationsServiceSync(s => s.GetOwnChatSettingsUrl());
- HyperlinkOwnChatSettings.NavigateUri = new Uri(url);
+ if (!String.IsNullOrEmpty(url))
+ {
+ HyperlinkOwnChatSettings.NavigateUri = new Uri(url);
+ }
+
//HyperlinkOwnChatSettings.Inlines.Add("testtestestt");
//HyperlinkOwnChatSettings.Text
}
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/OrganisationView.xaml.cs b/BeWo/View/Detail/OrganisationView.xaml.cs
index 003d301d2..aad1cdb3e 100644
--- a/BeWo/View/Detail/OrganisationView.xaml.cs
+++ b/BeWo/View/Detail/OrganisationView.xaml.cs
@@ -63,12 +63,12 @@ namespace BeWo.View.Detail
tabitem_documents.Visibility = Visibility.Collapsed;
}
- if (BeWoApp.IsInDeveloperMode)
- {
- txt_bezdatenannahmestelle.IsEnabled = true;
- txt_ikdatenannahmestelle.IsEnabled = true;
- txt_ikkostentrager.IsEnabled = true;
- }
+ //if (BeWoAppInfo.IsInDeveloperMode)
+ //{
+ // txt_bezdatenannahmestelle.IsEnabled = true;
+ // txt_ikdatenannahmestelle.IsEnabled = true;
+ // txt_ikkostentrager.IsEnabled = true;
+ //}
}
public event EventHandler> OrganisationSavedOrUpdated;
diff --git a/BeWo/View/Detail/OwnChatSettingsView.xaml.cs b/BeWo/View/Detail/OwnChatSettingsView.xaml.cs
index cda7cb6c6..4cb8d9c7b 100644
--- a/BeWo/View/Detail/OwnChatSettingsView.xaml.cs
+++ b/BeWo/View/Detail/OwnChatSettingsView.xaml.cs
@@ -2,7 +2,6 @@
using System.Windows;
using BeWo.ServiceProxy;
using BeWo.ViewModel;
-using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWo.View.Detail
diff --git a/BeWo/View/Detail/PersonView.xaml b/BeWo/View/Detail/PersonView.xaml
index 0a18f0f2c..9f895318d 100644
--- a/BeWo/View/Detail/PersonView.xaml
+++ b/BeWo/View/Detail/PersonView.xaml
@@ -1,370 +1,835 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
- Zuordnung hinzufügen
-
-
+
+
-
+
+
+
+ Zuordnung hinzufügen
+
+
+
+
+
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/RatingEditView.xaml.cs b/BeWo/View/Detail/RatingEditView.xaml.cs
index 1cdc5eee9..f6180450b 100644
--- a/BeWo/View/Detail/RatingEditView.xaml.cs
+++ b/BeWo/View/Detail/RatingEditView.xaml.cs
@@ -16,9 +16,6 @@ using BeWo.Core.Service;
using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
diff --git a/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
index 1433090e8..6ff5d4194 100644
--- a/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
+++ b/BeWo/View/Detail/Report/AbwesenheitsPrintControl.xaml.cs
@@ -1,5 +1,4 @@
using BeWo.ServiceProxy;
-using BS.Shared.DataContracts.Compact;
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
diff --git a/BeWo/View/Detail/Report/AbwesenheitsView.xaml b/BeWo/View/Detail/Report/AbwesenheitsView.xaml
index 5797e5f2c..ae06d3bbb 100644
--- a/BeWo/View/Detail/Report/AbwesenheitsView.xaml
+++ b/BeWo/View/Detail/Report/AbwesenheitsView.xaml
@@ -1,243 +1,367 @@
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:XtraScheduler="clr-namespace:DevExpress.XtraScheduler;assembly=DevExpress.XtraScheduler.v23.2.Core"
+ xmlns:controls="clr-namespace:BeWo.View.Controls"
+ xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
+ xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
+ xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
+ xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
+ xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
+ xmlns:dxschi="http://schemas.devexpress.com/winfx/2008/xaml/scheduler/internal"
+ xmlns:dxschv="http://schemas.devexpress.com/winfx/2008/xaml/scheduling/visual"
+ xmlns:localView="clr-namespace:BeWo.View"
+ xmlns:report="clr-namespace:BeWo.View.Detail.Report"
+ xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
+ Width="Auto"
+ Height="Auto"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ Focusable="True">
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
index 9247f194e..0f8cedcca 100644
--- a/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
+++ b/BeWo/View/Detail/Report/FlexibleReportView.xaml.cs
@@ -16,7 +16,6 @@ using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Translation;
using DevExpress.Xpf.Core;
diff --git a/BeWo/View/Detail/Report/IcfImportControl.xaml.cs b/BeWo/View/Detail/Report/IcfImportControl.xaml.cs
index 7142438d5..4c624dbbd 100644
--- a/BeWo/View/Detail/Report/IcfImportControl.xaml.cs
+++ b/BeWo/View/Detail/Report/IcfImportControl.xaml.cs
@@ -21,7 +21,6 @@ using DevExpress.Mvvm.Native;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Scheduler.UI;
using DevExpress.XtraExport.Xls;
-using static BeWo.View.Detail.Report.FlexibleReportView;
namespace BeWo.View.Detail.Report
{
diff --git a/BeWo/View/Detail/Report/QueryView.xaml b/BeWo/View/Detail/Report/QueryView.xaml
index e7831c33e..74a361719 100644
--- a/BeWo/View/Detail/Report/QueryView.xaml
+++ b/BeWo/View/Detail/Report/QueryView.xaml
@@ -1,76 +1,186 @@
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
- Ausführen
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ausführen
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
+
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Suchergebnis.xaml.cs b/BeWo/View/Detail/Suchergebnis.xaml.cs
index 8757ab7cd..8b5a1cb05 100644
--- a/BeWo/View/Detail/Suchergebnis.xaml.cs
+++ b/BeWo/View/Detail/Suchergebnis.xaml.cs
@@ -16,9 +16,6 @@ using BeWo.Core.Service;
using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
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/SupportConceptGoalRatingView.xaml.cs b/BeWo/View/Detail/SupportConceptGoalRatingView.xaml.cs
index 9f0e28f44..d6129e2b2 100644
--- a/BeWo/View/Detail/SupportConceptGoalRatingView.xaml.cs
+++ b/BeWo/View/Detail/SupportConceptGoalRatingView.xaml.cs
@@ -19,7 +19,6 @@ using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
using BS.Shared.Extensions;
using BS.Shared.Translation;
using DevExpress.Data.Helpers;
@@ -569,7 +568,7 @@ namespace BeWo.View.Detail
return;
}
- BeWoUtils.EditServiceRecord(dc, this);
+ BeWoUtils.EditServiceRecord(dc, this, null);
}
diff --git a/BeWo/View/Detail/SupportConceptGoalView.xaml.cs b/BeWo/View/Detail/SupportConceptGoalView.xaml.cs
index 99ad2299a..ab1bebbc7 100644
--- a/BeWo/View/Detail/SupportConceptGoalView.xaml.cs
+++ b/BeWo/View/Detail/SupportConceptGoalView.xaml.cs
@@ -13,7 +13,6 @@ using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
using BS.Shared.Extensions;
namespace BeWo.View.Detail
diff --git a/BeWo/View/Detail/SupportConceptView.xaml.cs b/BeWo/View/Detail/SupportConceptView.xaml.cs
index 2363e0b99..56ddd2753 100644
--- a/BeWo/View/Detail/SupportConceptView.xaml.cs
+++ b/BeWo/View/Detail/SupportConceptView.xaml.cs
@@ -25,7 +25,6 @@ using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Translation;
@@ -335,13 +334,6 @@ namespace BeWo.View.Detail
}
}
- //var mehrAlsHundertProzentBetreuungsschluessel = ViewModel.CostBearerRelations.VMList.Any(a => a.ApprovalPeriodList.VMList.Any(a2 => a2.SupportConceptApprovalEmployeeRelations.VMList.Sum(s => s.Betreuungsschluessel) > 100));
- //if (mehrAlsHundertProzentBetreuungsschluessel)
- //{
- // MessageBox.Show("Die Summe der Anteile liegt bei über 100%. Hinzufügen nicht möglich.", "Fehler", MessageBoxButton.OK, MessageBoxImage.Warning);
- // return;
- //}
-
var lDataContract = ViewModel.CommitToDataContract();
@@ -354,6 +346,7 @@ namespace BeWo.View.Detail
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.BookServiceRecordOutOfSupportConcept))
{
MessageBox.Show(Translator.Translate("Es existiert mindestens eine Buchung außerhalb des Hilfeplanzeitraums."), "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
}
else
{
@@ -366,6 +359,10 @@ namespace BeWo.View.Detail
}
}
+ if (!BeWoUtils.ValidateSupportConceptVM(ViewModel))
+ {
+ return;
+ }
try
{
//#region Neue Individuelle Ziele speichern
diff --git a/BeWo/View/Detail/TextbausteinView.xaml b/BeWo/View/Detail/TextbausteinView.xaml
index 42c5e1c38..0d5221e5d 100644
--- a/BeWo/View/Detail/TextbausteinView.xaml
+++ b/BeWo/View/Detail/TextbausteinView.xaml
@@ -1,39 +1,49 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -43,38 +53,104 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -88,7 +164,10 @@
-
+
@@ -100,7 +179,11 @@
-
+
@@ -114,30 +197,53 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -146,28 +252,39 @@
-
+
-
+
-
-
+
+
-
+
@@ -175,11 +292,14 @@
-
+
-
+
diff --git a/BeWo/View/Detail/UrlaubskontoView.xaml.cs b/BeWo/View/Detail/UrlaubskontoView.xaml.cs
index 7c55c3a04..b0193d78b 100755
--- a/BeWo/View/Detail/UrlaubskontoView.xaml.cs
+++ b/BeWo/View/Detail/UrlaubskontoView.xaml.cs
@@ -17,8 +17,6 @@ using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
diff --git a/BeWo/View/Detail/UrlaubstagSchenkenView.xaml.cs b/BeWo/View/Detail/UrlaubstagSchenkenView.xaml.cs
index 18c3a7ac0..1de413e51 100644
--- a/BeWo/View/Detail/UrlaubstagSchenkenView.xaml.cs
+++ b/BeWo/View/Detail/UrlaubstagSchenkenView.xaml.cs
@@ -17,8 +17,6 @@ using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
diff --git a/BeWo/View/Detail/Urlaubsuebersicht.xaml.cs b/BeWo/View/Detail/Urlaubsuebersicht.xaml.cs
index bae0dd2e3..fd4f1f971 100644
--- a/BeWo/View/Detail/Urlaubsuebersicht.xaml.cs
+++ b/BeWo/View/Detail/Urlaubsuebersicht.xaml.cs
@@ -17,8 +17,6 @@ using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.ClientPartials;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
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 4014f8206..0926d0210 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/WohneinheitGrundrissModalPopup.xaml.cs b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs
index 921cf2cf9..4d8df9705 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissModalPopup.xaml.cs
@@ -1,7 +1,6 @@
using BeWo.Core;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
-using BS.Shared.DataContracts;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
index e27ac6930..3b74f1569 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
@@ -180,55 +180,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/ServiceRecordEditView.xaml.cs b/BeWo/View/Detail/Zeiterfassung/ServiceRecordEditView.xaml.cs
index 63ae2e069..80db7de18 100644
--- a/BeWo/View/Detail/Zeiterfassung/ServiceRecordEditView.xaml.cs
+++ b/BeWo/View/Detail/Zeiterfassung/ServiceRecordEditView.xaml.cs
@@ -233,7 +233,14 @@ namespace BeWo.View.Detail.Zeiterfassung
{
_TextModuleButtonList.DoForEach(button => button.Visibility = Visibility.Collapsed);
}
- }
+
+ stackpanel_ai.DataContext = ViewModel;
+
+ if (!BeWoApp.AppSettings.ShowAI)
+ {
+ stackpanel_ai.Visibility = Visibility.Collapsed;
+ }
+ }
private static void CheckRecursive(List goalTree, bool wert)
{
diff --git a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
index 9f18a1228..d93be2a81 100644
--- a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
+++ b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
@@ -2,8 +2,11 @@
x:Class="BeWo.View.Detail.Zeiterfassung.ServiceRecordView2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:ai="clr-namespace:BeWo.View.Controls.AI"
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:detail="clr-namespace:BeWo.View.Detail"
+ xmlns:draw="clr-namespace:System.Drawing;assembly=System.Drawing"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
@@ -15,6 +18,7 @@
xmlns:localViewControls="clr-namespace:BeWo.View.Controls"
xmlns:localViewModel="clr-namespace:BeWo.ViewModel"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:security="clr-namespace:BeWo.Security"
xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared"
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
@@ -22,13 +26,16 @@
xmlns:val="clr-namespace:BeWo.Validation"
xmlns:ve="http://schemas.devexpress.com/winfx/2008/xaml/docking/visualelements"
xmlns:zeit="clr-namespace:BeWo.View.Detail.Zeiterfassung"
- xmlns:ai="clr-namespace:BeWo.AI.Controls"
+ xmlns:ai1="clr-namespace:BeWo.AI.Controls"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
+ d:DesignHeight="900"
+ d:DesignWidth="1300"
Focusable="True"
- KeyUp="ServiceRecordView2_OnKeyUp">
+ KeyUp="ServiceRecordView2_OnKeyUp"
+ mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 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/HomeView.xaml.cs b/BeWo/View/HomeView.xaml.cs
index b02f1eb53..05ce63a97 100644
--- a/BeWo/View/HomeView.xaml.cs
+++ b/BeWo/View/HomeView.xaml.cs
@@ -71,8 +71,6 @@ namespace BeWo.View
public ChatView ServiceChatView;
public event PropertyChangedEventHandler PropertyChanged;
- protected bool PropertyChatBerechtigung;
-
private readonly Dictionary _NewsItemExpandedState = new Dictionary();
private DateTime _BufferDate = DateTime.Today.AddDays(-1 * Datebuffer);
private DateTime _CurrentDate = DateTime.Today;
@@ -130,23 +128,20 @@ namespace BeWo.View
if (BeWoApp.AppSettings.ShowOwnChat)
{
- var berechtigung = ServiceFacade.DoEmployeeServiceSync(s => s.GetAllChatActiveEmployeesCompact());
- if (berechtigung != null)
+ var empAppCodes = ServiceFacade.DoEmployeeServiceSync(r => r.GetAllEmployeeAppCodes(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
+
+ if (empAppCodes != null && empAppCodes.Count > 0)
{
- foreach (var list in berechtigung)
+ foreach (var item in empAppCodes)
{
- if (list.PersonOid == BeWoApp.LoggedOnUser.Employee.PersonOid)
- {
- PropertyChatBerechtigung = true;
- }
+ if (item.EmployeeCode != null && !item.EmployeeCode.Equals(""))
+ BeWoApp.LoggedOnEmployeeOwnChatCode = item.EmployeeCode;
}
}
+
}
-#if DEBUG
- PropertyChatBerechtigung = true;
-#endif
- BewoChat.Visibility = PropertyChatBerechtigung ? Visibility.Visible : Visibility.Hidden;
+ BewoChat.Visibility = !String.IsNullOrEmpty(BeWoApp.LoggedOnEmployeeOwnChatCode) ? Visibility.Visible : Visibility.Hidden;
PruefePasswortStaerke();
@@ -541,59 +536,41 @@ namespace BeWo.View
if (ServiceChatView?.Visibility != Visibility.Visible)
{
#if DEBUG
- if(true)
- {
- string _Code = "ZMCKb-BckTt";
- string _kundennummer = "4368658436";
- string _benutzername = "muellerp";
- string _passwort = "F5aTk9Co47JFJCWB2Z7Y";
- string _apikey;
+
+ BeWoApp.LoggedOnEmployeeOwnChatCode = "ZMCKb-BckTt";
+ string _kundennummer = "4368658436";
+ string _benutzername = "muellerp";
+ string _passwort = "F5aTk9Co47JFJCWB2Z7Y";
+ string _apikey;
#else
- var empAppCodes = ServiceFacade.DoEmployeeServiceSync(r => r.GetAllEmployeeAppCodes(BeWoApp.LoggedOnUser.Employee.EmployeeOid));
+ //var xxx = empAppCodes.Last();
- if(empAppCodes != null && empAppCodes.Count > 0)
- {
- string _Code = "";
- foreach(var item in empAppCodes)
- {
- if(item.EmployeeCode != null && !item.EmployeeCode.Equals(""))
- _Code = item.EmployeeCode;
- }
-
- //var xxx = empAppCodes.Last();
-
- string _kundennummer = BeWoApp.Tenant;
-
- string _benutzername = BeWoApp.UserName;
- string _passwort = BeWoApp.UserPassword;
- string _apikey;
+ string _kundennummer = BeWoApp.Tenant;
+ string _benutzername = BeWoApp.UserName;
+ string _passwort = BeWoApp.UserPassword;
+ string _apikey;
#endif
- _apikey = BeWoApp.Mandator.Apikey ?? "0000";
+ _apikey = BeWoApp.Mandator.Apikey ?? "0000";
- if(!_Code.Equals(""))
+ if(!String.IsNullOrEmpty(BeWoApp.LoggedOnEmployeeOwnChatCode))
+ {
+ var login = new Login(_kundennummer, BeWoApp.LoggedOnEmployeeOwnChatCode, _benutzername, _passwort, _apikey);
+
+ var x = login.AnmeldevorgangDurchFuehren();
+
+ if(x != null)
{
- var login = new Login(_kundennummer, _Code, _benutzername, _passwort, _apikey);
-
- var x = login.AnmeldevorgangDurchFuehren();
-
- if(x != null)
- {
- ServiceChatView = new ChatView(x);
- ServiceChatView.Closed += ServiceChatViewClosed;
- ServiceChatView.Show();
- }
- }
- else
- {
- MessageBox.Show("Sie benötigen einen gültigen Chat-Code.", "Info");
+ ServiceChatView = new ChatView(x);
+ ServiceChatView.Closed += ServiceChatViewClosed;
+ ServiceChatView.Show();
}
}
else
{
- MessageBox.Show("Sie benötigen einen gültigen Zugang zum Chat. Bitte wenden Sie sich an den Support.", "Info");
+ MessageBox.Show("Sie benötigen einen gültigen Chat-Code.", "Info");
}
}
}
diff --git a/BeWo/View/Master/AdministrationView.xaml b/BeWo/View/Master/AdministrationView.xaml
index c586ced41..c44904625 100644
--- a/BeWo/View/Master/AdministrationView.xaml
+++ b/BeWo/View/Master/AdministrationView.xaml
@@ -131,7 +131,7 @@
Name="TabitemSozBeziehungen"
Foreground="Black"
Header="{markup:Translate Soziale Beziehungen}"
- Selected="Tabitem_Selected" />
+ Selected="Tabitem_Selected" />
-
+
+
+
+
+
+
+
+
+
+
AddView(TabitemSozioTherapie, new SoziotherapieSettingsView(this)));
return;
+ //case nameof(TabitemAiPromptbausteine):
+ // VMFactory.CreateAiPromptbausteinListVMAsync(
+ // r => this.Dispatch(() => AddView(TabitemAiPromptbausteine, new AiPromptbausteinView(r))));
+ // return;
+ //case nameof(TabitemAiPr omptbausteineTree):
+ // AddView(TabitemAiPromptbausteineTree, new AiPromptbausteinTreeView());
+ // return;
+ case nameof(TabitemAiPromptbausteineComplexTree1):
+ var vm11 = new AiPromptbausteinComplexTreeViewModel(BeWoApp.MainControl.WindowService, AiActionType.ServiceRecordConversation);
+ AddView(TabitemAiPromptbausteineComplexTree1, new AiPromptbausteinComplexTreeView(vm11));
+ return;
+ case nameof(TabitemAiPromptbausteineComplexTree2):
+ var vm12 = new AiPromptbausteinComplexTreeViewModel(BeWoApp.MainControl.WindowService, AiActionType.ServiceRecordDocumentation);
+ AddView(TabitemAiPromptbausteineComplexTree2, new AiPromptbausteinComplexTreeView(vm12));
+ return;
}
throw new ArgumentOutOfRangeException(nameof(accordionItem));
diff --git a/BeWo/View/Master/AiConversationView.xaml.cs b/BeWo/View/Master/AiConversationView.xaml.cs
index 912e50c46..8a8158aef 100644
--- a/BeWo/View/Master/AiConversationView.xaml.cs
+++ b/BeWo/View/Master/AiConversationView.xaml.cs
@@ -1,6 +1,5 @@
using BeWo.ServiceProxy;
using BeWo.ViewModel.ListViewModel;
-using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using DevExpress.Mvvm;
using System;
@@ -39,7 +38,7 @@ namespace BeWo.View.Master
set => DataContext = value;
}
- public DelegateCommand OpenAiSettingCommand { get; set; }
+ //public DelegateCommand OpenAiSettingCommand { get; set; }
private void BeWoView_Loaded(object sender, RoutedEventArgs e)
{
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 b/BeWo/View/Navigation/CustomerNavigationView.xaml
index c57cf6fc9..3330f0873 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml
@@ -331,7 +331,6 @@
MainGroupHeader="{markup:Translate Klienten}"
MainListItemStyle="{StaticResource CustomerDetailStyle}"
OnReloadData="MainNavigationView_OnReloadData"
- OpenAiChat="MainNavigationView_OpenAiChat"
OpenMailMergeWindow="MainNavigationView_OnOpenMailMergeWindow"
OpenObject="mainNavigationView_OpenObject"
Print="mainNavigationView_Print"
diff --git a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
index dbeb05659..212948194 100644
--- a/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/CustomerNavigationView.xaml.cs
@@ -23,15 +23,14 @@ using BS.Shared.Extensions;
using BS.Shared.Translation;
using Microsoft.Win32;
-using BeWo.AI;
using BeWo.View.Document;
using DevExpress.Mvvm;
-using BeWo.View.Detail.AI;
using System;
using BeWo.View.Windows;
using System.Collections;
using System.Windows.Input;
using BeWo.Core.Commands;
+using BeWo.ViewModel.View.AI;
namespace BeWo.View.Navigation
{
@@ -52,7 +51,6 @@ namespace BeWo.View.Navigation
InitializeComponent();
mainNavigationView.OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
- mainNavigationView.OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
mainNavigationView.Sorter = new CustomerSorter();
mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.Customer_AllowArchiving);
@@ -71,11 +69,6 @@ namespace BeWo.View.Navigation
//supportConceptFilterComboBox.SelectionChanged = "sortCombo_SelectionChanged";
supportConceptFilterComboBox.Style = FindResource("SortComboBox") as Style;
- if (BeWoApp.AppSettings.ShowAIInternal)
- {
- mainNavigationView.btnOpenAi.Visibility = Visibility.Visible;
- }
-
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
{
supportConceptFilterComboBox.Items.Add(new CustomerFilterItem(CustomerFilterEnum.All));
@@ -196,24 +189,24 @@ namespace BeWo.View.Navigation
}
var dict = new Dictionary() {
- { TableID.Customer, oids.ToArray()}
+ { TableID.Customer, oids.Distinct().ToArray()}
};
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Customer, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.CustomerNavigation, context);
+
+ return vm;
}
- private void OpenAiPopup()
+ private void OpenAiWindow()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Customer, context);
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs)
@@ -544,10 +537,5 @@ namespace BeWo.View.Navigation
});
});
}
-
- private void MainNavigationView_OpenAiChat()
- {
- AiChatController.ShowAiChatViewForObjects(TableID.Customer, 800, 1200);
- }
}
}
\ No newline at end of file
diff --git a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
index 858ca7bd4..28f9811ad 100644
--- a/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/EmployeeNavigationView.xaml.cs
@@ -15,7 +15,7 @@ using BeWo.View.Detail;
using BeWo.View.Navigation.Sorter;
using BeWo.View.Windows;
using BeWo.ViewModel;
-
+using BeWo.ViewModel.View.AI;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -38,7 +38,6 @@ namespace BeWo.View.Navigation
InitializeComponent();
mainNavigationView.OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
- mainNavigationView.OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
//if (BeWoApp.UserName == "BSAdmin" && BeWoApp.UserPassword.IndexOf("P!d") > 0)
//{
@@ -103,24 +102,24 @@ namespace BeWo.View.Navigation
}
var dict = new Dictionary() {
- { TableID.Employee, oids.ToArray()}
+ { TableID.Employee, oids.Distinct().ToArray()}
};
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Employee, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.EmployeeNavigation, context);
+
+ return vm;
}
- private void OpenAiPopup()
+ private void OpenAiWindow()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Employee, context);
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private bool MainNavigationView_ArchiveObject(IFilterableDC obj)
diff --git a/BeWo/View/Navigation/MainNavigationView.xaml b/BeWo/View/Navigation/MainNavigationView.xaml
index 71d990746..49c00efb8 100644
--- a/BeWo/View/Navigation/MainNavigationView.xaml
+++ b/BeWo/View/Navigation/MainNavigationView.xaml
@@ -267,13 +267,6 @@
Click="btnDelete_Click"
Content="Löschen"
Style="{StaticResource NavigationToolbarButtonStyle}" />
-
@@ -288,13 +281,7 @@
Command="{Binding Path=OpenAiWindowCommand, RelativeSource={RelativeSource AncestorType={x:Type localView:BeWoView}}}"
Content="AI Chat Window"
Style="{StaticResource NavigationToolbarButtonStyle}" />
-
-
+
false);
OpenAiWindowCommand = new DelegateCommand(null, () => false);
}
@@ -96,8 +95,6 @@ namespace BeWo.View.Navigation
public delegate void ImportObjectsDelegate();
- public delegate void OpenAiChatDelegate();
-
public delegate bool DeleteObjectDelegate(IFilterableDC obj);
public delegate void OpenObjectDelegate(IFilterableDC obj);
@@ -114,8 +111,6 @@ namespace BeWo.View.Navigation
public event ImportObjectsDelegate ImportObjects;
- public event OpenAiChatDelegate OpenAiChat;
-
public event DeleteObjectDelegate DeleteObject;
public event EventHandler>> ExcelExport;
@@ -133,7 +128,6 @@ namespace BeWo.View.Navigation
public event CopyObjectDelegate CopyObject;
public DelegateCommand OpenAiWindowCommand { get; set; }
- public DelegateCommand OpenAiPopupCommand { get; set; }
public bool ArchiveButtonVisible
{
@@ -225,19 +219,6 @@ namespace BeWo.View.Navigation
}
}
- public bool OpenAiButtonVisible
- {
- get
- {
- return btnOpenAi.Visibility == Visibility.Visible;
- }
-
- set
- {
- btnOpenAi.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
- }
- }
-
//[TypeConverter(typeof(UserRightTypeArrayConverter))]
//public UserRightType[] ImportDemands
//{
@@ -627,35 +608,6 @@ namespace BeWo.View.Navigation
}
}
- // Christian
- private void btnOpenAi_Click(object sender, RoutedEventArgs e)
- {
- if (OpenAiChat != null)
- {
- OpenAiChat();
- }
- }
-
- // Rene Window
- private void btnOpenAi2_Click(object sender, RoutedEventArgs e)
- {
-
-
- if (OpenAiChat != null)
- {
- OpenAiChat();
- }
- }
-
- // Rene ModalPopup
- private void btnOpenAi3_Click(object sender, RoutedEventArgs e)
- {
- if (OpenAiChat != null)
- {
- OpenAiChat();
- }
- }
-
private void btnCopy_Click(object sender, RoutedEventArgs e)
{
if (CopyObject != null)
diff --git a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
index 97a6493e6..f1ab8bc70 100644
--- a/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/OrganisationNavigationView.xaml.cs
@@ -11,6 +11,7 @@ using BeWo.ServiceProxy;
using BeWo.View.Detail;
using BeWo.View.Navigation.Sorter;
using BeWo.ViewModel;
+using BeWo.ViewModel.View.AI;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -34,7 +35,6 @@ namespace BeWo.View.Navigation
InitializeComponent();
mainNavigationView.OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
- mainNavigationView.OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
mainNavigationView.Sorter = new OrganisationSorter();
@@ -68,24 +68,24 @@ namespace BeWo.View.Navigation
var dict = new Dictionary() {
{
- TableID.Organisation, oids.ToArray()}
+ TableID.Organisation, oids.Distinct().ToArray()}
};
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Organisation, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.OrganisationNavigation, context);
+
+ return vm;
}
- private void OpenAiPopup()
+ private void OpenAiWindow()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Organisation, context);
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void mainNavigationView_CreateNewObject()
diff --git a/BeWo/View/Navigation/PersonNavigationView.xaml.cs b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
index aa1435e51..5dba01680 100644
--- a/BeWo/View/Navigation/PersonNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/PersonNavigationView.xaml.cs
@@ -20,6 +20,8 @@ using BeWo.View.Windows;
using System.Collections;
using System.Windows.Input;
using BeWo.Core.Commands;
+using DevExpress.XtraBars.Docking;
+using BeWo.ViewModel.View.AI;
namespace BeWo.View.Navigation
{
@@ -38,7 +40,6 @@ namespace BeWo.View.Navigation
InitializeComponent();
mainNavigationView.OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
- mainNavigationView.OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
mainNavigationView.Sorter = new PersonSorter();
@@ -105,24 +106,24 @@ namespace BeWo.View.Navigation
var dict = new Dictionary() {
{
- TableID.Person, oids.ToArray()}
+ TableID.Person, oids.Distinct().ToArray()}
};
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.Person, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.PersonNavigation, context);
+
+ return vm;
}
- private void OpenAiPopup()
+ private void OpenAiWindow()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.Person, context);
+ MainControl.WindowService.ShowAiConversationWindow(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 4cb963d0a..7d62989ca 100644
--- a/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
+++ b/BeWo/View/Navigation/SupportConceptNavigationView.xaml.cs
@@ -27,6 +27,7 @@ using DevExpress.Mvvm;
using System.Collections;
using System.Windows.Input;
using BeWo.Core.Commands;
+using BeWo.ViewModel.View.AI;
namespace BeWo.View.Navigation
{
@@ -49,7 +50,6 @@ namespace BeWo.View.Navigation
this.InitializeComponent();
mainNavigationView.OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
- mainNavigationView.OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
this.mainNavigationView.Sorter = new SupportConceptSorter();
this.mainNavigationView.ArchiveButtonVisible = BeWoApp.LoggedOnUser.HasRight(UserRightType.SupportConceptView_AllowArchiving);
@@ -219,24 +219,24 @@ namespace BeWo.View.Navigation
var dict = new Dictionary() {
{
- TableID.SupportConcept, oids.ToArray()}
+ TableID.SupportConcept, oids.Distinct().ToArray()}
};
return dict;
}
- private void OpenAiWindow()
+ private AiConversationChatViewModel getAiConversationChatViewModel()
{
var context = GetVisibleInformationReferences();
- MainControl.WindowService.ShowAiConversationWindow(UIContext.SupportConcept, context);
+ var vm = VMFactory.CreateAiConversationChatViewModel(AiContextType.SupportConceptNavigation, context);
+
+ return vm;
}
- private void OpenAiPopup()
+ private void OpenAiWindow()
{
- var context = GetVisibleInformationReferences();
-
- MainControl.WindowService.ShowAiConversationModalViewWindow(UIContext.SupportConcept, context);
+ MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
}
private void SupportConceptFilterComboBoxOnSelectionChanged(object o, SelectionChangedEventArgs selectionChangedEventArgs)
@@ -321,41 +321,18 @@ namespace BeWo.View.Navigation
var dc = obj as CompactSupportConceptDC;
if (dc != null)
{
- if (MessageBox.Show(Translator.Translate("Wollen Sie den Hilfeplan wirklich löschen?"), "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
+ var valid = BeWoUtils.ValidateSupportConceptDeletion(dc);
+
+ if (valid)
{
- var list = ServiceFacade.DoOperationsServiceSync(s => s.GetSupportConceptInfosForSupportConceptOid(dc.SupportConceptOid));
- var delete = true;
-
- if (list != null && list.Count > 0)
+ ServiceFacade.DoCustomerServiceAsync(s =>
{
- var containsServiceRecords = false;
- foreach (var info in list.Where(info => info.RecordedHours > 0))
- {
- containsServiceRecords = true;
- }
+ s.DeactivateSupportConcept(dc.SupportConceptOid, dc.SupportConceptVersion);
+ return dc;
+ }, cb => dc.Version++);
- if (containsServiceRecords)
- {
- if (MessageBox.Show(Translator.Translate("Für den gewählten Hilfeplan wurden bereits Leistungen hinterlegt.\n Möchten Sie wirklich fortfahren und den Hilfeplan löschen?"), "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.No)
- {
- delete = false;
- }
- }
-
- }
- if (delete)
- {
- ServiceFacade.DoCustomerServiceAsync(s =>
- {
- s.DeactivateSupportConcept(dc.SupportConceptOid, dc.SupportConceptVersion);
- return dc;
- }, cb => dc.Version++);
-
- Cache.GetInstance().ClearSupportConceptTree();
- return true;
- }
-
-
+ Cache.GetInstance().ClearSupportConceptTree();
+ return true;
}
}
diff --git a/BeWo/View/Report/Auslastung/AuslastungReportView.xaml.cs b/BeWo/View/Report/Auslastung/AuslastungReportView.xaml.cs
index b608ca1d5..11d9f2d5e 100644
--- a/BeWo/View/Report/Auslastung/AuslastungReportView.xaml.cs
+++ b/BeWo/View/Report/Auslastung/AuslastungReportView.xaml.cs
@@ -15,7 +15,6 @@ using BeWo.Core;
using System.Windows.Documents;
using BeWo.Core.Service;
using System.Windows.Threading;
-using BeWo.View.Detail;
using BeWo.View.Master;
using BeWo.View.Report.FLSReport;
using BS.Shared.DataContracts.Compact;
diff --git a/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs b/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs
index 16000e651..b4d971351 100644
--- a/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs
+++ b/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs
@@ -16,11 +16,9 @@ using BeWo.Core;
using System.Windows.Documents;
using BeWo.Core.Service;
using System.Windows.Threading;
-using BeWo.View.Detail;
using BeWo.View.Master;
using BeWo.View.Report.FLSReport;
using BS.Shared.DataContracts.Compact;
-using BS.Shared.DataContracts.Reports;
using BS.Shared.DataContracts;
using BeWo.ServiceProxy;
using BS.Shared;
diff --git a/BeWo/View/Report/FLSReport/FLSOverviewDetailRow.cs b/BeWo/View/Report/FLSReport/FLSOverviewDetailRow.cs
index ac4175701..28fd85abd 100644
--- a/BeWo/View/Report/FLSReport/FLSOverviewDetailRow.cs
+++ b/BeWo/View/Report/FLSReport/FLSOverviewDetailRow.cs
@@ -27,6 +27,7 @@ namespace BeWo.View.Report.FLSReport
public bool ShowChart { get; set; }
public bool ShowOnlyTotalRows { get; set; }
+ public bool ShowOnlyDeleted { get; set; }
public bool ShowServiceRecords { get; set; }
diff --git a/BeWo/View/Report/FLSReport/FLSOverviewGenerator.cs b/BeWo/View/Report/FLSReport/FLSOverviewGenerator.cs
index a5085f884..a7d2b5509 100644
--- a/BeWo/View/Report/FLSReport/FLSOverviewGenerator.cs
+++ b/BeWo/View/Report/FLSReport/FLSOverviewGenerator.cs
@@ -216,6 +216,7 @@ namespace BeWo.View.Report.FLSReport
FLSOverviewDetailRow headerRow = new FLSOverviewDetailRow(DetailRowTypes.Header);
headerRow.ShowOnlyTotalRows = config.ShowOnlyTotalRows;
+ headerRow.ShowOnlyDeleted = config.ShowOnlyDeleted;
headerRow.ShowServiceRecords = config.ShowServiceRecords;
headerRow.ShowEinheitInMinuten = config.ShowEinheitInMinuten;
if (config.ReportType == FLSReportType.Employee)
@@ -422,6 +423,7 @@ namespace BeWo.View.Report.FLSReport
detailRow.ShowEinheitInMinuten = config.ShowEinheitInMinuten;
detailRow.ShowChart = config.ShowChart;
detailRow.ShowServiceRecords = config.ShowServiceRecords;
+ detailRow.ShowOnlyDeleted = config.ShowOnlyDeleted;
detailRow.ShowOnlyTotalRows = config.ShowOnlyTotalRows;
if (config.ReportType != FLSReportType.Costbearer && config.ReportType != FLSReportType.Team && approvedFLSDict.ContainsKey(group))
{
@@ -508,6 +510,7 @@ namespace BeWo.View.Report.FLSReport
FLSOverviewDetailRow detailRow = new FLSOverviewDetailRow(DetailRowTypes.Detail);
detailRow.ShowChart = false;
detailRow.ShowEinheitInMinuten = config.ShowEinheitInMinuten;
+ detailRow.ShowOnlyDeleted = config.ShowOnlyDeleted;
detailRow.ShowServiceRecords = config.ShowServiceRecords;
detailRow.ShowOnlyTotalRows = config.ShowOnlyTotalRows;
detailRow.GroupName = string.Empty;
@@ -615,6 +618,7 @@ namespace BeWo.View.Report.FLSReport
FLSOverviewDetailRow totalRow = new FLSOverviewDetailRow(DetailRowTypes.Total);
totalRow.ShowServiceRecords = config.ShowServiceRecords;
totalRow.ShowOnlyTotalRows = config.ShowOnlyTotalRows;
+ totalRow.ShowOnlyDeleted = config.ShowOnlyDeleted;
totalRow.ShowChart = config.ShowChart;
totalRow.ShowEinheitInMinuten = config.ShowEinheitInMinuten;
if (config.ShowOnlyTotalRows)
diff --git a/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml b/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml
index 0246c29de..9818b284e 100644
--- a/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml
+++ b/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml
@@ -1,4 +1,15 @@

-
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml.cs b/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml.cs
index 8e85603c8..464ba2811 100644
--- a/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml.cs
+++ b/BeWo/View/Report/FLSReport/FLSOverviewGrid.xaml.cs
@@ -1,6 +1,15 @@
-using System.Windows;
+using BeWo.Core;
+using BeWo.ServiceProxy;
+using BS.Shared.DataContracts;
+using BS.Shared.Translation;
+using System;
+using System.Collections.Generic;
+using System.Windows;
using System.Windows.Controls;
+using System.Windows.Input;
using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Threading;
namespace BeWo.View.Report.FLSReport
{
@@ -202,6 +211,9 @@ namespace BeWo.View.Report.FLSReport
{
foreach (var sr in item.ServiceRecordList)
{
+ var srei = new ServiceRecordEditInfo();
+
+
grid.RowDefinitions.Add(new RowDefinition());
border = new Border();
@@ -267,6 +279,8 @@ namespace BeWo.View.Report.FLSReport
lbl.SetValue(Grid.RowProperty, rowIndex);
+ srei.DateLabel = lbl;
+
if (sr.Start != null && sr.Start.Value.Second == 0)
{
if (sr.GroupOid != null && sr.GroupRoundedDuration != null && sr.GroupPersonCount != null)
@@ -296,12 +310,15 @@ namespace BeWo.View.Report.FLSReport
lbl.Margin = new Thickness(0, 20, 0, 0);
lbl.Content += sr.GroupPersonCount.Value + " Personen, " + sr.GroupEmployeeCount.Value + " Betreuuer";
+
+ srei.GroupLabel = lbl;
}
else
{
var contentVorher = sr.Start.Value.ToShortDateString().Substring(0, 6) + " " + sr.Start.Value.ToShortTimeString() + "-" + sr.Start.Value.AddMinutes((double)sr.RoundedDuration).ToShortTimeString() + " (" + (int)sr.RoundedDuration + " min.)";
//lbl.Content = string.Format("ok TEST DURATIONXXX 2");
lbl.Content = sr.DateTimeRange;
+
if (contentVorher != sr.DateTimeRange)
{
int test = 0;
@@ -335,6 +352,8 @@ namespace BeWo.View.Report.FLSReport
lbl.Margin = new Thickness(0, 20, 0, 0);
lbl.Content += sr.GroupPersonCount.Value + " Personen, " + sr.GroupEmployeeCount.Value + " Betreuuer";
+
+ srei.GroupLabel = lbl;
}
else
{
@@ -362,7 +381,7 @@ namespace BeWo.View.Report.FLSReport
// block.MaxWidth = 500;
block.Margin = new Thickness(0, 5, 5, 3);
-
+ srei.ServiceDescriptionTextBlock = block;
grid.Children.Add(block);
block = new TextBlock();
@@ -373,9 +392,31 @@ namespace BeWo.View.Report.FLSReport
block.Text = sr.Notice;
block.MaxWidth = 500;
block.Margin = new Thickness(5, 5, 5, 3);
-
+ srei.NoticeTextBlock = block;
grid.Children.Add(block);
+ if (!row.ShowOnlyDeleted)
+ {
+ srei.ServiceRecordOid = sr.ServiceRecordOid.Value;
+ srei.OldDateString = srei.DateLabel.Content != null ? srei.DateLabel.Content.ToString() : "";
+ srei.SupportConcept2CostbearerOid = sr.CostBearer2SupportConceptOid ?? 0;
+ srei.EmployeeOid = sr.EmployeeOid ?? 0;
+ var img = new Image();
+ img.SetValue(Grid.ColumnProperty, 3);
+ img.SetValue(Grid.RowProperty, rowIndex);
+ img.Width = 16;
+ img.Height = 16;
+ img.HorizontalAlignment = HorizontalAlignment.Right;
+ img.VerticalAlignment = VerticalAlignment.Top;
+ img.Margin = new Thickness(3);
+ img.Cursor = Cursors.Hand;
+ img.Source = new BitmapImage(new Uri(@"..\..\..\Ressources\Icons\edit.png", UriKind.Relative));
+
+
+ img.Tag = srei;
+ img.MouseUp += Img_MouseUp;
+ grid.Children.Add(img);
+ }
rowIndex++;
count++;
}
@@ -494,6 +535,114 @@ namespace BeWo.View.Report.FLSReport
}
}
+ private void Img_MouseUp(object sender, MouseButtonEventArgs e)
+ {
+ var img = sender as Image;
+
+ if (img?.Tag is ServiceRecordEditInfo)
+ {
+ OpenServiceRecordEditView(img.Tag as ServiceRecordEditInfo);
+ }
+ }
+
+ private ServiceRecordEditInfo lastServiceRecordEditInfo = null;
+ public void OpenServiceRecordEditView(ServiceRecordEditInfo srei)
+ {
+ lastServiceRecordEditInfo = srei;
+ var dc = new ServiceRecordDC();
+ dc.ServiceRecordOid = srei.ServiceRecordOid;
+ BeWoUtils.EditServiceRecord(dc, this, ServiceRecordSaved);
+
+ }
+
+ private void ServiceRecordSaved(List records)
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
+
+ {
+ if (lastServiceRecordEditInfo != null)
+ {
+ var record = ServiceFacade.DoOperationsServiceSync(s => s.GetServiceRecordById(lastServiceRecordEditInfo.ServiceRecordOid));
+
+ String date = String.Format("{0:dd.MM.}", record.Start);
+
+ if (record.Start.Value.Second == 0)
+ {
+ if (record.GroupOid.HasValue && record.GroupRoundedDuration.HasValue)
+ {
+ date += String.Format(" {0:HH:mm}-{1:HH:mm} ({2:0} min.)", record.Start, record.End, record.GroupRoundedDuration);
+ }
+ else
+ {
+ date += String.Format(" {0:HH:mm}-{1:HH:mm} ({2:0} min.)", record.Start, record.End, record.RoundedDuration);
+ }
+
+ }
+ else
+ {
+ date += String.Format(" {0:0} min.", record.Start, record.End, record.RoundedDuration);
+ }
+
+ String group = "";
+ if (record.GroupOid.HasValue && record.GroupPersonCount.HasValue && record.GroupEmployeeCount.HasValue)
+ {
+ group = record.GroupPersonCount.Value + " Personen, " + record.GroupEmployeeCount.Value + " Betreuuer";
+ }
+
+
+ bool modified = false;
+
+ if (!date.Equals(lastServiceRecordEditInfo.OldDateString))
+ {
+ modified = true;
+ }
+ if (lastServiceRecordEditInfo.SupportConcept2CostbearerOid != (record.CostBearer2SupportConceptOid ?? 0))
+ {
+ modified = true;
+ }
+ if (lastServiceRecordEditInfo.EmployeeOid != (record.Employee != null ? record.Employee.EmployeeOid : 0))
+ {
+ modified = true;
+ }
+ if (record.ServiceDescription.Name != lastServiceRecordEditInfo.ServiceDescriptionTextBlock.Text)
+ {
+ modified = true;
+ }
+ if (lastServiceRecordEditInfo.GroupLabel != null && !group.Equals(lastServiceRecordEditInfo.GroupLabel.Content))
+ {
+ modified = true;
+ }
+ if (modified)
+ {
+ String tt = Translator.Translate("Möglicherweise wurden durch die Änderungen Summen verändert oder der Eintrag wurde in der Ansicht verschoben. Bitte aktualisieren Sie die Auswertung.");
+ lastServiceRecordEditInfo.DateLabel.Foreground = Brushes.Red;
+ lastServiceRecordEditInfo.DateLabel.ToolTip = tt;
+
+ if (lastServiceRecordEditInfo.GroupLabel != null)
+ {
+ lastServiceRecordEditInfo.GroupLabel.Foreground = Brushes.Red;
+ lastServiceRecordEditInfo.GroupLabel.ToolTip = tt;
+ }
+
+
+ lastServiceRecordEditInfo.NoticeTextBlock.Foreground = Brushes.Red;
+ lastServiceRecordEditInfo.NoticeTextBlock.ToolTip = tt;
+
+ lastServiceRecordEditInfo.ServiceDescriptionTextBlock.Foreground = Brushes.Red;
+ lastServiceRecordEditInfo.ServiceDescriptionTextBlock.ToolTip = tt;
+ }
+ lastServiceRecordEditInfo.DateLabel.Content = date;
+ lastServiceRecordEditInfo.NoticeTextBlock.Text = record.Notice;
+ lastServiceRecordEditInfo.ServiceDescriptionTextBlock.Text = record.ServiceDescription.Name;
+
+ }
+ }
+ ));
+
+
+
+ }
+
private static void RowChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
FLSOverviewGrid item = (FLSOverviewGrid)obj;
@@ -639,4 +788,16 @@ namespace BeWo.View.Report.FLSReport
return null;
}
}
+
+ public class ServiceRecordEditInfo
+ {
+ public long ServiceRecordOid { get; set; }
+ public long? SupportConcept2CostbearerOid { get; set; }
+ public long? EmployeeOid { get; set; }
+ public String OldDateString { get; set; }
+ public Label DateLabel { get; set; }
+ public Label GroupLabel { get; set; }
+ public TextBlock ServiceDescriptionTextBlock { get; set; }
+ public TextBlock NoticeTextBlock { get; set; }
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/Report/FLSReport/FLSReportView.xaml.cs b/BeWo/View/Report/FLSReport/FLSReportView.xaml.cs
index 32faa0ef9..113c002a6 100644
--- a/BeWo/View/Report/FLSReport/FLSReportView.xaml.cs
+++ b/BeWo/View/Report/FLSReport/FLSReportView.xaml.cs
@@ -81,11 +81,15 @@ namespace BeWo.View.Report.FLSReport
- if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_EmployeeOverviewAll_View) && _SelectedEmployee == null)
+ if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.Analysis_EmployeeOverviewAll_View))
{
popupedit_employee.IsEnabled = false;
checkbox_all.IsEnabled = false;
- _SelectedEmployee = BeWoApp.LoggedOnUser.Employee;
+ if (_SelectedEmployee == null)
+ {
+ _SelectedEmployee = BeWoApp.LoggedOnUser.Employee;
+ }
+
}
else if (_SelectedEmployee == null)
{
diff --git a/BeWo/View/Report/Finance/OutstandingReceivablesListViewItem.xaml b/BeWo/View/Report/Finance/OutstandingReceivablesListViewItem.xaml
index 6af0cc010..b13dad507 100644
--- a/BeWo/View/Report/Finance/OutstandingReceivablesListViewItem.xaml
+++ b/BeWo/View/Report/Finance/OutstandingReceivablesListViewItem.xaml
@@ -1,74 +1,190 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Report/Rating/RatingReportView.xaml.cs b/BeWo/View/Report/Rating/RatingReportView.xaml.cs
index c24479dd2..18cde51d3 100644
--- a/BeWo/View/Report/Rating/RatingReportView.xaml.cs
+++ b/BeWo/View/Report/Rating/RatingReportView.xaml.cs
@@ -20,7 +20,6 @@ using BeWo.View.Detail;
using BeWo.View.Master;
using BeWo.View.Report.FLSReport;
using BS.Shared.DataContracts.Compact;
-using BS.Shared.DataContracts.Reports;
using BS.Shared.DataContracts;
using BeWo.ServiceProxy;
using BS.Shared;
diff --git a/BeWo/View/Search/SupportConceptGroupSearchView.cs b/BeWo/View/Search/SupportConceptGroupSearchView.cs
index 8e7f3ce8e..4cd824cb7 100644
--- a/BeWo/View/Search/SupportConceptGroupSearchView.cs
+++ b/BeWo/View/Search/SupportConceptGroupSearchView.cs
@@ -9,9 +9,7 @@ using System.Linq;
using System.Windows.Media.Imaging;
using BS.Shared;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
using BS.Shared.Extensions;
-using BeWo.View.Detail;
using BeWo.View.Navigation.Sorter;
using BS.Shared.DataContracts.Compact;
using BeWo.ServiceProxy;
diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml b/BeWo/View/Windows/AnimatedBeWoWindow.xaml
index 2a0e44d4f..9dc5802cf 100644
--- a/BeWo/View/Windows/AnimatedBeWoWindow.xaml
+++ b/BeWo/View/Windows/AnimatedBeWoWindow.xaml
@@ -2,6 +2,8 @@
x:Class="BeWo.View.Windows.AnimatedBeWoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:core="clr-namespace:BeWo.View.Core"
+ xmlns:view="clr-namespace:BeWo.ViewModel.View"
Title="BeWoPlaner"
MinWidth="300"
MinHeight="300"
@@ -15,6 +17,9 @@
TextOptions.TextFormattingMode="Display"
WindowStartupLocation="CenterOwner"
WindowStyle="None">
+
+
+
@@ -33,5 +38,17 @@
MouseDoubleClick="RootGroupBox_OnMouseDoubleClick"
MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown"
Style="{DynamicResource MainContentGroupBoxWithoutMaximizeBtnStyle}" />
+
+
+
diff --git a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs
index 43269c740..beb3b0598 100644
--- a/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs
+++ b/BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs
@@ -1,10 +1,13 @@
using BeWo.ServiceProxy;
+using BeWo.ViewModel.View;
+using DevExpress.Web.Internal.XmlProcessor;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization.Formatters;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -26,6 +29,8 @@ namespace BeWo.View.Windows
public partial class AnimatedBeWoWindow : Window
{
private bool closeStoryBoardCompleted = false;
+ private bool closePopupStoryBoardCompleted = false;
+ private bool openPopupStoryBoardCompleted = false;
private bool isClosing = false;
private WaitLayer2 _WaitLayer;
@@ -41,7 +46,12 @@ namespace BeWo.View.Windows
}
public bool IsMaximizable = true;
- public bool IsWaiting { get; set; } = false;
+
+ public WindowViewModel ViewModel
+ {
+ get => DataContext as WindowViewModel;
+ set => DataContext = value;
+ }
public AnimatedBeWoWindow()
{
@@ -110,10 +120,13 @@ namespace BeWo.View.Windows
try
{
var p = e.GetPosition(this);
- if (p.Y <= 40)
+
+ if (p.Y == 0 || p.Y > 40)
{
- DragMove();
+ return;
}
+
+ DragMove();
}
catch (Exception) { }
}
@@ -130,8 +143,14 @@ namespace BeWo.View.Windows
}
var pos = PointToScreen(Mouse.GetPosition(this));
+
+ if (!(e.OriginalSource is Border) && !(e.OriginalSource is TextBlock) || e.OriginalSource is TextBlock && Mouse.DirectlyOver is Button)
+ {
+ return;
+ }
- if (!(e.OriginalSource is Border) && !(e.OriginalSource is TextBlock) || pos.Y > 200d || e.OriginalSource is TextBlock && Mouse.DirectlyOver is Button)
+ var pos2 = e.GetPosition((this));
+ if(pos2.Y == 0 || pos2.Y > 40)
{
return;
}
@@ -155,34 +174,79 @@ namespace BeWo.View.Windows
public void StartWaiting()
{
- Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)StartWaitingImmediately);
+ if (openPopupStoryBoardCompleted)
+ return;
+
+ Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)delegate
+ {
+ if (FindResource("PopupLoadedAnimation") is Storyboard storyboard)
+ {
+ openPopupStoryBoardCompleted = true;
+ StartWaitingImmediately();
+ storyboard.Completed += openPopupStoryBoard_Completed;
+ Storyboard.SetTarget(storyboard.Children[0], _WaitingLayer);
+ Storyboard.SetTarget(storyboard.Children[1], _WaitingLayer);
+ storyboard.Begin();
+ }
+ else
+ {
+ throw new InvalidOperationException("PopupLoadedAnimation not found");
+ }
+ });
+ }
+
+ private void openPopupStoryBoard_Completed(object sender, EventArgs e)
+ {
+ if (!openPopupStoryBoardCompleted)
+ return;
+
+ openPopupStoryBoardCompleted = false;
+
+ if (!ServiceFacade.IsWaiting())
+ EndWaiting();
}
public void StartWaitingImmediately()
{
- if (_WaitLayer == null)
- {
- _WaitLayer = new WaitLayer2();
- Grid.SetColumnSpan(_WaitLayer, 3);
- Grid.SetRowSpan(_WaitLayer, 3);
- rootGrid.Children.Add(_WaitLayer);
- Panel.SetZIndex(_WaitLayer, int.MaxValue);
- //_WaitLayer.RefreshUI();
- }
+ ViewModel.IsWaiting = true;
+ Keyboard.Focus(_WaitingLayer);
+ _WaitingLayer.Focus();
}
public void EndWaiting()
{
- Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action)delegate
+ if (closePopupStoryBoardCompleted)
+ return;
+
+ Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)delegate
+ {
+ if (FindResource("PopupClosingAnimation") is Storyboard storyboard)
{
- if (_WaitLayer != null)
- {
- rootGrid.Children.Remove(_WaitLayer);
- _WaitLayer = null;
- }
- });
+ closePopupStoryBoardCompleted = true;
+ storyboard.Completed += closePopupStoryBoard_Completed;
+ Storyboard.SetTarget(storyboard.Children[0], _WaitingLayer);
+ Storyboard.SetTarget(storyboard.Children[1], _WaitingLayer);
+ storyboard.Begin();
+ }
+ else
+ {
+ throw new InvalidOperationException("PopupClosingAnimation not found");
+ }
+ });
+ }
+
+ private void closePopupStoryBoard_Completed(object sender, EventArgs e)
+ {
+ if (!closePopupStoryBoardCompleted)
+ return;
+
+ closePopupStoryBoardCompleted = false;
+ Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)EndWaitingImmediately);
+ }
+
+ public void EndWaitingImmediately()
+ {
+ ViewModel.IsWaiting = false;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
diff --git a/BeWo/View/Windows/BeWoWindowBuilder.cs b/BeWo/View/Windows/BeWoWindowBuilder.cs
index a317ec009..b65c9cfd1 100644
--- a/BeWo/View/Windows/BeWoWindowBuilder.cs
+++ b/BeWo/View/Windows/BeWoWindowBuilder.cs
@@ -1,7 +1,4 @@
-using BeWo.View.Controls;
-using BeWo.View.Detail;
-using BeWo.View.Detail.AI;
-using BeWo.ViewModel;
+using BeWo.ViewModel;
using BeWo.ViewModel.Light;
using BS.Shared.Extensions;
using System;
diff --git a/BeWo/ViewModel/AbstractBaseVM.cs b/BeWo/ViewModel/AbstractBaseVM.cs
index c337cd304..0209cc57c 100644
--- a/BeWo/ViewModel/AbstractBaseVM.cs
+++ b/BeWo/ViewModel/AbstractBaseVM.cs
@@ -109,5 +109,16 @@ namespace BeWo.ViewModel
_IsDirty = true;
handler?.Invoke(sender, e);
}
+
+ protected bool SetProperty(ref T field, T value, string propertyName, Func originalValueProvider = null)
+ {
+ if (EqualityComparer.Default.Equals(field, value))
+ return false;
+
+ field = value;
+
+ FirePropertyChanged(propertyName);
+ return true;
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/AbstractDCMapperVM.cs b/BeWo/ViewModel/AbstractDCMapperVM.cs
index 4f8cdb46a..9725648e0 100644
--- a/BeWo/ViewModel/AbstractDCMapperVM.cs
+++ b/BeWo/ViewModel/AbstractDCMapperVM.cs
@@ -1,4 +1,4 @@
-using BS.Shared.DataContracts;
+using DevExpress.Xpf.Accordion;
using System;
using System.Collections.Generic;
@@ -6,7 +6,7 @@ namespace BeWo.ViewModel
{
public abstract class AbstractDCMapperVM : AbstractBaseVM where DCType : new()
{
- private readonly List _DirtyProps = new List();
+ protected readonly List _DirtyProps = new List();
private bool? _IsNew;
@@ -85,7 +85,7 @@ namespace BeWo.ViewModel
}
}
- protected bool SetProperty(ref T field, T value, string propertyName, Func originalValueProvider = null)
+ protected new bool SetProperty(ref T field, T value, string propertyName, Func originalValueProvider = null)
{
if (EqualityComparer.Default.Equals(field, value))
return false;
diff --git a/BeWo/ViewModel/AdditionalServiceBookingVM.cs b/BeWo/ViewModel/AdditionalServiceBookingVM.cs
index 89a56dc6c..fa4b86833 100644
--- a/BeWo/ViewModel/AdditionalServiceBookingVM.cs
+++ b/BeWo/ViewModel/AdditionalServiceBookingVM.cs
@@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BeWo.Validation;
diff --git a/BeWo/ViewModel/AdditionalServiceGroupOfPeopleRelationVM.cs b/BeWo/ViewModel/AdditionalServiceGroupOfPeopleRelationVM.cs
index 817562dcd..95ca8c3aa 100644
--- a/BeWo/ViewModel/AdditionalServiceGroupOfPeopleRelationVM.cs
+++ b/BeWo/ViewModel/AdditionalServiceGroupOfPeopleRelationVM.cs
@@ -6,7 +6,6 @@ using BeWo.ServiceProxy;
using BeWo.Validation;
using BS.Shared.Extensions;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.DataContracts;
namespace BeWo.ViewModel
diff --git a/BeWo/ViewModel/AiConfigVM.cs b/BeWo/ViewModel/AiConfigVM.cs
index cc08b4978..3403bbb3a 100644
--- a/BeWo/ViewModel/AiConfigVM.cs
+++ b/BeWo/ViewModel/AiConfigVM.cs
@@ -1,7 +1,6 @@
using System;
using BS.Shared;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
namespace BeWo.ViewModel
@@ -12,6 +11,7 @@ namespace BeWo.ViewModel
private float _Temperature;
private float _Top_P;
private int _Max_Gen_Len;
+ private AiDataContextType _Context_Type;
public AiConfigVM() : this(null) { }
public AiConfigVM(AiConfigDC dc) : base(dc, dc.Oid)
@@ -22,57 +22,31 @@ namespace BeWo.ViewModel
public AiModelDC SelectedModel
{
get { return _SelectedModel; }
- set
- {
- if (!AreDifferent(_SelectedModel?.Oid, value?.Oid))
- return;
-
- _SelectedModel = value;
- StoreDirtyInformation(AreDifferent(DataContract.SelectedModel, value), nameof(SelectedModel));
- FirePropertyChanged(nameof(SelectedModel));
- }
+ set => SetProperty(ref _SelectedModel, value, nameof(SelectedModel), () => DataContract.SelectedModel);
}
public float Temperature
{
get { return _Temperature; }
- set
- {
- if (!AreDifferent(_Temperature, value))
- return;
-
- _Temperature = value;
- StoreDirtyInformation(AreDifferent(DataContract.Temperature, value), nameof(Temperature));
- FirePropertyChanged(nameof(Temperature));
- }
+ set => SetProperty(ref _Temperature, value, nameof(Temperature), () => DataContract.Temperature);
}
public float Top_P
{
get { return _Top_P; }
- set
- {
- if (!AreDifferent(_Top_P, value))
- return;
-
- _Top_P = value;
- StoreDirtyInformation(AreDifferent(DataContract.Top_P, value), nameof(Top_P));
- FirePropertyChanged(nameof(Top_P));
- }
+ set => SetProperty(ref _Top_P, value, nameof(Top_P), () => DataContract.Top_P);
}
public int Max_Gen_Len
{
get { return _Max_Gen_Len; }
- set
- {
- if (!AreDifferent(_Max_Gen_Len, value))
- return;
+ set => SetProperty(ref _Max_Gen_Len, value, nameof(Max_Gen_Len), () => DataContract.Max_Gen_Len);
+ }
- _Max_Gen_Len = value;
- StoreDirtyInformation(AreDifferent(DataContract.Max_Gen_Len, value), nameof(Max_Gen_Len));
- FirePropertyChanged(nameof(Max_Gen_Len));
- }
+ public AiDataContextType Context_Type
+ {
+ get { return _Context_Type; }
+ set => SetProperty(ref _Context_Type, value, nameof(Context_Type), () => DataContract.Context_Type);
}
protected override void InitByDataContract(AiConfigDC pDataContract)
@@ -81,6 +55,7 @@ namespace BeWo.ViewModel
_Temperature = pDataContract.Temperature;
_Top_P = pDataContract.Top_P;
_Max_Gen_Len = pDataContract.Max_Gen_Len;
+ _Context_Type = pDataContract.Context_Type;
}
protected override AiConfigDC MapToDataContract(AiConfigDC pDataContract, bool doCommit)
@@ -89,6 +64,7 @@ namespace BeWo.ViewModel
pDataContract.Temperature = _Temperature;
pDataContract.Top_P = _Top_P;
pDataContract.Max_Gen_Len = _Max_Gen_Len;
+ pDataContract.Context_Type = _Context_Type;
return pDataContract;
}
@@ -101,6 +77,7 @@ namespace BeWo.ViewModel
Temperature = pDataContract.Temperature;
Top_P = pDataContract.Top_P;
Max_Gen_Len = pDataContract.Max_Gen_Len;
+ Context_Type = pDataContract.Context_Type;
SetDirty(false);
}
diff --git a/BeWo/ViewModel/AiConversationMessageVM.cs b/BeWo/ViewModel/AiConversationMessageVM.cs
index 9629b0d7f..19bf5ef1a 100644
--- a/BeWo/ViewModel/AiConversationMessageVM.cs
+++ b/BeWo/ViewModel/AiConversationMessageVM.cs
@@ -1,7 +1,6 @@
using System;
using BS.Shared;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using Newtonsoft.Json;
@@ -17,6 +16,8 @@ namespace BeWo.ViewModel
}
+ public event EventHandler IsCheckedChanged;
+
public bool IsChecked
{
get { return _IsChecked; }
@@ -27,6 +28,7 @@ namespace BeWo.ViewModel
_IsChecked = value;
FirePropertyChanged(nameof(IsChecked));
+ IsCheckedChanged?.Invoke(this, EventArgs.Empty);
}
}
@@ -61,5 +63,11 @@ namespace BeWo.ViewModel
return pDataContract;
}
+
+ public void SetIsChecked(bool value)
+ {
+ _IsChecked = value;
+ FirePropertyChanged(nameof(IsChecked));
+ }
}
}
diff --git a/BeWo/ViewModel/AiConversationVM.cs b/BeWo/ViewModel/AiConversationVM.cs
index 4b754a9eb..469cf013b 100644
--- a/BeWo/ViewModel/AiConversationVM.cs
+++ b/BeWo/ViewModel/AiConversationVM.cs
@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
+using BeWo.ServiceProxy;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using DevExpress.Mvvm;
using DevExpress.Xpf.Core.Native;
@@ -16,6 +16,7 @@ namespace BeWo.ViewModel
[JsonObject(MemberSerialization.OptIn)]
public class AiConversationVM : AbstractDCMapperVM
{
+ private bool _IsEditing = false;
private string _Displayname;
private DateTime _Updated;
private AiConversationMessageListVM _Messages;
@@ -35,31 +36,14 @@ namespace BeWo.ViewModel
public string Displayname
{
get { return _Displayname; }
- set
- {
- if (!AreDifferent(_Displayname, value))
- return;
-
- _Displayname = value;
- StoreDirtyInformation(AreDifferent(DataContract.Displayname, value), nameof(Displayname));
- FirePropertyChanged(nameof(Displayname));
- FirePropertyChanged(nameof(Json));
- }
+ set => SetProperty(ref _Displayname, value, nameof(Displayname), () => DataContract.Displayname);
}
[JsonProperty]
public DateTime Updated
{
get { return _Updated; }
- set
- {
- if (!AreDifferent(Updated, value))
- return;
-
- _Updated = value;
- StoreDirtyInformation(AreDifferent(DataContract.Updated, value), nameof(Updated));
- FirePropertyChanged(nameof(Updated));
- }
+ set => SetProperty(ref _Updated, value, nameof(Updated), () => DataContract.Updated);
}
public AiConversationMessageListVM Messages
@@ -76,11 +60,20 @@ namespace BeWo.ViewModel
}
}
- [JsonProperty]
- public DateTime Created => DataContract.Created;
+ public bool IsEditing
+ {
+ get => _IsEditing;
+ set => SetProperty(ref _IsEditing, value, nameof(IsEditing));
+ }
- [JsonProperty]
+ public long Oid => DataContract.Oid.Value;
+ public long Version => DataContract.Version.Value;
+ public DateTime Created => DataContract.Created;
public AiModelDC Modell => DataContract.Modell;
+ public string Context => DataContract.Context;
+ public Dictionary ContextBeWoObjects => DataContract.ContextBeWoObjects;
+ public AiDataContextType Context_Type => DataContract.ContextType;
+ public UIContext UIContext => (UIContext)DataContract.UIContext;
protected override void InitByDataContract(AiConversationDC pDataContract)
{
@@ -107,17 +100,46 @@ namespace BeWo.ViewModel
Displayname = pDataContract.Displayname;
Updated = pDataContract.Updated;
+ FirePropertyChanged(nameof(Context_Type));
+
if (pDataContract.Messages is object)
Messages = getFilter(pDataContract.Messages);
}
private AiConversationMessageListVM getFilter(List messages)
{
- if(!BeWoApp.IsInDeveloperMode && messages is List && messages.Any())
+ if(!BeWoAppInfo.IsInAiDeveloperMode && messages is List && messages.Any())
{
messages.RemoveAll(m => m.Role == AiConversationMessageRole.System);
}
return new AiConversationMessageListVM(messages);
}
+
+ public void ResetDisplayname()
+ {
+ Displayname = DataContract.Displayname;
+ }
+
+ public void SaveDisplayname()
+ {
+ if (!IsEditing)
+ return;
+
+ IsEditing = false;
+
+ if (DataContract.Displayname == Displayname)
+ return;
+
+ ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.UpdateAiConversationDisplayname(Oid, Version, Displayname),
+ callback =>
+ {
+ DataContract.Version = callback;
+ DataContract.Displayname = Displayname;
+ },
+ (ex) =>
+ {
+ ResetDisplayname();
+ });
+ }
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/AiPromptbausteinFolderVM.cs b/BeWo/ViewModel/AiPromptbausteinFolderVM.cs
new file mode 100644
index 000000000..9abcbf546
--- /dev/null
+++ b/BeWo/ViewModel/AiPromptbausteinFolderVM.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Windows;
+using BeWo.ViewModel.ListViewModel;
+using BS.Shared;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.DataContracts.Feature.AI;
+
+namespace BeWo.ViewModel
+{
+ public class AiPromptbausteinFolderVM : AbstractDCMapperVM
+ {
+ private string _Title;
+ private string _Description;
+ private long? _ParentFolderOid;
+ private CompactEmployeeDC _Creator;
+ private bool _IsPublic;
+ private int _Position;
+ private bool _IsExpanded;
+ private AiActionType _ActionType;
+ private AiPromptbausteinFolderListVM _SubFolders;
+ private AiPromptbausteinPromptListVM _SubPrompts;
+
+ public AiPromptbausteinFolderVM(AiPromptbausteinFolderDC dc) : base(dc, dc.Oid)
+ {
+
+ }
+
+ public string Title
+ {
+ get => _Title;
+ set
+ {
+ var success = SetProperty(ref _Title, value, nameof(Title), () => DataContract.Title);
+ if (!success)
+ return;
+
+ FirePropertyChanged(nameof(Displayname));
+ }
+ }
+
+ public string Description
+ {
+ get => _Description;
+ set => SetProperty(ref _Description, value, nameof(Description), () => DataContract.Description);
+ }
+
+ public long? ParentFolderOid
+ {
+ get => _ParentFolderOid;
+ set => SetProperty(ref _ParentFolderOid, value, nameof(ParentFolderOid), () => DataContract.ParentFolderOid);
+ }
+
+ public CompactEmployeeDC Creator
+ {
+ get => DataContract.Creator;
+ set => SetProperty(ref _Creator, value, nameof(Creator), () => DataContract.Creator);
+ }
+
+ public bool IsPublic
+ {
+ get => _IsPublic;
+ set => SetProperty(ref _IsPublic, value, nameof(IsPublic), () => DataContract.IsPublic);
+ }
+
+ public int Position
+ {
+ get => _Position;
+ set => SetProperty(ref _Position, value, nameof(Position), () => DataContract.Position);
+ }
+
+ public bool IsExpanded
+ {
+ get => _IsExpanded;
+ set => SetProperty(ref _IsExpanded, value, nameof(IsExpanded));
+ }
+
+ public AiActionType ActionType
+ {
+ get => _ActionType;
+ set => SetProperty(ref _ActionType, value, nameof(ActionType), () => DataContract.ActionType);
+ }
+
+ public AiPromptbausteinFolderListVM SubFolders
+ {
+ get => _SubFolders;
+ set => SetProperty(ref _SubFolders, value, nameof(SubFolders));
+ }
+
+ public AiPromptbausteinPromptListVM SubPrompts
+ {
+ get => _SubPrompts;
+ set
+ {
+ var success = SetProperty(ref _SubPrompts, value, nameof(SubPrompts));
+ if (!success)
+ return;
+
+ _SubPrompts.VMList.ListChanged += (s, e) => {
+ FirePropertyChanged(nameof(Displayname));
+
+ if (e.ListChangedType == System.ComponentModel.ListChangedType.ItemChanged)
+ return;
+
+ FirePropertyChanged(nameof(Prompts));
+ };
+ }
+ }
+
+ public List Prompts
+ {
+ get
+ {
+ var res = new List();
+
+ res.AddRange(SubPrompts.VMList);
+
+ foreach (var folder in SubFolders.VMList)
+ {
+ res.AddRange(folder.Prompts);
+ }
+
+ return res;
+ }
+ }
+
+ public bool CanAddFolder
+ {
+ get => DataContract.CanAddFolder;
+ set => DataContract.CanAddFolder = value;
+ }
+ public bool CanAddPrompt
+ {
+ get => DataContract.CanAddPrompt;
+ set => DataContract.CanAddPrompt = value;
+ }
+ public bool CanEdit
+ {
+ get => DataContract.CanEdit;
+ set => DataContract.CanEdit = value;
+ }
+
+ public bool IsNewFeature
+ {
+ get => DataContract.IsNewFeature;
+ }
+ public bool IsEnabled
+ {
+ get => !IsNewFeature;
+ }
+
+ public AiPromptbausteinFolderVM Parent { get; set; }
+
+ public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium;
+ public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0;
+ public string Displayname
+ {
+ get
+ {
+ if (TotalPromptCount > 0)
+ {
+ return $"{Title} ({TotalPromptCount})";
+ }
+
+ return Title;
+ }
+ }
+
+ public int TotalPromptCount
+ {
+ get
+ {
+ var total = SubPrompts.Count;
+
+ foreach ( var folder in SubFolders.VMList)
+ {
+ total += folder.TotalPromptCount;
+ }
+
+ return total;
+ }
+ }
+
+ protected override void InitByDataContract(AiPromptbausteinFolderDC pDataContract)
+ {
+ _Title = pDataContract.Title;
+ _Description = pDataContract.Description;
+ _ParentFolderOid = pDataContract.ParentFolderOid;
+ _Creator = pDataContract.Creator;
+ _IsPublic = pDataContract.IsPublic;
+ _Position = pDataContract.Position;
+ _IsExpanded = pDataContract.IsExpanded;
+ _ActionType = pDataContract.ActionType;
+ _SubFolders = new AiPromptbausteinFolderListVM(pDataContract.SubFolders, this);
+ SubPrompts = new AiPromptbausteinPromptListVM(pDataContract.SubPrompts);
+ }
+
+ protected override AiPromptbausteinFolderDC MapToDataContract(AiPromptbausteinFolderDC pDataContract, bool doCommit)
+ {
+ pDataContract.Title = _Title;
+ pDataContract.Description = _Description;
+ pDataContract.ParentFolderOid = _ParentFolderOid;
+ pDataContract.Creator = _Creator;
+ pDataContract.IsPublic = _IsPublic;
+ pDataContract.Position = _Position;
+ pDataContract.ActionType = _ActionType;
+ pDataContract.SubFolders = _SubFolders.CopyToDCList(doCommit);
+ pDataContract.SubPrompts = _SubPrompts.CopyToDCList(doCommit);
+
+ return pDataContract;
+ }
+
+ public override void UpdateByDataContract(AiPromptbausteinFolderDC pDataContract)
+ {
+ Title = pDataContract.Title;
+ Description = pDataContract.Description;
+ IsPublic = pDataContract.IsPublic;
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/ViewModel/AiPromptbausteinPromptVM.cs b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
new file mode 100644
index 000000000..6eceb63bc
--- /dev/null
+++ b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
@@ -0,0 +1,198 @@
+using System;
+using System.Windows;
+using BS.Shared;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.DataContracts.Feature.AI;
+
+namespace BeWo.ViewModel
+{
+ public class AiPromptbausteinPromptVM : AbstractDCMapperVM
+ {
+ private string _Title;
+ private string _Description;
+ private long? _ParentFolderOid;
+ private CompactEmployeeDC _Creator;
+ private bool _IsPublic;
+ private int _Position;
+ private string _Prompt;
+ private bool _ShowPrompt;
+ private bool _ShowPromptByTenant;
+ private bool _IsOwnsoftPrompt;
+ private string _OwnsoftRefLink;
+ private bool _IsSelected;
+ private bool _IsFavorite;
+ private AiActionType _ActionType;
+
+ public AiPromptbausteinPromptVM(AiPromptbausteinPromptDC dc) : base(dc, dc.Oid)
+ {
+
+ }
+
+ public string Title
+ {
+ get => _Title;
+ set => SetProperty(ref _Title, value, nameof(Title), () => DataContract.Title);
+ }
+
+ public string Description
+ {
+ get => _Description;
+ set => SetProperty(ref _Description, value, nameof(Description), () => DataContract.Description);
+ }
+
+ public long? ParentFolderOid
+ {
+ get => _ParentFolderOid;
+ set => SetProperty(ref _ParentFolderOid, value, nameof(ParentFolderOid), () => DataContract.ParentFolderOid);
+ }
+
+ public CompactEmployeeDC Creator
+ {
+ get => _Creator;
+ set => SetProperty(ref _Creator, value, nameof(Creator), () => DataContract.Creator);
+ }
+
+ public bool IsPublic
+ {
+ get => _IsPublic;
+ set => SetProperty(ref _IsPublic, value, nameof(IsPublic), () => DataContract.IsPublic);
+ }
+
+ public int Position
+ {
+ get => _Position;
+ set => SetProperty(ref _Position, value, nameof(Position), () => DataContract.Position);
+ }
+
+ public string Prompt
+ {
+ get => _Prompt;
+ set => SetProperty(ref _Prompt, value, nameof(Prompt), () => DataContract.Prompt);
+ }
+
+ public bool ShowPrompt
+ {
+ get => _ShowPrompt;
+ set => SetProperty(ref _ShowPrompt, value, nameof(ShowPrompt), () => DataContract.ShowPrompt);
+ }
+
+ public bool ShowPromptByTenant
+ {
+ get => _ShowPromptByTenant;
+ set => SetProperty(ref _ShowPromptByTenant, value, nameof(ShowPromptByTenant), () => DataContract.ShowPromptByTenant);
+ }
+
+ public bool IsOwnsoftPrompt
+ {
+ get => _IsOwnsoftPrompt;
+ set => SetProperty(ref _IsOwnsoftPrompt, value, nameof(IsOwnsoftPrompt), () => DataContract.IsOwnsoftPrompt);
+ }
+
+ public string OwnsoftRefLink
+ {
+ get => _OwnsoftRefLink;
+ set => SetProperty(ref _OwnsoftRefLink, value, nameof(OwnsoftRefLink), () => DataContract.OwnsoftRefLink);
+ }
+
+ public AiActionType ActionType
+ {
+ get => _ActionType;
+ set => SetProperty(ref _ActionType, value, nameof(ActionType), () => DataContract.ActionType);
+ }
+
+ public bool IsFavorite
+ {
+ get => _IsFavorite;
+ set {
+ var success = SetProperty(ref _IsFavorite, value, nameof(IsFavorite), () => DataContract.IsFavorite);
+ if(success)
+ FirePropertyChanged(nameof(FontWeight));
+ }
+ }
+
+ public bool CanEdit
+ {
+ get => DataContract.CanEdit;
+ set => DataContract.CanEdit = value;
+ }
+
+ public bool IsSelected
+ {
+ get => _IsSelected;
+ set => SetProperty(ref _IsSelected, value, nameof(IsInfoVisible));
+ }
+
+ public bool IsInfoVisible
+ {
+ get => IsOwnsoftPrompt && !string.IsNullOrWhiteSpace(OwnsoftRefLink) && IsSelected;
+ }
+
+ public FontWeight FontWeight
+ {
+ get => IsFavorite ? FontWeights.Bold : FontWeights.Medium;
+ }
+
+ protected override void InitByDataContract(AiPromptbausteinPromptDC pDataContract)
+ {
+ _Title = pDataContract.Title;
+ _Description = pDataContract.Description;
+ _ParentFolderOid = pDataContract.ParentFolderOid;
+ _Creator = pDataContract.Creator;
+ _IsPublic = pDataContract.IsPublic;
+ _Position = pDataContract.Position;
+ _Prompt = pDataContract.Prompt;
+ _ShowPrompt = pDataContract.ShowPrompt;
+ _ShowPromptByTenant = pDataContract.ShowPromptByTenant;
+ _IsOwnsoftPrompt = pDataContract.IsOwnsoftPrompt;
+ _OwnsoftRefLink = pDataContract.OwnsoftRefLink;
+ _IsFavorite = pDataContract.IsFavorite;
+ _ActionType = pDataContract.ActionType;
+ }
+
+ protected override AiPromptbausteinPromptDC MapToDataContract(AiPromptbausteinPromptDC pDataContract, bool doCommit)
+ {
+ pDataContract.IsFavorite = _IsFavorite;
+ pDataContract.Title = _Title;
+ pDataContract.Description = _Description;
+ pDataContract.ParentFolderOid = _ParentFolderOid;
+ pDataContract.Creator = _Creator;
+ pDataContract.IsPublic = _IsPublic;
+ pDataContract.Position = _Position;
+ pDataContract.Prompt = _Prompt;
+ pDataContract.ShowPrompt = _ShowPrompt;
+ pDataContract.ShowPromptByTenant = _ShowPromptByTenant;
+ pDataContract.IsOwnsoftPrompt = _IsOwnsoftPrompt;
+ pDataContract.OwnsoftRefLink = _OwnsoftRefLink;
+ pDataContract.ActionType = _ActionType;
+
+ return pDataContract;
+ }
+
+ public override void UpdateByDataContract(AiPromptbausteinPromptDC pDataContract)
+ {
+ Title = pDataContract.Title;
+ Description = pDataContract.Description;
+ ParentFolderOid = pDataContract.ParentFolderOid;
+ Creator = pDataContract.Creator;
+ IsPublic = pDataContract.IsPublic;
+ Position = pDataContract.Position;
+ Prompt = pDataContract.Prompt;
+ ShowPrompt = pDataContract.ShowPrompt;
+ ShowPromptByTenant = pDataContract.ShowPromptByTenant;
+ IsOwnsoftPrompt = pDataContract.IsOwnsoftPrompt;
+ OwnsoftRefLink = pDataContract.OwnsoftRefLink;
+ IsFavorite = pDataContract.IsFavorite;
+ ActionType = pDataContract.ActionType;
+ }
+
+ public override bool IsDirty
+ {
+ get
+ {
+ if (!CanEdit)
+ return _DirtyProps.Contains(nameof(IsFavorite));
+ return _DirtyProps.Count > 0;
+ }
+ }
+ }
+}
diff --git a/BeWo/ViewModel/CustomerVermittlungArbeitVM.cs b/BeWo/ViewModel/CustomerVermittlungArbeitVM.cs
index 1d36ab9ba..23945c468 100644
--- a/BeWo/ViewModel/CustomerVermittlungArbeitVM.cs
+++ b/BeWo/ViewModel/CustomerVermittlungArbeitVM.cs
@@ -31,6 +31,9 @@ namespace BeWo.ViewModel
private decimal? _ZuLeistendeArbeitsstunden;
private string _Hinweis;
private DateTime? _Termin;
+ private DateTime? _Frist;
+ private string _Delikt;
+ private string _Bewaehrungshelfer;
private CustomerVermittlungBearbeitungsstatus? _CustomerVermittlungBearbeitungsstatus;
private DateTime? _Auftragsruckgabe;
private ObservableSortCollection _Verlaeufe;
@@ -247,7 +250,6 @@ namespace BeWo.ViewModel
_Tagessatze = value;
StoreDirtyInformation(AreDifferent(DataContract.Tagessatze, value), nameof(Tagessatze));
FirePropertyChanged(nameof(Tagessatze));
- UpdateHoheDerGeldstrafe();
}
}
public decimal? Tagessatzhohe
@@ -261,7 +263,6 @@ namespace BeWo.ViewModel
_Tagessatzhohe = value;
StoreDirtyInformation(AreDifferent(DataContract.Tagessatzhohe, value), nameof(Tagessatzhohe));
FirePropertyChanged(nameof(Tagessatzhohe));
- UpdateHoheDerGeldstrafe();
}
}
public decimal? HoheDerGeldstrafe
@@ -316,6 +317,49 @@ namespace BeWo.ViewModel
FirePropertyChanged(nameof(Termin));
}
}
+
+ public DateTime? Frist
+ {
+ get { return _Frist; }
+ set
+ {
+ if (!AreDifferent(_Frist, value))
+ return;
+
+ _Frist = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Frist, value), nameof(Frist));
+ FirePropertyChanged(nameof(Frist));
+ }
+ }
+
+ public string Delikt
+ {
+ get { return _Delikt; }
+ set
+ {
+ if (!AreDifferent(_Delikt, value))
+ return;
+
+ _Delikt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Delikt, value), nameof(Delikt));
+ FirePropertyChanged(nameof(Delikt));
+ }
+ }
+
+ public string Bewaehrungshelfer
+ {
+ get { return _Bewaehrungshelfer; }
+ set
+ {
+ if (!AreDifferent(_Bewaehrungshelfer, value))
+ return;
+
+ _Bewaehrungshelfer = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Bewaehrungshelfer, value), nameof(Bewaehrungshelfer));
+ FirePropertyChanged(nameof(Bewaehrungshelfer));
+ }
+ }
+
public IEnumerable CustomerVermittlungBearbeitungsstatusTypes => Utils.GetAllEnumValues();
public CustomerVermittlungBearbeitungsstatus? CustomerVermittlungBearbeitungsstatus
{
@@ -630,14 +674,6 @@ namespace BeWo.ViewModel
}
}
- public void UpdateHoheDerGeldstrafe()
- {
- if (!Tagessatze.HasValue || !Tagessatzhohe.HasValue)
- return;
-
- HoheDerGeldstrafe = Tagessatze * Tagessatzhohe;
- }
-
protected override void InitByDataContract(CustomerVermittlungArbeitDC pDataContract)
{
_VgaType = pDataContract.VgaType;
@@ -653,6 +689,9 @@ namespace BeWo.ViewModel
_ZuLeistendeArbeitsstunden = pDataContract.ZuLeistendeArbeitsstunden;
_Hinweis = pDataContract.Hinweis;
_Termin = pDataContract.Termin;
+ _Frist = pDataContract.Frist;
+ _Delikt = pDataContract.Delikt;
+ _Bewaehrungshelfer = pDataContract.Bewaehrungshelfer;
_CustomerVermittlungBearbeitungsstatus = pDataContract.CustomerVermittlungBearbeitungsstatus;
_Auftragsruckgabe = pDataContract.Auftragsruckgabe;
_Verlauf = pDataContract.Verlauf;
@@ -705,6 +744,9 @@ namespace BeWo.ViewModel
pDataContract.ZuLeistendeArbeitsstunden = _ZuLeistendeArbeitsstunden;
pDataContract.Hinweis = _Hinweis;
pDataContract.Termin = _Termin;
+ pDataContract.Frist = _Frist;
+ pDataContract.Delikt = _Delikt;
+ pDataContract.Bewaehrungshelfer = _Bewaehrungshelfer;
pDataContract.CustomerVermittlungBearbeitungsstatus = _CustomerVermittlungBearbeitungsstatus;
pDataContract.Auftragsruckgabe = _Auftragsruckgabe;
pDataContract.Verlauf = _Verlauf;
diff --git a/BeWo/ViewModel/CustomerWohnhilfeVM.cs b/BeWo/ViewModel/CustomerWohnhilfeVM.cs
index e8dd345a2..18db5409b 100644
--- a/BeWo/ViewModel/CustomerWohnhilfeVM.cs
+++ b/BeWo/ViewModel/CustomerWohnhilfeVM.cs
@@ -1,6 +1,5 @@
using BeWo.ViewModel.Wohnhilfe;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Wohnhilfe;
using DevExpress.Mvvm;
using System;
diff --git a/BeWo/ViewModel/EmployeeVM.cs b/BeWo/ViewModel/EmployeeVM.cs
index 579b63693..c6f2d08bf 100644
--- a/BeWo/ViewModel/EmployeeVM.cs
+++ b/BeWo/ViewModel/EmployeeVM.cs
@@ -66,6 +66,7 @@ namespace BeWo.ViewModel
public static string PropertyName_Profession = "Profession";
public static string PropertyName_Qualifications = "Qualifications";
public static string PropertyName_AddressLine1 = "AddressLine1";
+ public static string PropertyName_AddressLine2 = "AddressLine2";
public static string PropertyName_Street = "Street";
public static string PropertyName_TaxClass = "TaxClass";
public static string PropertyName_TaxNumber = "TaxNumber";
@@ -131,6 +132,7 @@ namespace BeWo.ViewModel
private ObservableSortCollection _Qualifications;
private Sex? _Sex;
private string _AddressLine1;
+ private string _AddressLine2;
private string _Street;
private string _TaxClass;
private string _TaxNumber;
@@ -1062,6 +1064,21 @@ namespace BeWo.ViewModel
}
}
}
+
+ public string AddressLine2
+ {
+ get { return this._AddressLine2; }
+
+ set
+ {
+ if (this.AreDifferent(this._AddressLine2, value))
+ {
+ this._AddressLine2 = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AddressLine2, value), PropertyName_AddressLine2);
+ this.FirePropertyChanged(PropertyName_AddressLine2);
+ }
+ }
+ }
public string Street
{
get { return _Street; }
@@ -1403,6 +1420,7 @@ namespace BeWo.ViewModel
_PostalCode = pDataContract.PostalCode;
_Profession = pDataContract.Profession;
_AddressLine1 = pDataContract.AddressLine1;
+ _AddressLine2 = pDataContract.AddressLine2;
_Street = pDataContract.Street;
_TaxNumber = pDataContract.TaxNumber;
_TaxClass = pDataContract.TaxClass;
@@ -1524,6 +1542,7 @@ namespace BeWo.ViewModel
pDataContract.PostalCode = _PostalCode;
pDataContract.Profession = _Profession;
pDataContract.AddressLine1 = _AddressLine1;
+ pDataContract.AddressLine2 = _AddressLine2;
pDataContract.Street = _Street;
pDataContract.TaxNumber = _TaxNumber;
pDataContract.TaxClass = _TaxClass;
diff --git a/BeWo/ViewModel/FeiertagVM.cs b/BeWo/ViewModel/FeiertagVM.cs
index f1ec3fd9b..9b9c4628d 100644
--- a/BeWo/ViewModel/FeiertagVM.cs
+++ b/BeWo/ViewModel/FeiertagVM.cs
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using BeWo.ServiceProxy;
using BeWo.Validation;
using BeWo.ViewModel.ListViewModel;
-using BS.Shared.DataContracts.Compact;
namespace BeWo.ViewModel
{
diff --git a/BeWo/ViewModel/GkvAbrechnungVM.cs b/BeWo/ViewModel/GkvAbrechnungVM.cs
index d8bc44614..a82e18dca 100644
--- a/BeWo/ViewModel/GkvAbrechnungVM.cs
+++ b/BeWo/ViewModel/GkvAbrechnungVM.cs
@@ -10,7 +10,6 @@ using BeWo.Validation;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.Extensions;
using BS.Shared.Interface;
diff --git a/BeWo/ViewModel/GoalRatingVM.cs b/BeWo/ViewModel/GoalRatingVM.cs
index 120d8454a..b1b5f8b58 100644
--- a/BeWo/ViewModel/GoalRatingVM.cs
+++ b/BeWo/ViewModel/GoalRatingVM.cs
@@ -7,7 +7,6 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
namespace BeWo.ViewModel
diff --git a/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs b/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
index 22829d2ab..5f07d28bc 100644
--- a/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
+++ b/BeWo/ViewModel/Light/GkvAbrechnungLightVM.cs
@@ -9,8 +9,6 @@ using BeWo.ServiceProxy;
using BeWo.Validation;
using BS.Shared;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.DataContracts.Light;
using BS.Shared.Extensions;
diff --git a/BeWo/ViewModel/Light/InvoiceBaseLightVM.cs b/BeWo/ViewModel/Light/InvoiceBaseLightVM.cs
index 27b487a74..23e7fbc91 100644
--- a/BeWo/ViewModel/Light/InvoiceBaseLightVM.cs
+++ b/BeWo/ViewModel/Light/InvoiceBaseLightVM.cs
@@ -3,7 +3,6 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared.DataContracts;
using BS.Shared;
using BS.Shared.DataContracts.Light;
-using BS.Shared.Interface;
using BS.Shared.Translation;
using System;
using System.Collections.Generic;
diff --git a/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs b/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
index 31fad02ad..41b8e3513 100644
--- a/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
+++ b/BeWo/ViewModel/ListViewModel/AbstractDCListMapperVM.cs
@@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows;
-using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWo.ViewModel.ListViewModel
@@ -41,15 +40,17 @@ namespace BeWo.ViewModel.ListViewModel
public AbstractDCListMapperVM(IEnumerable pDCList)
{
- _DCBackup = pDCList != null ? pDCList.ToObservableCollection() : new ObservableCollection();
+ _DCBackup = pDCList != null ? pDCList.ToObservableCollection() : new ObservableCollection();
- _DCBackup.CollectionChanged += (s, e) => _VMList.AddRange(e.NewItems.Cast().Select(CreateVM));
- }
+ _DCBackup.CollectionChanged += (s, e) => _VMList.AddRange(e.NewItems.Cast().Select(CreateVM));
+ }
public AbstractDCListMapperVM() : this(null) { }
public event EventHandler SelectedVMChanged;
+ public int Count => VMList.Count;
+
public virtual int AddedCount
{
get
@@ -156,6 +157,14 @@ namespace BeWo.ViewModel.ListViewModel
}
}
+ public virtual void Update(IEnumerable pDCList)
+ {
+ // Zwingt _VMList, damit es die Anweisung im Konstruktor nicht knallt
+ var t = VMList;
+
+ DCBackup.AddRange(pDCList);
+ }
+
public virtual VMType AddNewVMToList()
{
VMList.Add(NewVM);
@@ -262,7 +271,14 @@ namespace BeWo.ViewModel.ListViewModel
return lConstr.Invoke(new object[] { pDC }) as VMType;
}
- public void SetSelectByIndex(int index)
+ public virtual VMType CreateNewVM()
+ {
+ var lConstr = typeof(VMType).GetConstructor(new[] { typeof(DCType) });
+
+ return lConstr.Invoke(new object[] { new DCType() }) as VMType;
+ }
+
+ public void SetSelectByIndex(int index)
{
if(-1 < index && index < VMList.Count){
var x = VMList[index];
diff --git a/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs b/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
index 7a3dd3f8f..40d2ba878 100644
--- a/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/AiConversationListVM.cs
@@ -3,7 +3,6 @@ using BeWo.Core.Commands;
using BeWo.ServiceProxy;
using BS.Shared;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Extensions;
using ChatController.Utilities.Extensions;
@@ -28,16 +27,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)
@@ -48,393 +37,9 @@ namespace BeWo.ViewModel.ListViewModel
public AiConversationListVM(List pDCs) : base(pDCs)
{
- Models = new BS.Shared.Core.ObservableSortCollection();
- bool sendCanExecute() => SelectedVM is object && !string.IsNullOrWhiteSpace(MessageInput) && !IsSending;
- SendNewMessageCommand = new DelegateCommand(SendNewMessage, sendCanExecute);
- OpenNewConversationCommand = new DelegateCommand(OpenNewConversation, () => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleChatAdd));
- bool startconvCanExecute() => !string.IsNullOrWhiteSpace(MessageInput) && !IsSending;
- StartConversationWithMessageCommand = new DelegateCommand(StartConversationWithMessage, startconvCanExecute);
-
- ReloadConfigCommand = new DelegateCommand(ReloadConfig);
- ReloadConversationsCommand = new DelegateCommand(ReloadConversations);
- ReloadModelsCommand = new DelegateCommand(ReloadModels);
-
- bool openCanExecute() => (BeWoApp.AppSettings?.ModuleAiSettingsEnabled ?? true) && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleViewSetting);
- OpenSettingCommand = new DelegateCommand(OpenSetting, openCanExecute, false);
- 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 = 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()
{
@@ -485,7 +90,7 @@ namespace BeWo.ViewModel.ListViewModel
Displayname = "Displayname Megamegalange Deluxe Op 3000",
Messages = messages_dc,
Modell = model,
- UIContext = 19,
+ UIContext = AiContextType.ServiceRecord,
Updated = DateTime.Now,
};
@@ -511,7 +116,7 @@ namespace BeWo.ViewModel.ListViewModel
Created = DateTime.Now,
Displayname = "Dummy Num " + i.ToString(),
Modell = model,
- UIContext = 19,
+ UIContext = AiContextType.ServiceRecord,
Updated = DateTime.Now,
};
diff --git a/BeWo/ViewModel/ListViewModel/AiConversationMessageListVM.cs b/BeWo/ViewModel/ListViewModel/AiConversationMessageListVM.cs
index bf2d721b8..756f63ab1 100644
--- a/BeWo/ViewModel/ListViewModel/AiConversationMessageListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/AiConversationMessageListVM.cs
@@ -1,5 +1,5 @@
using BeWo.ServiceProxy;
-using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Extensions;
using ChatController.Utilities.Extensions;
using DevExpress.Mvvm;
@@ -20,37 +20,67 @@ namespace BeWo.ViewModel.ListViewModel
{
public AiConversationMessageListVM(List pDCs) : base(pDCs)
{
- VMList.ListChanged += (s, e) =>
- {
- if (e.ListChangedType == ListChangedType.ItemChanged)
- {
- var changedItem = VMList[e.NewIndex];
- Item_PropertyChanged(changedItem, new PropertyChangedEventArgs(nameof(AiConversationMessageVM.IsChecked)));
- }
- };
+ foreach(var vm in VMList)
+ {
+ vm.IsCheckedChanged += CloneIsCheckedChanged;
+ }
+
+ //VMList.ListChanged += (s, e) =>
+ // {
+ // if (e.ListChangedType == ListChangedType.ItemChanged)
+ // {
+ // var changedItem = VMList[e.NewIndex];
+ // Item_PropertyChanged(changedItem, new PropertyChangedEventArgs(nameof(AiConversationMessageVM.IsChecked)));
+ // }
+ // };
}
public AiConversationMessageListVM() : this(null) { }
- private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void CloneIsCheckedChanged(object sender, EventArgs e)
{
- if (e.PropertyName == nameof(AiConversationMessageVM.IsChecked))
+ if(sender is AiConversationMessageVM vm)
{
- var changedItem = (AiConversationMessageVM)sender;
- int index = VMList.IndexOf(changedItem);
+ int index = VMList.IndexOf(vm);
- if (changedItem.IsChecked)
+ if (vm.IsChecked)
{
- for (int i = 0; i <= index; i++)
- if (!VMList[i].IsChecked)
- VMList[i].IsChecked = true;
+ for (int i = 0; i < index; i++)
+ {
+ VMList[i].SetIsChecked(true);
+ }
}
else
{
- for (int i = index; i < VMList.Count; i++)
- if (VMList[i].IsChecked)
- VMList[i].IsChecked = false;
+ for (int i = index - 1; i < VMList.Count; i++)
+ {
+ VMList[i].SetIsChecked(false);
+ }
}
}
}
+
+ //private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
+ //{
+ // if (e.PropertyName == nameof(AiConversationMessageVM.IsChecked)
+ // && sender is AiConversationMessageVM vm
+ // && vm.Role == BS.Shared.AiConversationMessageRole.Assistent)
+ // {
+ // var changedItem = (AiConversationMessageVM)sender;
+ // int index = VMList.IndexOf(changedItem);
+
+ // if (changedItem.IsChecked)
+ // {
+ // for (int i = 0; i <= index; i++)
+ // if (!VMList[i].IsChecked)
+ // VMList[i].IsChecked = true;
+ // }
+ // else
+ // {
+ // for (int i = index - 1; i < VMList.Count; i++)
+ // if (VMList[i].IsChecked)
+ // VMList[i].IsChecked = false;
+ // }
+ // }
+ //}
}
}
diff --git a/BeWo/ViewModel/ListViewModel/AiPromptbausteinFolderListVM.cs b/BeWo/ViewModel/ListViewModel/AiPromptbausteinFolderListVM.cs
new file mode 100644
index 000000000..4914b0eea
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/AiPromptbausteinFolderListVM.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BS.Shared.DataContracts.Feature.AI;
+using DevExpress.CodeParser;
+using DevExpress.Xpf.Scheduling.Editors;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class AiPromptbausteinFolderListVM : AbstractDCListMapperVM
+ {
+ public AiPromptbausteinFolderListVM(IEnumerable pDataContracts = null, AiPromptbausteinFolderVM parent = null) : base(pDataContracts)
+ {
+ foreach (var vm in VMList)
+ {
+ vm.Parent = parent;
+
+ if(vm.DataContract.ParentFolderOid != null)
+ {
+ vm.ParentFolderOid = parent?.DataContract?.Oid;
+ }
+ }
+ }
+
+ public bool ContainsDirtyObject()
+ {
+ if (IsDirty)
+ return true;
+
+ foreach (var vm in VMList)
+ {
+ if (vm.SubFolders is object && vm.SubFolders.ContainsDirtyObject())
+ return true;
+
+ if (vm.SubPrompts is object && vm.SubPrompts.IsDirty)
+ return true;
+ }
+
+ return false;
+ }
+
+ //public IEnumerable GetNewFolders()
+ //{
+ // foreach(var folder in VMList)
+ // {
+ // if (folder.IsNew)
+ // {
+ // yield return folder;
+ // continue;
+ // }
+
+ // var new_sub_folders = folder.SubFolders.GetNewFolders();
+
+ // foreach (var new_sub_folder in new_sub_folders)
+ // {
+ // yield return new_sub_folder;
+ // }
+ // }
+ //}
+
+ //public IEnumerable GetNewPrompts()
+ //{
+ // foreach (var folder in VMList)
+ // {
+ // if (folder.IsNew)
+ // continue;
+
+ // var new_prompts = folder.SubPrompts.CommitAdded();
+ // foreach (var new_prompt in new_prompts)
+ // {
+ // yield return new_prompt;
+ // }
+
+ // var new_sub_prompts = folder.SubFolders.GetNewPrompts();
+ // foreach (var new_sub_prompt in new_sub_prompts)
+ // {
+ // yield return new_sub_prompt;
+ // }
+ // }
+ //}
+
+ //public IEnumerable GetUpdatedFolder()
+ //{
+ // foreach (var folder in VMList)
+ // {
+ // if (folder.IsNew)
+ // continue;
+
+ // var new_prompts = folder.SubPrompts.CommitAdded();
+ // foreach (var new_prompt in new_prompts)
+ // {
+ // yield return new_prompt;
+ // }
+
+ // var new_sub_prompts = folder.SubFolders.GetNewPrompts();
+ // foreach (var new_sub_prompt in new_sub_prompts)
+ // {
+ // yield return new_sub_prompt;
+ // }
+ // }
+ //}
+
+ //public IEnumerable GetUpdatedPrompt()
+ //{
+ // foreach (var folder in VMList)
+ // {
+ // if (folder.IsNew)
+ // continue;
+
+ // var new_prompts = folder.SubPrompts.CommitAdded();
+ // foreach (var new_prompt in new_prompts)
+ // {
+ // yield return new_prompt;
+ // }
+
+ // var new_sub_prompts = folder.SubFolders.GetNewPrompts();
+ // foreach (var new_sub_prompt in new_sub_prompts)
+ // {
+ // yield return new_sub_prompt;
+ // }
+ // }
+ //}
+ }
+}
diff --git a/BeWo/ViewModel/ListViewModel/AiPromptbausteinPromptListVM.cs b/BeWo/ViewModel/ListViewModel/AiPromptbausteinPromptListVM.cs
new file mode 100644
index 000000000..390743155
--- /dev/null
+++ b/BeWo/ViewModel/ListViewModel/AiPromptbausteinPromptListVM.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using BS.Shared.DataContracts.Feature.AI;
+
+namespace BeWo.ViewModel.ListViewModel
+{
+ public class AiPromptbausteinPromptListVM : AbstractDCListMapperVM
+ {
+ public AiPromptbausteinPromptListVM(IEnumerable pDataContracts = null) : base(pDataContracts)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs b/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs
index 1cfa4e929..c39190baf 100644
--- a/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/CustomerWohnhilfeListVM.cs
@@ -1,6 +1,5 @@
using BS.Shared;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Wohnhilfe;
using DevExpress.Mvvm;
using System;
diff --git a/BeWo/ViewModel/ListViewModel/Light/GkvAbrechnungLightListVM.cs b/BeWo/ViewModel/ListViewModel/Light/GkvAbrechnungLightListVM.cs
index 0e603efc9..25818f392 100644
--- a/BeWo/ViewModel/ListViewModel/Light/GkvAbrechnungLightListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/Light/GkvAbrechnungLightListVM.cs
@@ -1,8 +1,6 @@
using System.Collections.Generic;
using BeWo.ViewModel.Light;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.DataContracts.Light;
namespace BeWo.ViewModel.ListViewModel.Light
diff --git a/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs b/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
index f15f011ab..226f88daa 100644
--- a/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
@@ -3,19 +3,26 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
+using System.Text;
+using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using BeWo.Core;
+using BeWo.Core.Commands;
using BeWo.Core.Service;
using BeWo.ServiceProxy;
-
+using BeWo.View.Controls.AI;
+using BeWo.ViewModel.View.AI;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
+using BS.Shared.DataContracts.Feature.AI.Functions.ServiceRecords;
using BS.Shared.Extensions;
using BS.Shared.Services;
+using DevExpress.Mvvm;
+using DevExpress.Xpf.Editors.ExpressionEditor;
using Microsoft.VisualBasic;
using Newtonsoft.Json;
using DispatcherObject = System.Windows.Threading.DispatcherObject;
@@ -92,6 +99,21 @@ namespace BeWo.ViewModel.ListViewModel
//private static List _AllDosageForms;
+ private List _AiActionHistory;
+ private int _AiActionHistoryIndex;
+ private AiConversationButtonState _AiConversationButtonState;
+
+ public ICommand OpenAiPromptSelectionCommand { get; set; }
+ public ICommand UndoAiActionCommand { get; set; }
+ public ICommand RedoAiActionCommand { get; set; }
+
+ private List _EditAiActionHistory;
+ private int _EditAiActionHistoryIndex;
+
+ public ICommand OpenEditAiPromptSelectionCommand { get; set; }
+ public ICommand UndoEditAiActionCommand { get; set; }
+ public ICommand RedoEditAiActionCommand { get; set; }
+
public ServiceRecordListVM(
Dictionary> pCategory2Services,
IEnumerable pAllGoalCategories,
@@ -157,6 +179,346 @@ namespace BeWo.ViewModel.ListViewModel
AllDocTypes.Sort((a, b) => a.ValueListEntryOid.Value.CompareTo(b.ValueListEntryOid.Value));
}
VMList.ListChanged += (s, e) => CheckCustomerAbsenceTimes();
+
+ InitAiStuff();
+ }
+
+ private void InitAiStuff()
+ {
+ var vm_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
+
+ vm_doku.PromptAccepted += PromptAccepted;
+
+ OpenAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(
+ () => BeWoApp.MainControl.WindowService.Show(vm_doku),
+ null,
+ () => !string.IsNullOrWhiteSpace(AktuellerDokutext));
+
+ UndoAiActionCommand = new DelegateCommand(UndoAiAction, () => IsAiButtonVisible);
+ RedoAiActionCommand = new DelegateCommand(RedoAiAction, () => IsAiButtonVisible);
+
+ var vm_edit_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
+
+ vm_edit_doku.PromptAccepted += EditPromptAccepted;
+
+ OpenEditAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(() =>
+ {
+ _EditAiActionHistory = new List();
+ _EditAiActionHistory.Add(AktuellerEditDokutext);
+ _EditAiActionHistoryIndex = 0;
+ BeWoApp.MainControl.WindowService.Show(vm_edit_doku);
+ },
+ null,
+ () => !string.IsNullOrWhiteSpace(AktuellerEditDokutext));
+
+ UndoEditAiActionCommand = new DelegateCommand(UndoEditAiAction, () => IsAiButtonVisible);
+ RedoEditAiActionCommand = new DelegateCommand(RedoEditAiAction, () => IsAiButtonVisible);
+
+ _AiActionHistory = new List();
+ _AiActionHistory.Add(AktuellerDokutext);
+ _AiActionHistoryIndex = 0;
+ }
+
+ public AiConversationButtonState AiConversationButtonState
+ {
+ get => _AiConversationButtonState;
+ set => SetProperty(ref _AiConversationButtonState, value, nameof(AiConversationButtonState));
+ }
+
+ public IEnumerable CurrentVisibleVMs { get; set; }
+ public string AktuellerDokutext
+ {
+ get => PrototypeVM.Notice;
+ set
+ {
+ PrototypeVM.Notice = value;
+ FirePropertyChanged(nameof(IsRedoButtonVisible));
+ FirePropertyChanged(nameof(IsUndoButtonVisible));
+ }
+ }
+ public string AktuellerEditDokutext
+ {
+ get => EditVM?.Notice;
+ set
+ {
+ EditVM.Notice = value;
+ FirePropertyChanged(nameof(IsEditUndoButtonVisible));
+ FirePropertyChanged(nameof(IsEditRedoButtonVisible));
+ }
+ }
+
+ public bool IsAiModuleEnabled => (BeWoApp.AppSettings.ShowAI || BeWoApp.AppSettings.ShowAIVoice);
+ public bool IsAiButtonVisible => SelectedCustomerNode is object && IsAiModuleEnabled;
+ public bool IsUndoButtonVisible => _AiActionHistoryIndex > 0;
+ public bool IsRedoButtonVisible => _AiActionHistoryIndex < _AiActionHistory.Count - 1;
+
+ public bool IsEditUndoButtonVisible => _EditAiActionHistoryIndex > 0;
+ public bool IsEditRedoButtonVisible => _EditAiActionHistoryIndex < (_EditAiActionHistory?.Count ?? 0) - 1;
+
+ private void PromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
+ {
+ if (prompt is null)
+ throw new NotImplementedException();
+
+ // 1. Information aufbereiten
+ // 1.1 Prompt
+ var prompt_oid = prompt.DataContract.Oid.Value;
+ var prompt_version = prompt.DataContract.Version;
+
+ // 1.2 Hilfeplan
+ var support_concept = SelectedCustomerNode.SupportConceptTreeNodeDC.SupportConcept;
+ var support_concept_oid = support_concept.SupportConceptOid;
+ var support_concept_version = support_concept.SupportConceptVersion;
+
+ // 1.3 Aktuelles Doku Feld
+ var doku_feld = AktuellerDokutext;
+
+ // 1.4 Sichtbaren Zeiterfassungseinträge
+ var service_records = CurrentVisibleVMs;
+ var sr_refs = service_records.Select(x => new BeWoRefDC(x.DataContract.ServiceRecordOid.Value, x.DataContract.ServiceRecordVersion));
+
+ // 1.5 Costbearer
+ var costbearer = SelectedCustomerNode.SupportConceptTreeNodeDC.CostBearer;
+ var cb_oid = costbearer.CostBearerOid.Value;
+ var cb_ver = costbearer.CostBearerVersion;
+
+ // Service Aufruf
+ var req = new AiFunctionDocRequest()
+ {
+ AiPromptbausteinPrompt = new BeWoRefDC(prompt_oid, prompt_version),
+ SupportConcept = new BeWoRefDC(support_concept_oid, support_concept_version),
+ ServiceRecords = sr_refs,
+ CostBearer = new BeWoRefDC(cb_oid, cb_ver),
+ Dokumentation = doku_feld,
+ };
+
+ ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.ExecuteAiFunctionServiceRecordDocumentation(req),
+ callback =>
+ {
+ var viewModel = new AiPromptbausteinActionResultViewModel();
+
+ viewModel.Result = callback.Result;
+
+ viewModel.Accept_Button_Clicked += (s, e) =>
+ {
+ var sb = new StringBuilder();
+
+ sb.AppendLine("AI Antwort:");
+ sb.AppendLine(viewModel.Result);
+
+ sb.AppendLine();
+ sb.AppendLine("Original:");
+ sb.AppendLine(AktuellerDokutext);
+
+ var str = sb.ToString();
+ var idx = _AiActionHistoryIndex;
+ var count = _AiActionHistory.Count;
+
+ if (count - 1 > idx)
+ {
+ _AiActionHistory.RemoveRange(idx + 1, count - idx - 1);
+ }
+
+ if (AktuellerDokutext != _AiActionHistory[_AiActionHistoryIndex])
+ {
+ _AiActionHistory.Add(AktuellerDokutext);
+ _AiActionHistoryIndex++;
+ }
+
+ _AiActionHistory.Add(str);
+ _AiActionHistoryIndex++;
+
+ AktuellerDokutext = str;
+ };
+ viewModel.Replace_Button_Clicked += (s, e) =>
+ {
+ var str = viewModel.Result;
+ var idx = _AiActionHistoryIndex;
+ var count = _AiActionHistory.Count;
+
+ if (count - 1 > idx)
+ {
+ _AiActionHistory.RemoveRange(idx + 1, count - idx - 1);
+ }
+
+ if (AktuellerDokutext != _AiActionHistory[_AiActionHistoryIndex])
+ {
+ _AiActionHistory.Add(AktuellerDokutext);
+ _AiActionHistoryIndex++;
+ }
+
+ _AiActionHistory.Add(str);
+ _AiActionHistoryIndex++;
+
+ AktuellerDokutext = str;
+ };
+ viewModel.Retry_Button_Clicked += (s, e) =>
+ {
+ PromptAccepted(sender, prompt);
+ };
+
+ BeWoApp.MainControl.WindowService.Show(viewModel);
+ }
+ );
+ }
+
+ private void EditPromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
+ {
+ if (prompt is null)
+ throw new NotImplementedException();
+
+ // 1. Information aufbereiten
+ // 1.1 Prompt
+ var prompt_oid = prompt.DataContract.Oid.Value;
+ var prompt_version = prompt.DataContract.Version;
+
+ // 1.2 Hilfeplan
+ var support_concept = SelectedCustomerNode.SupportConceptTreeNodeDC.SupportConcept;
+ var support_concept_oid = support_concept.SupportConceptOid;
+ var support_concept_version = support_concept.SupportConceptVersion;
+
+ // 1.3 Aktuelles Doku Feld
+ var doku_feld = AktuellerEditDokutext;
+
+ // 1.4 Sichtbaren Zeiterfassungseinträge
+ var service_records = CurrentVisibleVMs;
+ var sr_refs = service_records.Select(x => new BeWoRefDC(x.DataContract.ServiceRecordOid.Value, x.DataContract.ServiceRecordVersion));
+
+ // 1.5 Costbearer
+ var costbearer = SelectedCustomerNode.SupportConceptTreeNodeDC.CostBearer;
+ var cb_oid = costbearer.CostBearerOid.Value;
+ var cb_ver = costbearer.CostBearerVersion;
+
+ // Service Aufruf
+ var req = new AiFunctionDocRequest()
+ {
+ AiPromptbausteinPrompt = new BeWoRefDC(prompt_oid, prompt_version),
+ SupportConcept = new BeWoRefDC(support_concept_oid, support_concept_version),
+ ServiceRecords = sr_refs,
+ CostBearer = new BeWoRefDC(cb_oid, cb_ver),
+ Dokumentation = doku_feld,
+ };
+
+ ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.ExecuteAiFunctionServiceRecordDocumentation(req),
+ callback =>
+ {
+ var viewModel = new AiPromptbausteinActionResultViewModel();
+
+ viewModel.Result = callback.Result;
+
+ viewModel.Accept_Button_Clicked += (s, e) =>
+ {
+ var sb = new StringBuilder();
+
+ sb.AppendLine("AI Antwort:");
+ sb.AppendLine(viewModel.Result);
+
+ sb.AppendLine();
+ sb.AppendLine("Original:");
+ sb.AppendLine(AktuellerEditDokutext);
+
+ var str = sb.ToString();
+ var idx = _EditAiActionHistoryIndex;
+ var count = _EditAiActionHistory.Count;
+
+ if (count - 1 > idx)
+ {
+ _EditAiActionHistory.RemoveRange(idx + 1, count - idx - 1);
+ }
+
+ if (AktuellerEditDokutext != _EditAiActionHistory[_EditAiActionHistoryIndex])
+ {
+ _EditAiActionHistory.Add(AktuellerEditDokutext);
+ _EditAiActionHistoryIndex++;
+ }
+
+ _EditAiActionHistory.Add(str);
+ _EditAiActionHistoryIndex++;
+
+ AktuellerEditDokutext = str;
+ };
+ viewModel.Replace_Button_Clicked += (s, e) =>
+ {
+ var str = viewModel.Result;
+ var idx = _EditAiActionHistoryIndex;
+ var count = _EditAiActionHistory.Count;
+
+ if (count - 1 > idx)
+ {
+ _EditAiActionHistory.RemoveRange(idx + 1, count - idx - 1);
+ }
+
+ if (AktuellerEditDokutext != _EditAiActionHistory[_EditAiActionHistoryIndex])
+ {
+ _EditAiActionHistory.Add(AktuellerEditDokutext);
+ _EditAiActionHistoryIndex++;
+ }
+
+ _EditAiActionHistory.Add(str);
+ _EditAiActionHistoryIndex++;
+
+ AktuellerEditDokutext = str;
+ };
+ viewModel.Retry_Button_Clicked += (s, e) =>
+ {
+ PromptAccepted(sender, prompt);
+ };
+
+ BeWoApp.MainControl.WindowService.Show(viewModel);
+ }
+ );
+ }
+
+ public void UpdateViewYearFilter(IEnumerable enumerable)
+ {
+ if (!IsAiModuleEnabled)
+ {
+ AiConversationButtonState = AiConversationButtonState.Hidden;
+ return;
+ }
+
+ AiConversationButtonState = AiConversationButtonState.Loading;
+ var context = GetVisibleInformationReferences(enumerable);
+ if (context != null)
+ {
+ var context2 = context.ToDictionary(kv => kv.Key, kv => kv.Value.ToList());
+
+ ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.CheckContextSize(AiContextType.ServiceRecord, context2, null),
+ isValid =>
+ {
+ if (isValid)
+ AiConversationButtonState = AiConversationButtonState.Normal;
+ else
+ AiConversationButtonState = AiConversationButtonState.Warning;
+ },
+ (exp) => AiConversationButtonState = AiConversationButtonState.Disabled);
+ }
+ }
+
+ public Dictionary GetVisibleInformationReferences(IEnumerable selected_records)
+ {
+ var current = SelectedCustomerNode;
+ var hello = current?.SupportConceptTreeNodeDC;
+ var sr = ServiceRecordsForSelectedCustomer;
+
+ if (current is null || hello is null)
+ return null;
+
+ var oids = new List();
+ foreach (var record in selected_records)
+ {
+ oids.Add(record.DataContract.ServiceRecordOid ?? -1);
+ }
+
+ var rtn = new Dictionary()
+ {
+ {TableID.Customer, new long[]{ hello.Customer.CustomerOid } },
+ {TableID.SupportConcept, new long[]{ hello.SupportConcept.SupportConceptOid } },
+ {TableID.CostBearer, new long[]{ hello.CostBearer.CostBearerOid ?? -1 } },
+ {TableID.ServiceRecord, oids.ToArray() }
+ };
+
+ return rtn;
}
//CB EINKOMMENTIEREN
@@ -349,11 +711,6 @@ namespace BeWo.ViewModel.ListViewModel
get { return BeWoApp.AppSettings.ShowHilfeplanStatistikReport && SelectedCustomerNode != null && SelectedCustomerNode.SupportConceptTreeNodeDC != null; }
}
- public bool OpenAiChatButtonVisible
- {
- get { return BeWoApp.AppSettings.ShowAI && (BeWoApp.LoggedOnUser.HasRight(UserRightType.AiChatInZeiterfassung)) && SelectedCustomerNode != null && SelectedCustomerNode.SupportConceptTreeNodeDC != null; }
- }
-
public ServiceRecordTimeInterval ServiceRecordTimeInterval
{
get { return _ServiceRecordTimeInterval; }
@@ -575,6 +932,42 @@ namespace BeWo.ViewModel.ListViewModel
private DateTime? enddate;
+ public void UndoAiAction()
+ {
+ if (_AiActionHistoryIndex <= 0)
+ return;
+
+ _AiActionHistoryIndex--;
+ AktuellerDokutext = _AiActionHistory[_AiActionHistoryIndex];
+ }
+
+ public void RedoAiAction()
+ {
+ if (_AiActionHistoryIndex >= _AiActionHistory.Count - 1)
+ return;
+
+ _AiActionHistoryIndex++;
+ AktuellerDokutext = _AiActionHistory[_AiActionHistoryIndex];
+ }
+
+ public void UndoEditAiAction()
+ {
+ if (_EditAiActionHistoryIndex <= 0)
+ return;
+
+ _EditAiActionHistoryIndex--;
+ AktuellerEditDokutext = _EditAiActionHistory[_EditAiActionHistoryIndex];
+ }
+
+ public void RedoEditAiAction()
+ {
+ if (_EditAiActionHistoryIndex >= _EditAiActionHistory.Count - 1)
+ return;
+
+ _EditAiActionHistoryIndex++;
+ AktuellerEditDokutext = _EditAiActionHistory[_EditAiActionHistoryIndex];
+ }
+
public List CreateFromPrototype()
{
var lResult = new List();
@@ -629,7 +1022,6 @@ namespace BeWo.ViewModel.ListViewModel
return lNewRecord;
}
-
public List GetAbsencesTimeForDate(SupportConceptCostBearerRelDC relDc, DateTime dt)
{
if (_CostBearer2SupportConceptOid2BookingInfoDict.ContainsKey(relDc.CostBearer2SupportConceptOid.Value))
@@ -677,6 +1069,7 @@ namespace BeWo.ViewModel.ListViewModel
lClickedNode.SupportConceptTreeNodeDC.CostBearer))
{
_SelectedCustomerNode = lClickedNode;
+ FirePropertyChanged(nameof(IsAiButtonVisible));
CustomerNodes.Clear();
if (lClickedNode != null)
@@ -1769,7 +2162,7 @@ namespace BeWo.ViewModel.ListViewModel
foreach (var goal in info.SupportConceptGoals)
{
goal.Prefix = info.CustomerName;
-
+
if (goal.ParentOid != null && goalCategoryDict.ContainsKey(goal.ParentOid.Value))
{
var path = GetAllParentGoalCategoies(goalCategoryDict, goal);
@@ -1919,31 +2312,5 @@ namespace BeWo.ViewModel.ListViewModel
return json;
}
-
- public Dictionary GetVisibleInformationReferences(IEnumerable selected_records)
- {
- var current = SelectedCustomerNode;
- var hello = current?.SupportConceptTreeNodeDC;
- var sr = ServiceRecordsForSelectedCustomer;
-
- if (current is null)
- return null;
-
- var oids = new List();
- foreach (var record in selected_records)
- {
- oids.Add(record.DataContract.ServiceRecordOid ?? -1);
- }
-
- var rtn = new Dictionary()
- {
- {TableID.Customer, new long[]{ hello.Customer.CustomerOid } },
- {TableID.SupportConcept, new long[]{ hello.SupportConcept.SupportConceptOid } },
- {TableID.CostBearer, new long[]{ hello.CostBearer.CostBearerOid ?? -1 } },
- {TableID.ServiceRecord, oids.ToArray() }
- };
-
- return rtn;
- }
}
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/OrganisationVM.cs b/BeWo/ViewModel/OrganisationVM.cs
index 5289a71a8..a7c82a2c4 100644
--- a/BeWo/ViewModel/OrganisationVM.cs
+++ b/BeWo/ViewModel/OrganisationVM.cs
@@ -10,6 +10,8 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
+using BS.Shared.Core.Rule;
+using BS.Shared.Core.Validation;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
@@ -713,8 +715,8 @@ namespace BeWo.ViewModel
}
public bool IsIKNumberValid
- => GkvValidator.IsIKNumberValid(IKKrankenkasse)
- && GkvValidator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
+ => GkvRules.IsIKNumberValid(IKKrankenkasse)
+ && GkvRules.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
public string IKKrankenkasse
{
diff --git a/BeWo/ViewModel/RatingTypeVM.cs b/BeWo/ViewModel/RatingTypeVM.cs
index cb9c0a6b0..47db2be5a 100644
--- a/BeWo/ViewModel/RatingTypeVM.cs
+++ b/BeWo/ViewModel/RatingTypeVM.cs
@@ -7,7 +7,6 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
namespace BeWo.ViewModel
diff --git a/BeWo/ViewModel/RatingVM.cs b/BeWo/ViewModel/RatingVM.cs
index b89d90e33..dacba4c13 100644
--- a/BeWo/ViewModel/RatingVM.cs
+++ b/BeWo/ViewModel/RatingVM.cs
@@ -7,7 +7,6 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
namespace BeWo.ViewModel
diff --git a/BeWo/ViewModel/ServiceAccountingVM.cs b/BeWo/ViewModel/ServiceAccountingVM.cs
index b3089f03a..aa6d92622 100644
--- a/BeWo/ViewModel/ServiceAccountingVM.cs
+++ b/BeWo/ViewModel/ServiceAccountingVM.cs
@@ -5,7 +5,6 @@ using BS.Shared;
using BeWo.Validation;
using BS.Shared.DataContracts;
-using BS.Shared.DataContracts.Compact;
namespace BeWo.ViewModel
{
diff --git a/BeWo/ViewModel/SupportConceptPeriodStatisticsVM.cs b/BeWo/ViewModel/SupportConceptPeriodStatisticsVM.cs
index cb2adbc9e..2eec2985f 100644
--- a/BeWo/ViewModel/SupportConceptPeriodStatisticsVM.cs
+++ b/BeWo/ViewModel/SupportConceptPeriodStatisticsVM.cs
@@ -8,7 +8,6 @@ using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.Core;
-using BS.Shared.DataContracts;
using BS.Shared.Extensions;
namespace BeWo.ViewModel
diff --git a/BeWo/ViewModel/UserGroupVM.cs b/BeWo/ViewModel/UserGroupVM.cs
index 943cc3acd..856a8861e 100644
--- a/BeWo/ViewModel/UserGroupVM.cs
+++ b/BeWo/ViewModel/UserGroupVM.cs
@@ -100,8 +100,9 @@ namespace BeWo.ViewModel
{IsUnterschriftRight, false},
{(r) => r == UserRightType.SupportConcept_ImportData, BeWoApp.AppSettings.ShowPersehImport},
{(r) => r == UserRightType.AiChatInZeiterfassung, BeWoApp.AppSettings.ShowAI},
- {IsAiModuleRight, BeWoApp.AppSettings.ModuleAiEnabled},
+ {IsAiModuleRight, BeWoApp.AppSettings.ModuleAiEnabled || BeWoApp.AppSettings.ShowAI},
{IsAiModuleSettingRight, BeWoApp.AppSettings.ModuleAiSettingsEnabled},
+ {(r) => r == UserRightType.AiVoiceView, BeWoApp.AppSettings.ShowAIVoice},
};
public List PossibleRights
@@ -244,7 +245,8 @@ namespace BeWo.ViewModel
|| userRightType == UserRightType.KalenderRessourcentermineAndererAendern
|| userRightType == UserRightType.KalenderRessourcentermineAnlegen
|| userRightType == UserRightType.KalenderRessourcentermineAnsehen
- || userRightType == UserRightType.KalenderInZeiterfassungUebernehmen)
+ || userRightType == UserRightType.KalenderInZeiterfassungUebernehmen
+ || userRightType == UserRightType.KalenderInAbwesenheitenUebernehmen)
{
return true;
}
@@ -286,7 +288,7 @@ namespace BeWo.ViewModel
return false;
}
private static bool IsAiModuleRight(UserRightType right) =>
- ContainsRight(right, UserRightType.AiModuleView, UserRightType.AiModuleView2, UserRightType.AiModuleChatAdd, UserRightType.AiModuleChatDelete, UserRightType.AiModuleChatEdit, UserRightType.AiModuleChatClone);
+ ContainsRight(right, UserRightType.AiModuleView, UserRightType.AiModuleChatAdd, UserRightType.AiModuleChatDelete, UserRightType.AiModuleChatEdit, UserRightType.AiModuleChatClone);
private static bool IsAiModuleSettingRight(UserRightType right) =>
ContainsRight(right, UserRightType.AiModuleViewSetting);
diff --git a/BeWo/ViewModel/VMFactory.cs b/BeWo/ViewModel/VMFactory.cs
index c9416675c..05fcc7955 100644
--- a/BeWo/ViewModel/VMFactory.cs
+++ b/BeWo/ViewModel/VMFactory.cs
@@ -6,909 +6,993 @@ using BeWo.Core.Service;
using BeWo.SchulbegleitenderDienst.ViewModel;
using BeWo.ServiceProxy;
using BeWo.ViewModel.ListViewModel;
-
+using BeWo.ViewModel.View.AI;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
+using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Extensions;
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,
- ValueListEntryType.EinkommenBeginnType,
- ValueListEntryType.EinkommenEndeType,
- ValueListEntryType.FremdHilfeType,
- ValueListEntryType.SozSchwierigkeitenType,
- ValueListEntryType.SozBeziehungenType,
- ValueListEntryType.ErstaufnahmeType,
- ValueListEntryType.RegionType,
- ValueListEntryType.VgAVerlauf
- };
-
- 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