Zwischenstand. Zeiterfassung sieht ganz hübsch aus

This commit is contained in:
2025-04-02 16:01:21 +02:00
parent 668085e25f
commit 8b61ac0fff
78 changed files with 1716 additions and 823 deletions

View File

@@ -1,18 +1,23 @@
<view:BeWoView x:Class="BeWo.AI.View.AiChatView" <view:BeWoView
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="BeWo.AI.View.AiChatView"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:view="clr-namespace:BeWo.View" xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:validation="clr-namespace:BeWo.Validation" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup" xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:validation="clr-namespace:BeWo.Validation"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" xmlns:view="clr-namespace:BeWo.View"
mc:Ignorable="d" VerticalAlignment="Stretch" Focusable="True"> Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True"
mc:Ignorable="d">
<view:BeWoView.Resources> <view:BeWoView.Resources>
<!--<Expander x:Name="ExpanderTemplate" IsExpanded="True"> <!--<Expander x:Name="ExpanderTemplate" IsExpanded="True">
<Expander.Header> <Expander.Header>
@@ -25,60 +30,120 @@
</Expander.Header> </Expander.Header>
</Expander>--> </Expander>-->
</view:BeWoView.Resources> </view:BeWoView.Resources>
<Grid Margin="0" Background="{DynamicResource ObjectEditBackgroundBrush}"> <Grid Margin="0" Background="{DynamicResource ObjectEditBackgroundBrush}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<dxlc:LayoutControl Orientation="Vertical" Padding="0"> <dxlc:LayoutControl Padding="0" Orientation="Vertical">
<dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True" Height="200"> <dxlc:LayoutGroup Height="200" dxlc:LayoutControl.AllowVerticalSizing="True">
<Grid Margin="5"> <Grid Margin="5">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto" />
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Button Grid.Row="0" Content="Einstellungen" HorizontalAlignment="Left" Click="btnSettings_Click"/> <Button
<Popup Grid.Row="0" Grid.RowSpan="3" StaysOpen="True" Placement="MousePoint" Width="400" Height="300" x:Name="PopupTemplate"> Grid.Row="0"
<Grid Background="{DynamicResource ObjectEditBackgroundBrush}" Margin="2,2,2,2"> HorizontalAlignment="Left"
Click="btnSettings_Click"
Content="Einstellungen" />
<Popup
x:Name="PopupTemplate"
Grid.Row="0"
Grid.RowSpan="3"
Width="400"
Height="300"
Placement="MousePoint"
StaysOpen="True">
<Grid Margin="2,2,2,2" Background="{DynamicResource ObjectEditBackgroundBrush}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto" />
<RowDefinition Height="*"/> <RowDefinition Height="*" />
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Content="{t:Translate Datensatz Template}"></Label> <Label Grid.Row="0" Content="{t:Translate Datensatz Template}" />
<TextBox x:Name="TextBoxTemplate" Grid.Row="1" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"></TextBox> <TextBox
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right"> x:Name="TextBoxTemplate"
<Button Grid.Row="2" Content="Übernehmen" Click="btnSaveSettings_Click" Margin="3"/> Grid.Row="1"
<Button Grid.Row="2" Content="Abbrechen" Click="btnCancelSettings_Click" Margin="3"/> MinHeight="60"
AcceptsReturn="True"
AcceptsTab="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" />
<StackPanel
Grid.Row="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Grid.Row="2"
Margin="3"
Click="btnSaveSettings_Click"
Content="Übernehmen" />
<Button
Grid.Row="2"
Margin="3"
Click="btnCancelSettings_Click"
Content="Abbrechen" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</Popup> </Popup>
<Label Grid.Row="1" Content="{t:Translate Formulieren Sie hier Ihre Anfrage}"></Label> <Label Grid.Row="1" Content="{t:Translate Formulieren Sie hier Ihre Anfrage}" />
<TextBox x:Name="TextBoxAnfrage" Grid.Row="2" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"></TextBox> <TextBox
x:Name="TextBoxAnfrage"
Grid.Row="2"
MinHeight="60"
AcceptsReturn="True"
AcceptsTab="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" />
</Grid> </Grid>
</dxlc:LayoutGroup> </dxlc:LayoutGroup>
<dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True"> <dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True">
<Grid Margin="5"> <Grid Margin="5">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="Auto" />
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Content="{t:Translate Ergebnis}"></Label> <Label Content="{t:Translate Ergebnis}" />
<TextBox x:Name="TextBoxErgebnis" Grid.Row="1" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" TextWrapping="Wrap" ></TextBox> <TextBox
x:Name="TextBoxErgebnis"
Grid.Row="1"
MinHeight="60"
AcceptsReturn="True"
AcceptsTab="True"
HorizontalScrollBarVisibility="Disabled"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" />
</Grid> </Grid>
</dxlc:LayoutGroup> </dxlc:LayoutGroup>
</dxlc:LayoutControl> </dxlc:LayoutControl>
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="5,10,10,10" HorizontalAlignment="Right"> <StackPanel
<Button x:Name="btnSend" Content="{t:Translate Absenden}" Margin="0,0,3,0" Height="25" Click="btnSend_Click"/> Grid.Row="1"
<Button x:Name="btnClose" Content=" Schließen " Margin="0,0,3,0" Height="25" Click="btnClose_Click"/> Height="Auto"
Margin="5,10,10,10"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnSend"
Height="25"
Margin="0,0,3,0"
Click="btnSend_Click"
Content="{t:Translate Absenden}" />
<Button
x:Name="btnClose"
Height="25"
Margin="0,0,3,0"
Click="btnClose_Click"
Content=" Schließen " />
</StackPanel> </StackPanel>
</Grid> </Grid>
</view:BeWoView> </view:BeWoView>

View File

@@ -1,14 +1,22 @@
<Page x:Class="BeWo.LockedPage" <Page
Title="LockedPage" x:Class="BeWo.LockedPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Width="Auto" Background="{StaticResource LoginBackground}" SnapsToDevicePixels="False" Focusable="True"> Title="LockedPage"
Width="Auto"
Background="{StaticResource LoginBackground}"
Focusable="True"
SnapsToDevicePixels="False"
mc:Ignorable="d">
<Page.Resources> <Page.Resources>
<Storyboard x:Key="OnLoaded1"> <Storyboard x:Key="OnLoaded1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="GridLogin" Storyboard.TargetProperty="(UIElement.Opacity)"> <DoubleAnimationUsingKeyFrames
BeginTime="00:00:00"
Storyboard.TargetName="GridLogin"
Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" /> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" /> <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" />
</DoubleAnimationUsingKeyFrames> </DoubleAnimationUsingKeyFrames>
@@ -21,7 +29,14 @@
</Page.Triggers> </Page.Triggers>
<Grid> <Grid>
<StackPanel HorizontalAlignment="Center"> <StackPanel HorizontalAlignment="Center">
<Grid Background="{x:Null}" Height="400" Width="600" Visibility="Visible" x:Name="GridLogin" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,0"> <Grid
x:Name="GridLogin"
Width="600"
Height="400"
Margin="0,0,0,0"
Background="{x:Null}"
RenderTransformOrigin="0.5,0.5"
Visibility="Visible">
<Grid.RenderTransform> <Grid.RenderTransform>
<TransformGroup> <TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" /> <ScaleTransform ScaleX="1" ScaleY="1" />
@@ -30,7 +45,12 @@
<TranslateTransform X="0" Y="0" /> <TranslateTransform X="0" Y="0" />
</TransformGroup> </TransformGroup>
</Grid.RenderTransform> </Grid.RenderTransform>
<Border CornerRadius="7,7,7,7" BorderThickness="2,2,2,2" Padding="5,5,5,5" BorderBrush="#FF606060" Background="{DynamicResource LoginBackgroundColor}"> <Border
Padding="5,5,5,5"
Background="{DynamicResource LoginBackgroundColor}"
BorderBrush="#FF606060"
BorderThickness="2,2,2,2"
CornerRadius="7,7,7,7">
<Grid Opacity="1"> <Grid Opacity="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="100" /> <ColumnDefinition Width="100" />
@@ -44,31 +64,142 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image Grid.Row="0" Grid.ColumnSpan="4" HorizontalAlignment="Left" VerticalAlignment="Top" Source="Ressources\Icons\bewoplaner_logo_small.png" Height="45" Margin="7,7,0,0"/> <Image
<Label VerticalAlignment="Top" HorizontalAlignment="Right" Content="Version x.x.x" Foreground="#FF818181" Margin="5,7,3,0" Grid.Row="0" Grid.ColumnSpan="4" Grid.Column="0" FontSize="10" x:Name="LblVersion" /> Grid.Row="0"
<StackPanel Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,100,0,0" MaxWidth="330"> Grid.ColumnSpan="4"
<Label x:Name="lblGesperrt" Content="Gesperrt" Foreground="#FF000000" FontSize="12" FontWeight="Bold" Margin="0,30,0,0" HorizontalAlignment="Center" /> Height="45"
<TextBlock Text="Bitte melden Sie sich an, um den BeWoPlaner zu entsperren." TextWrapping="Wrap" Foreground="#FF000000" FontSize="12" /> Margin="7,7,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="Ressources\Icons\bewoplaner_logo_small.png" />
<Label
x:Name="LblVersion"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
Margin="5,7,3,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="Version x.x.x"
FontSize="10"
Foreground="#FF818181" />
<StackPanel
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
MaxWidth="330"
Margin="0,100,0,0">
<Label
x:Name="lblGesperrt"
Margin="0,30,0,0"
HorizontalAlignment="Center"
Content="Gesperrt"
FontSize="12"
FontWeight="Bold"
Foreground="#FF000000" />
<TextBlock
FontSize="12"
Foreground="#FF000000"
Text="Bitte melden Sie sich an, um den BeWoPlaner zu entsperren."
TextWrapping="Wrap" />
</StackPanel> </StackPanel>
<Label Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Content="{markup:Translate Benutzername:}" Foreground="#FF000000" Background="#00000000" /> <Label
<Label Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Content="Passwort:" Foreground="#FF000000" Background="#00000000" /> Grid.Row="1"
<TextBox TabIndex="0" SnapsToDevicePixels="True" Grid.Column="2" Grid.Row="1" Margin="10,10,20,10" Height="24" x:Name="TextBoxUsername" HorizontalAlignment="Stretch" Text="" /> Grid.Column="1"
<PasswordBox Margin="10,0,20,0" Height="24" Grid.Column="2" Grid.Row="2" x:Name="PasswordBoxPassword" Password="" HorizontalAlignment="Stretch" TabIndex="1" /> HorizontalAlignment="Right"
<Button Margin="10,30,20,50" Height="30" x:Name="ButtonLogin" Grid.Column="2" Grid.Row="3" HorizontalAlignment="Stretch" Content="Anmelden" IsDefault="True" Foreground="White" TabIndex="2" /> VerticalAlignment="Center"
<Label VerticalAlignment="Bottom" HorizontalAlignment="Left" Content="Copyright 2010 | ownSoft GmbH" Foreground="#FF818181" Margin="5,0,0,3" Grid.Row="3" Grid.ColumnSpan="3" Grid.Column="0" FontSize="10" /> Background="#00000000"
<TextBlock Grid.Row="3" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="10" Margin="0,0,12,10"> Content="{markup:Translate Benutzername:}"
<Hyperlink TargetName="newWindow" Foreground="#FF818181" NavigateUri="https://www.ownsoft.de/">www.ownsoft.de</Hyperlink> Foreground="#FF000000" />
<Label
Grid.Row="2"
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="#00000000"
Content="Passwort:"
Foreground="#FF000000" />
<TextBox
x:Name="TextBoxUsername"
Grid.Row="1"
Grid.Column="2"
Height="24"
Margin="10,10,20,10"
HorizontalAlignment="Stretch"
SnapsToDevicePixels="True"
TabIndex="0"
Text="" />
<PasswordBox
x:Name="PasswordBoxPassword"
Grid.Row="2"
Grid.Column="2"
Height="24"
Margin="10,0,20,0"
HorizontalAlignment="Stretch"
Password=""
TabIndex="1" />
<Button
x:Name="ButtonLogin"
Grid.Row="3"
Grid.Column="2"
Height="30"
Margin="10,30,20,50"
HorizontalAlignment="Stretch"
Content="Anmelden"
Foreground="White"
IsDefault="True"
TabIndex="2" />
<Label
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="5,0,0,3"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="Copyright 2010 | ownSoft GmbH"
FontSize="10"
Foreground="#FF818181" />
<TextBlock
Grid.Row="3"
Grid.Column="3"
Margin="0,0,12,10"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
FontSize="10">
<Hyperlink
Foreground="#FF818181"
NavigateUri="https://www.ownsoft.de/"
TargetName="newWindow">
www.ownsoft.de
</Hyperlink>
</TextBlock> </TextBlock>
</Grid> </Grid>
</Border> </Border>
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="70" X2="585" Y2="70" StrokeThickness="1"></Line> <Line
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="370" X2="585" Y2="370" StrokeThickness="1"></Line> Grid.ColumnSpan="4"
Stroke="#FFADADAD"
StrokeThickness="1"
X1="14"
X2="585"
Y1="70"
Y2="70" />
<Line
Grid.ColumnSpan="4"
Stroke="#FFADADAD"
StrokeThickness="1"
X1="14"
X2="585"
Y1="370"
Y2="370" />
</Grid> </Grid>
<Rectangle Width="600" Height="400" RenderTransformOrigin="0.5,0.5"> <Rectangle
Width="600"
Height="400"
RenderTransformOrigin="0.5,0.5">
<Rectangle.OpacityMask> <Rectangle.OpacityMask>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0.418"> <LinearGradientBrush StartPoint="0.5,0.418" EndPoint="0.5,1">
<GradientStop Color="#00000000" Offset="0" /> <GradientStop Offset="0" Color="#00000000" />
<GradientStop Color="#4CFFFFFF" Offset="1" /> <GradientStop Offset="1" Color="#4CFFFFFF" />
</LinearGradientBrush> </LinearGradientBrush>
</Rectangle.OpacityMask> </Rectangle.OpacityMask>
<Rectangle.RenderTransform> <Rectangle.RenderTransform>

View File

@@ -1,6 +1,20 @@
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="BeWo.LogoPage" x:Name="Page" WindowTitle="Page" FlowDirection="LeftToRight" Width="640" Height="480" WindowWidth="640" WindowHeight="480" xmlns:BeWo="clr-namespace:BeWo"> <Page
x:Class="BeWo.LogoPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:BeWo="clr-namespace:BeWo"
x:Name="Page"
Width="640"
Height="480"
FlowDirection="LeftToRight"
WindowHeight="480"
WindowTitle="Page"
WindowWidth="640">
<Grid x:Name="LayoutRoot" Width="300" Height="300"> <Grid
<BeWo:BSLogoControl Width="400" Height="400" /> x:Name="LayoutRoot"
</Grid> Width="300"
Height="300">
<BeWo:BSLogoControl Width="400" Height="400" />
</Grid>
</Page> </Page>

View File

@@ -38,26 +38,26 @@ namespace BeWo
{ {
public enum UIContext public enum UIContext
{ {
SupportConcept, SupportConcept = 0,
Customer, Customer = 1,
Person, Person = 2,
Employee, Employee = 3,
Organisation, Organisation = 4,
Team, Team = 5,
Dokumente, Dokumente = 6,
User, User = 7,
UserGroup, UserGroup = 8,
Report, Report = 9,
Scheduler, Scheduler = 10,
Wohnheim, Wohnheim = 11,
Vertretungen, Vertretungen = 12,
CustomerTeam, CustomerTeam = 13,
Scheduling, Scheduling = 14,
Finance, Finance = 15,
Administration, Administration = 16,
AiConversation, AiConversation = 17,
AiConversationPopup, AiConversationPopup = 18,
ServiceRecord ServiceRecord = 19
} }
public partial class MainControl public partial class MainControl

View File

@@ -10,66 +10,28 @@
namespace BeWo.ServiceProxy namespace BeWo.ServiceProxy
{ {
using System.Runtime.Serialization;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="BeWo.ServiceProxy.IOperationsEnhancedService")] [System.ServiceModel.ServiceContractAttribute(ConfigurationName="BeWo.ServiceProxy.IOperationsEnhancedService")]
public interface IOperationsEnhancedService public interface IOperationsEnhancedService
{ {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/Method1", ReplyAction="http://tempuri.org/IOperationsEnhancedService/Method1Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/Method1BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiModelDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationMessageDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiSettingDC))]
object Method1(object input, object input2);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/Method2", ReplyAction="http://tempuri.org/IOperationsEnhancedService/Method2Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/Method2BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiModelDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationMessageDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiSettingDC))]
object Method2(object input, object input2);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/Method3", ReplyAction="http://tempuri.org/IOperationsEnhancedService/Method3Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/Method3BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiModelDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationMessageDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiSettingDC))]
object Method3(object input, object input2);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/Method4", ReplyAction="http://tempuri.org/IOperationsEnhancedService/Method4Response")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/Method4BeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFault))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BeWo.ServiceProxy.BeWoFaultType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiModelDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC>))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiConversationMessageDC))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BS.Shared.DataContracts.AiSettingDC))]
object Method4(object input, object input2);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/GetAiModels", ReplyAction="http://tempuri.org/IOperationsEnhancedService/GetAiModelsResponse")] [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/GetAiModels", ReplyAction="http://tempuri.org/IOperationsEnhancedService/GetAiModelsResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/GetAiModelsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/GetAiModelsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC> GetAiModels(); System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiModelDC> GetAiModels();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/GetAiConversations", ReplyAction="http://tempuri.org/IOperationsEnhancedService/GetAiConversationsResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/GetAiConversationsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiConversationDC> GetAiConversations(int uicontext);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/CreateAiConversation", ReplyAction="http://tempuri.org/IOperationsEnhancedService/CreateAiConversationResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/CreateAiConversationBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(int uicontext, long model, System.Collections.Generic.List<System.Tuple<long, long>> bewoobjects);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/SendNewMessage", ReplyAction="http://tempuri.org/IOperationsEnhancedService/SendNewMessageResponse")] [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsEnhancedService/SendNewMessage", ReplyAction="http://tempuri.org/IOperationsEnhancedService/SendNewMessageResponse")]
[System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/SendNewMessageBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsEnhancedService/SendNewMessageBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")]
BS.Shared.DataContracts.AiConversationMessageDC SendNewMessage(BS.Shared.DataContracts.AiConversationDC conversation, string context, string input); System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC> SendNewMessage(long conversation, string message);
} }
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@@ -106,34 +68,24 @@ namespace BeWo.ServiceProxy
{ {
} }
public object Method1(object input, object input2) public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiModelDC> GetAiModels()
{
return base.Channel.Method1(input, input2);
}
public object Method2(object input, object input2)
{
return base.Channel.Method2(input, input2);
}
public object Method3(object input, object input2)
{
return base.Channel.Method3(input, input2);
}
public object Method4(object input, object input2)
{
return base.Channel.Method4(input, input2);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.AiModelDC> GetAiModels()
{ {
return base.Channel.GetAiModels(); return base.Channel.GetAiModels();
} }
public BS.Shared.DataContracts.AiConversationMessageDC SendNewMessage(BS.Shared.DataContracts.AiConversationDC conversation, string context, string input) public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiConversationDC> GetAiConversations(int uicontext)
{ {
return base.Channel.SendNewMessage(conversation, context, input); return base.Channel.GetAiConversations(uicontext);
}
public BS.Shared.DataContracts.Feature.AI.AiConversationDC CreateAiConversation(int uicontext, long model, System.Collections.Generic.List<System.Tuple<long, long>> bewoobjects)
{
return base.Channel.CreateAiConversation(uicontext, model, bewoobjects);
}
public System.Collections.Generic.List<BS.Shared.DataContracts.AiConversationMessageDC> SendNewMessage(long conversation, string message)
{
return base.Channel.SendNewMessage(conversation, message);
} }
} }
} }

View File

@@ -1,23 +1,44 @@
<localView:BeWoView x:Class="BeWo.View.Detail.AbsenceReasonView" <localView:BeWoView
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="BeWo.View.Detail.AbsenceReasonView"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:val="clr-namespace:BeWo.Validation" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls" xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared" xmlns:localView="clr-namespace:BeWo.View"
xmlns:xtraEditors="clr-namespace:DevExpress.XtraEditors;assembly=DevExpress.XtraEditors.v23.2" xmlns:s="clr-namespace:System;assembly=mscorlib"
Height="Auto" Width="Auto" HorizontalAlignment="Stretch" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
VerticalAlignment="Stretch" Focusable="True"> xmlns:val="clr-namespace:BeWo.Validation"
<GroupBox Name="root" Header="Aktuell definierte Abwesenheitskategorien" Style="{StaticResource ObjectEditGroupBox}"> xmlns:xtraEditors="clr-namespace:DevExpress.XtraEditors;assembly=DevExpress.XtraEditors.v23.2"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True">
<GroupBox
Name="root"
Header="Aktuell definierte Abwesenheitskategorien"
Style="{StaticResource ObjectEditGroupBox}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.Resources> <Grid.Resources>
<DataTemplate x:Key="DropDownItemTemplate"> <DataTemplate x:Key="DropDownItemTemplate">
<Border Height="20" MinWidth="20" Background="{Binding}" BorderThickness="1" CornerRadius="2" HorizontalAlignment="Stretch" BorderBrush="Black" /> <Border
Height="20"
MinWidth="20"
HorizontalAlignment="Stretch"
Background="{Binding}"
BorderBrush="Black"
BorderThickness="1"
CornerRadius="2" />
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="SelectedItemTemplate"> <DataTemplate x:Key="SelectedItemTemplate">
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{Binding}" BorderBrush="Black" BorderThickness="1" /> <Border
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{Binding}"
BorderBrush="Black"
BorderThickness="1" />
</DataTemplate> </DataTemplate>
</Grid.Resources> </Grid.Resources>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -34,28 +55,72 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0">Bezeichnung</Label> <Label Grid.Row="0" Grid.Column="0">Bezeichnung</Label>
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23" <TextBox
Text="{val:ValidationBinding Path=NewVM.Description, UpdateSourceTrigger=PropertyChanged}" Width="125" /> Grid.Row="0"
<Label Grid.Column="2" Grid.Row="0">max. abrechenbare Stunden (pro Woche)</Label> Grid.Column="1"
Width="125"
<dxe:SpinEdit Name="spinedit_hours" AllowNullInput="True" IsFloatValue="False" MinValue="0" Grid.Column="3" Grid.Row="0" Height="23"
Height="23" Width="50" EditValue="{Binding Path=NewVM.Hours, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" /> Margin="3"
<Label Grid.Column="4" Grid.Row="0">Minuten</Label> Text="{val:ValidationBinding Path=NewVM.Description,
<dxe:SpinEdit Name="spinedit_minutes" AllowNullInput="True" IsFloatValue="False" Grid.Column="5" Grid.Row="0" UpdateSourceTrigger=PropertyChanged}" />
Height="23" Width="50" MinValue="0" <Label Grid.Row="0" Grid.Column="2">max. abrechenbare Stunden (pro Woche)</Label>
MaxValue="59"
EditValue="{Binding Path=NewVM.Minutes, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" /> <dxe:SpinEdit
<Button Name="button_addReason" Click="button_addReason_Click" Grid.Column="4" Grid.Row="1" Height="25" Name="spinedit_hours"
Margin="3" IsDefault="True" Grid.ColumnSpan="2" HorizontalAlignment="Right">Hinzufügen</Button> Grid.Row="0"
<Label Grid.Column="0" Grid.Row="1"> Grid.Column="3"
Width="50"
Height="23"
AllowNullInput="True"
EditValue="{Binding Path=NewVM.Hours, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
IsFloatValue="False"
MinValue="0" />
<Label Grid.Row="0" Grid.Column="4">Minuten</Label>
<dxe:SpinEdit
Name="spinedit_minutes"
Grid.Row="0"
Grid.Column="5"
Width="50"
Height="23"
AllowNullInput="True"
EditValue="{Binding Path=NewVM.Minutes, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}"
IsFloatValue="False"
MaxValue="59"
MinValue="0" />
<Button
Name="button_addReason"
Grid.Row="1"
Grid.Column="4"
Grid.ColumnSpan="2"
Height="25"
Margin="3"
HorizontalAlignment="Right"
Click="button_addReason_Click"
IsDefault="True">
Hinzufügen
</Button>
<Label Grid.Row="1" Grid.Column="0">
Farbe im Belegungsplan Farbe im Belegungsplan
</Label> </Label>
<ComboBox HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" SelectedItem="{val:ValidationBinding Path=NewVM.Brush}" Name="combobox_brush" Grid.Column="1" Grid.Row="1" Height="23" Margin="3" ItemsSource="{Binding Path=AllBrushes, Mode=OneWay}" Width="125"> <ComboBox
Name="combobox_brush"
Grid.Row="1"
Grid.Column="1"
Width="125"
Height="23"
Margin="3"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ItemsSource="{Binding Path=AllBrushes, Mode=OneWay}"
SelectedItem="{val:ValidationBinding Path=NewVM.Brush}">
<ComboBox.ItemsPanel> <ComboBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<UniformGrid Columns="12" Rows="12" IsItemsHost="True" /> <UniformGrid
Columns="12"
IsItemsHost="True"
Rows="12" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ComboBox.ItemsPanel> </ComboBox.ItemsPanel>
<ComboBox.ItemContainerStyle> <ComboBox.ItemContainerStyle>
@@ -65,57 +130,124 @@
</Style> </Style>
</ComboBox.ItemContainerStyle> </ComboBox.ItemContainerStyle>
</ComboBox> </ComboBox>
<StackPanel Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal"> <StackPanel
Grid.Row="1"
Grid.Column="2"
Grid.ColumnSpan="2"
Orientation="Horizontal">
<Label>Nur auswählbar für</Label> <Label>Nur auswählbar für</Label>
<ComboBox x:Name="combo_visibilitytype" <ComboBox
Grid.Column="3" Grid.Row="1" VerticalAlignment="Center" Margin="3,1,3,3" x:Name="combo_visibilitytype"
HorizontalAlignment="Stretch" Grid.Row="1"
ItemsSource="{x:Static core:EnumTranslations.AbsenceReasonVisibility2Translations}" Grid.Column="3"
SelectedValue="{Binding NewVM.Sichtbarkeit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="200"
SelectedValuePath="Key" Height="23"
DisplayMemberPath="Value" Margin="3,1,3,3"
Height="23" Width="200"/> HorizontalAlignment="Stretch"
VerticalAlignment="Center"
DisplayMemberPath="Value"
ItemsSource="{x:Static core:EnumTranslations.AbsenceReasonVisibility2Translations}"
SelectedValue="{Binding NewVM.Sichtbarkeit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Key" />
</StackPanel> </StackPanel>
<dxg:GridControl x:Name="datagrid_absencereasons" Margin="0,10,0,0" Grid.Column="0" Grid.Row="2" <dxg:GridControl
Grid.ColumnSpan="7" DataSource="{Binding VMList}"> x:Name="datagrid_absencereasons"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="7"
Margin="0,10,0,0"
DataSource="{Binding VMList}">
<dxg:GridControl.Columns> <dxg:GridControl.Columns>
<dxg:GridColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True"> <dxg:GridColumn
Width="24"
FieldName="IsDeleteable"
FixedWidth="True"
Header=""
ReadOnly="True">
<dxg:GridColumn.CellTemplate> <dxg:GridColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<Button Content="r" <Button
Visibility="{Binding Path=EditValue, Converter={StaticResource BoolVisibilityConverter}}" Width="18"
FontFamily="Webdings" Click="DeleteButton_Click" Width="18" Height="18" Height="18"
VerticalAlignment="Center" /> VerticalAlignment="Center"
Click="DeleteButton_Click"
Content="r"
FontFamily="Webdings"
Visibility="{Binding Path=EditValue, Converter={StaticResource BoolVisibilityConverter}}" />
</DataTemplate> </DataTemplate>
</dxg:GridColumn.CellTemplate> </dxg:GridColumn.CellTemplate>
</dxg:GridColumn> </dxg:GridColumn>
<dxg:GridColumn FieldName="Description" Header="Bezeichnung" Width="180" /> <dxg:GridColumn
<dxg:GridColumn FieldName="Hours" Header="max. abrechenbare Stunden" Width="180" /> Width="180"
<dxg:GridColumn FieldName="Minutes" Header="Minuten" Width="180" /> FieldName="Description"
<dxg:GridColumn x:Name="column_visibility" FieldName="Sichtbarkeit" Header="Nur auswählbar für" Width="150" /> Header="Bezeichnung" />
<dxg:GridColumn x:Name="column_Color" FieldName="Brush" Header="Farbe" Width="70"> <dxg:GridColumn
<dxg:GridColumn.DisplayTemplate> Width="180"
<ControlTemplate> FieldName="Hours"
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{Binding Value, diagnostics:PresentationTraceSources.TraceLevel=High }" BorderBrush="Black" BorderThickness="1" /> Header="max. abrechenbare Stunden" />
</ControlTemplate> <dxg:GridColumn
</dxg:GridColumn.DisplayTemplate> Width="180"
<dxg:GridColumn.EditTemplate> FieldName="Minutes"
<ControlTemplate> Header="Minuten" />
<Button x:Name="PART_Editor" BorderThickness="0" Style="{x:Null}" Background="{Binding EditValue}" Foreground="{Binding EditValue}" Height="21" HorizontalAlignment="Stretch" Click="button_select_color_Click"></Button> <dxg:GridColumn
</ControlTemplate> x:Name="column_visibility"
</dxg:GridColumn.EditTemplate> Width="150"
</dxg:GridColumn> FieldName="Sichtbarkeit"
Header="Nur auswählbar für" />
<dxg:GridColumn
x:Name="column_Color"
Width="70"
FieldName="Brush"
Header="Farbe">
<dxg:GridColumn.DisplayTemplate>
<ControlTemplate>
<Border
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{Binding Value, diagnostics:PresentationTraceSources.TraceLevel=High}"
BorderBrush="Black"
BorderThickness="1" />
</ControlTemplate>
</dxg:GridColumn.DisplayTemplate>
<dxg:GridColumn.EditTemplate>
<ControlTemplate>
<Button
x:Name="PART_Editor"
Height="21"
HorizontalAlignment="Stretch"
Background="{Binding EditValue}"
BorderThickness="0"
Click="button_select_color_Click"
Foreground="{Binding EditValue}"
Style="{x:Null}" />
</ControlTemplate>
</dxg:GridColumn.EditTemplate>
</dxg:GridColumn>
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" <dxg:TableView
NavigationStyle="Cell" /> AutoWidth="true"
NavigationStyle="Cell"
ShowGroupPanel="False"
ShowGroupedColumns="false"
ShowTotalSummary="False" />
</dxg:GridControl.View> </dxg:GridControl.View>
</dxg:GridControl> </dxg:GridControl>
<Popup x:Name="popup_color" StaysOpen="false" Placement="MousePoint"> <Popup
<ListBox x:Name="listbox_colorpicker" BorderThickness="0" Loaded="colorEditor_Loaded" SelectionChanged="listbox_colorpicker_SelectionChanged"> x:Name="popup_color"
Placement="MousePoint"
StaysOpen="false">
<ListBox
x:Name="listbox_colorpicker"
BorderThickness="0"
Loaded="colorEditor_Loaded"
SelectionChanged="listbox_colorpicker_SelectionChanged">
<ListBox.ItemsPanel> <ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<UniformGrid Columns="12" Rows="12" IsItemsHost="True" /> <UniformGrid
Columns="12"
IsItemsHost="True"
Rows="12" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ListBox.ItemsPanel> </ListBox.ItemsPanel>
<ListBox.ItemContainerStyle> <ListBox.ItemContainerStyle>

View File

@@ -59,7 +59,7 @@
Width="36" Width="36"
Height="24" Height="24"
Margin="5,-5,0,0" Margin="5,-5,0,0"
Command="{Binding ReloadModelsCommand, RelativeSource={RelativeSource AncestorType={x:Type localView:BeWoView}, Mode=FindAncestor}}" Command="{Binding ReloadConversationsCommand, RelativeSource={RelativeSource AncestorType={x:Type localView:BeWoView}, Mode=FindAncestor}}"
ToolTip="Liste aktualisieren"> ToolTip="Liste aktualisieren">
<Button.Template> <Button.Template>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">

View File

@@ -29,17 +29,13 @@ namespace BeWo.View.Detail
InitializeComponent(); InitializeComponent();
OpenAiSettingCommand = new DelegateCommand(OpenAiSetting); OpenAiSettingCommand = new DelegateCommand(OpenAiSetting);
ReloadConversationsCommand = new DelegateCommand(ReloadConversations);
ReloadModelsCommand = new DelegateCommand(ReloadModels); ReloadModelsCommand = new DelegateCommand(ReloadModels);
} }
public AiConversationChatView(object o) : this() public AiConversationChatView(object o) : this()
{ {
}
public AiConversationChatView(string context) : this()
{
ViewModel.ContextInput = context;
} }
public AiConversationListVM ViewModel public AiConversationListVM ViewModel
@@ -49,16 +45,32 @@ namespace BeWo.View.Detail
} }
public DelegateCommand OpenAiSettingCommand { get; set; } public DelegateCommand OpenAiSettingCommand { get; set; }
public DelegateCommand ReloadConversationsCommand { get; set; }
public DelegateCommand ReloadModelsCommand { get; set; } public DelegateCommand ReloadModelsCommand { get; set; }
private void BeWoView_Loaded(object sender, RoutedEventArgs e) private void BeWoView_Loaded(object sender, RoutedEventArgs e)
{ {
ReloadModels(); ReloadModels();
ReloadConversations();
//if (Dispatcher.CheckAccess())
//{
// ReloadModels();
// ReloadConversations();
//}
//else
//{
// Dispatcher.BeginInvoke(new Action(() =>
// {
// ReloadModels();
// ReloadConversations();
// }));
//}
} }
private void ReloadButton_OnClick(object sender, RoutedEventArgs e) private void ReloadButton_OnClick(object sender, RoutedEventArgs e)
{ {
ReloadModels(); ReloadConversations();
} }
private void OpenAiSetting() private void OpenAiSetting()
@@ -81,5 +93,16 @@ namespace BeWo.View.Detail
}, true, this); }, true, this);
} }
private void ReloadConversations()
{
var ui_context = ViewModel.UIContext;
ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.GetAiConversations(ui_context), (x) =>
{
var vms = new AiConversationListVM(x);
ViewModel.VMList.MakeEqualTo(vms.VMList);
}, true);
}
} }
} }

View File

@@ -5074,13 +5074,16 @@ namespace BeWo.View.Detail.Zeiterfassung
{ {
var records = GetVisibleRecordVMs(); var records = GetVisibleRecordVMs();
var context_str = ViewModel.GetVisibleInformationString(records); var context = ViewModel.GetVisibleInformationReferences(records);
var control = new AiConversationChatView(context_str); var control = new AiConversationChatView();
control.ViewModel.UIContext = (int)(UIContext.ServiceRecord);
control.ViewModel.ContextBeWoObjects = context;
var window = BeWoWindowBuilder.GetBeWoWindow("Ai Chat", control, 800, 1200); var window = BeWoWindowBuilder.GetBeWoWindow("Ai Chat", control, 800, 1200);
window.ShowDialog(); window.Show();
} }
private IEnumerable<ServiceRecordVM> GetVisibleRecordVMs() private IEnumerable<ServiceRecordVM> GetVisibleRecordVMs()
{ {

View File

@@ -9,13 +9,7 @@ namespace BeWo.ViewModel
[JsonObject(MemberSerialization.OptIn)] [JsonObject(MemberSerialization.OptIn)]
public class AiConversationMessageVM : AbstractDCMapperVM<AiConversationMessageDC> public class AiConversationMessageVM : AbstractDCMapperVM<AiConversationMessageDC>
{ {
private string _ApiMethods; private string _Message;
private string _Context;
private string _Context2;
private string _Prompt;
private string _Model;
private string _Result;
private DateTime _TimeStamp;
public AiConversationMessageVM(AiConversationMessageDC dc) : base(dc, dc.Oid is null) public AiConversationMessageVM(AiConversationMessageDC dc) : base(dc, dc.Oid is null)
{ {
@@ -27,129 +21,35 @@ namespace BeWo.ViewModel
get => JsonConvert.SerializeObject(this, Formatting.Indented); get => JsonConvert.SerializeObject(this, Formatting.Indented);
} }
[JsonProperty(Order = 4)] [JsonProperty(Order = 1)]
public string ApiMethods public string Message
{ {
get { return _ApiMethods; } get { return _Message; }
set set
{ {
if (!AreDifferent(ApiMethods, value)) if (!AreDifferent(Message, value))
return; return;
_ApiMethods = value; _Message = value;
StoreDirtyInformation(AreDifferent(DataContract.ApiMethods, value), nameof(ApiMethods)); StoreDirtyInformation(AreDifferent(DataContract.Message, value), nameof(Message));
FirePropertyChanged(nameof(ApiMethods)); FirePropertyChanged(nameof(Message));
}
}
[JsonProperty(Order = 3)]
public string Context
{
get { return _Context; }
set
{
if (!AreDifferent(_Context, value))
return;
_Context = value;
StoreDirtyInformation(AreDifferent(DataContract.Context, value), nameof(Context));
FirePropertyChanged(nameof(Context));
}
}
[JsonProperty(Order = 5)]
public string Context2
{
get { return _Context2; }
set
{
if (!AreDifferent(_Context2, value))
return;
_Context2 = value;
StoreDirtyInformation(AreDifferent(DataContract.Context2, value), nameof(Context2));
FirePropertyChanged(nameof(Context2));
} }
} }
[JsonProperty(Order = 2)] [JsonProperty(Order = 2)]
public string Prompt public string Role => DataContract.Role.ToString();
{
get { return _Prompt; }
set
{
if (!AreDifferent(_Prompt, value))
return;
_Prompt = value; [JsonProperty(Order = 3)]
StoreDirtyInformation(AreDifferent(DataContract.Prompt, value), nameof(Prompt)); public string Time => DataContract.Created.ToString();
FirePropertyChanged(nameof(Prompt));
}
}
[JsonProperty(Order = 1)]
public string Model
{
get { return _Model; }
set
{
if (!AreDifferent(_Model, value))
return;
_Model = value;
StoreDirtyInformation(AreDifferent(DataContract.Model, value), nameof(Model));
FirePropertyChanged(nameof(Model));
}
}
[JsonProperty(Order = 6)]
public string Result
{
get { return _Result; }
set
{
if (!AreDifferent(_Result, value))
return;
_Result = value;
StoreDirtyInformation(AreDifferent(DataContract.Result, value), nameof(Result));
FirePropertyChanged(nameof(Result));
}
}
[JsonProperty(Order = 7)]
public DateTime TimeStamp
{
get { return _TimeStamp; }
set
{
if (!AreDifferent(_TimeStamp, value))
return;
_TimeStamp = value;
StoreDirtyInformation(AreDifferent(DataContract.TimeStamp, value), nameof(TimeStamp));
FirePropertyChanged(nameof(TimeStamp));
}
}
protected override void InitByDataContract(AiConversationMessageDC pDataContract) protected override void InitByDataContract(AiConversationMessageDC pDataContract)
{ {
_Context = pDataContract.Context; _Message = pDataContract.Message;
_Prompt = pDataContract.Prompt;
_Model = pDataContract.Model;
_Result = pDataContract.Result;
_TimeStamp = pDataContract.TimeStamp;
_Context2 = pDataContract.Context2;
_ApiMethods = pDataContract.ApiMethods;
} }
protected override AiConversationMessageDC MapToDataContract(AiConversationMessageDC pDataContract, bool doCommit) protected override AiConversationMessageDC MapToDataContract(AiConversationMessageDC pDataContract, bool doCommit)
{ {
pDataContract.Context = _Context; pDataContract.Message = _Message;
pDataContract.Prompt = _Prompt;
pDataContract.Model = _Model;
pDataContract.Result = _Result;
pDataContract.TimeStamp = _TimeStamp;
return pDataContract; return pDataContract;
} }

View File

@@ -2,9 +2,11 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Runtime.Serialization;
using BeWo.ViewModel.ListViewModel; using BeWo.ViewModel.ListViewModel;
using BS.Shared; using BS.Shared;
using BS.Shared.DataContracts; using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace BeWo.ViewModel namespace BeWo.ViewModel
@@ -13,11 +15,7 @@ namespace BeWo.ViewModel
public class AiConversationVM : AbstractDCMapperVM<AiConversationDC> public class AiConversationVM : AbstractDCMapperVM<AiConversationDC>
{ {
private string _Displayname; private string _Displayname;
private DateTime _Created; private DateTime _Updated;
private string _Modell;
private string _View;
private string _Context;
private AiSettingDC _Setting;
private AiConversationMessageListVM _Messages; private AiConversationMessageListVM _Messages;
public AiConversationVM() : this(new AiConversationDC()) { } public AiConversationVM() : this(new AiConversationDC()) { }
@@ -48,74 +46,17 @@ namespace BeWo.ViewModel
} }
[JsonProperty] [JsonProperty]
public DateTime Created public DateTime Updated
{ {
get { return _Created; } get { return _Updated; }
set set
{ {
if (!AreDifferent(_Created, value)) if (!AreDifferent(Updated, value))
return; return;
_Created = value; _Updated = value;
StoreDirtyInformation(AreDifferent(DataContract.Created, value), nameof(Created)); StoreDirtyInformation(AreDifferent(DataContract.Updated, value), nameof(Updated));
FirePropertyChanged(nameof(Created)); FirePropertyChanged(nameof(Updated));
}
}
[JsonProperty]
public string Modell
{
get { return _Modell; }
set
{
if (!AreDifferent(_Modell, value))
return;
_Modell = value;
StoreDirtyInformation(AreDifferent(DataContract.Modell, value), nameof(Modell));
FirePropertyChanged(nameof(Modell));
}
}
public string View
{
get { return _View; }
set
{
if (!AreDifferent(_View, value))
return;
_View = value;
StoreDirtyInformation(AreDifferent(DataContract.View, value), nameof(View));
FirePropertyChanged(nameof(View));
}
}
public string Context
{
get { return _Context; }
set
{
if (!AreDifferent(Context, value))
return;
_Context = value;
StoreDirtyInformation(AreDifferent(DataContract.Context, value), nameof(Context));
FirePropertyChanged(nameof(Context));
}
}
public AiSettingDC Setting
{
get { return _Setting; }
set
{
if (!AreDifferent(_Setting, value))
return;
_Setting = value;
StoreDirtyInformation(AreDifferent(DataContract.Setting, value), nameof(Setting));
FirePropertyChanged(nameof(Setting));
} }
} }
@@ -133,13 +74,16 @@ namespace BeWo.ViewModel
} }
} }
[JsonProperty]
public DateTime Created => DataContract.Created;
[JsonProperty]
public AiModelDC Modell => DataContract.Modell;
protected override void InitByDataContract(AiConversationDC pDataContract) protected override void InitByDataContract(AiConversationDC pDataContract)
{ {
_Displayname = pDataContract.Displayname; _Displayname = pDataContract.Displayname;
_Created = pDataContract.Created; _Updated = pDataContract.Updated;
_Modell = pDataContract.Modell;
_View = pDataContract.View;
_Setting = pDataContract.Setting;
if (pDataContract.Messages is object) if (pDataContract.Messages is object)
_Messages = new AiConversationMessageListVM(pDataContract.Messages); _Messages = new AiConversationMessageListVM(pDataContract.Messages);
@@ -148,10 +92,7 @@ namespace BeWo.ViewModel
protected override AiConversationDC MapToDataContract(AiConversationDC pDataContract, bool doCommit) protected override AiConversationDC MapToDataContract(AiConversationDC pDataContract, bool doCommit)
{ {
pDataContract.Displayname = _Displayname; pDataContract.Displayname = _Displayname;
pDataContract.Created = _Created; pDataContract.Updated = _Updated;
pDataContract.Modell = _Modell;
pDataContract.View = _View;
pDataContract.Setting = _Setting;
pDataContract.Messages = _Messages?.CopyToDCList(doCommit); pDataContract.Messages = _Messages?.CopyToDCList(doCommit);
return pDataContract; return pDataContract;

View File

@@ -1,5 +1,6 @@
using BeWo.ServiceProxy; using BeWo.ServiceProxy;
using BS.Shared.DataContracts; using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Extensions; using BS.Shared.Extensions;
using ChatController.Utilities.Extensions; using ChatController.Utilities.Extensions;
using DevExpress.Mvvm; using DevExpress.Mvvm;
@@ -11,6 +12,7 @@ using System.Linq;
using System.Runtime.Remoting.Contexts; using System.Runtime.Remoting.Contexts;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Markup;
using System.Windows.Threading; using System.Windows.Threading;
namespace BeWo.ViewModel.ListViewModel namespace BeWo.ViewModel.ListViewModel
@@ -24,20 +26,7 @@ namespace BeWo.ViewModel.ListViewModel
public AiConversationListVM() : this(null) public AiConversationListVM() : this(null)
{ {
//VMList.Add(new AiConversationVM()
//{
// Created = DateTime.Now,
// Displayname = "Chat1",
// Messages = new AiConversationMessageListVM(new List<AiConversationMessageDC>()
// {
// new AiConversationMessageDC() {
// Context = "context",
// Model = "model",
// Oid = 1,
// Prompt = "prompt",
// Result = "result" }
// })
//});
} }
public AiConversationListVM(List<AiConversationDC> pDCs) : base(pDCs) public AiConversationListVM(List<AiConversationDC> pDCs) : base(pDCs)
{ {
@@ -64,6 +53,7 @@ namespace BeWo.ViewModel.ListViewModel
FirePropertyChanged(nameof(SelectedModel)); FirePropertyChanged(nameof(SelectedModel));
} }
} }
public string MessageInput public string MessageInput
{ {
get { return _MessageInput; } get { return _MessageInput; }
@@ -90,66 +80,79 @@ namespace BeWo.ViewModel.ListViewModel
} }
} }
public void SendNewMessage() public int UIContext{ get; set; }
{ public List<Tuple<long, long>> ContextBeWoObjects { get; set; }
var msg = MessageInput;
var context = ContextInput;
ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(SelectedVM.CommitToDataContract(), context, msg), (message) =>
{
SelectedVM.Messages.VMList.Add(new AiConversationMessageVM(message));
});
}
public void RequestNewConversation() public void RequestNewConversation()
{ {
var dc = new AiConversationDC(); ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.CreateAiConversation(UIContext, SelectedModel.Oid.Value, ContextBeWoObjects), dc => {
var vm = new AiConversationVM(dc);
VMList.Insert(0, vm);
}, true, null);
}
dc.Created = DateTime.Now; public void SendNewMessage()
dc.Displayname = "Example"; {
dc.Modell = SelectedModel?.ToString(); var conv = SelectedVM;
var vm = new AiConversationVM(dc); var msg_dc = new AiConversationMessageDC();
VMList.Add(vm); msg_dc.Message = MessageInput;
msg_dc.Role = BS.Shared.AiConversationMessageRole.User;
msg_dc.Created = DateTime.Now;
var msg_vm = new AiConversationMessageVM(msg_dc);
conv.Messages.VMList.Add(msg_vm);
ServiceFacade.DoOperationsEnhancedServiceAsnyc(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]));
});
} }
public void Test() public void Test()
{ {
var limit = 5; throw new NotImplementedException();
var models = ServiceFacade.DoOperationsEnhancedServiceSnyc(x => x.GetAiModels()); //var limit = 5;
Models.MakeEqualTo(models);
VMList.Clear(); //var models = ServiceFacade.DoOperationsEnhancedServiceSnyc(x => x.GetAiModels());
//Models.MakeEqualTo(models);
foreach (var vm in Models) //VMList.Clear();
{
var dc = new AiConversationDC();
dc.Created = DateTime.Now; //foreach (var vm in Models)
dc.Displayname = "Example"; //{
dc.Modell = vm.ToString(); // var dc = new AiConversationDC();
var pvm = new AiConversationVM(dc); // dc.Created = DateTime.Now;
// dc.Displayname = "Example";
// dc.Modell = vm.ToString();
VMList.Add(pvm); // var pvm = new AiConversationVM(dc);
}
var msg = "Wie alt ist Frau Müller?"; // VMList.Add(pvm);
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++) //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();
foreach (var vm in VMList)
{ //for (var i = 0; i < limit; i++)
ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(vm.CommitToDataContract(), context, msg), (message) => //{
{ // foreach (var vm in VMList)
vm.Messages.VMList.Add(new AiConversationMessageVM(message)); // {
}); // ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(vm.CommitToDataContract(), context, msg), (message) =>
} // {
} // vm.Messages.VMList.Add(new AiConversationMessageVM(message));
// });
// }
//}
} }
private bool CanSendNewMessage() private bool CanSendNewMessage()

View File

@@ -1917,5 +1917,28 @@ namespace BeWo.ViewModel.ListViewModel
return json; return json;
} }
public List<Tuple<long, long>> GetVisibleInformationReferences(IEnumerable<ServiceRecordVM> selected_records)
{
var current = SelectedCustomerNode;
var hello = current?.SupportConceptTreeNodeDC;
var sr = ServiceRecordsForSelectedCustomer;
if (current is null)
return null;
var rtn = new List<Tuple<long, long>>();
rtn.Add(new Tuple<long, long>(hello.Customer.CustomerOid, (long)TableID.Customer));
rtn.Add(new Tuple<long, long>(hello.SupportConcept.SupportConceptOid, (long)TableID.SupportConcept));
rtn.Add(new Tuple<long, long>(hello.CostBearer.CostBearerOid ?? -1, (long)TableID.CostBearer));
foreach (var record in selected_records)
{
rtn.Add(new Tuple<long, long>(record.DataContract.ServiceRecordOid ?? -1, (long)TableID.ServiceRecord));
}
return rtn;
}
} }
} }

View File

@@ -124,6 +124,11 @@ namespace BeWo.Data.Access
return this.Session.Get<T>(pOid); return this.Session.Get<T>(pOid);
} }
public virtual List<T> GetByIDs<T>(IEnumerable<long> pOids) where T : BeWoEntityBase, new()
{
return pOids.Select(oid => this.GetByID<T>(oid)).ToList();
}
public virtual IList<T> GetActiveByIDs<T>(IEnumerable<long> pOids) where T : BeWoEntityBase, new() public virtual IList<T> GetActiveByIDs<T>(IEnumerable<long> pOids) where T : BeWoEntityBase, new()
{ {
return CreateCriteria<T>().Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active)).Add(Restrictions.In(BeWoEntityBase.PropertyName_Oid, pOids.ToArray())).List<T>(); return CreateCriteria<T>().Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active)).Add(Restrictions.In(BeWoEntityBase.PropertyName_Oid, pOids.ToArray())).List<T>();

View File

@@ -217,7 +217,12 @@
<Compile Include="Access\UserDAO.cs" /> <Compile Include="Access\UserDAO.cs" />
<Compile Include="ASPHibernateSessionManager.cs" /> <Compile Include="ASPHibernateSessionManager.cs" />
<Compile Include="DefaultHibernateSessionManager.cs" /> <Compile Include="DefaultHibernateSessionManager.cs" />
<Compile Include="Entities\AiConversation.cs" />
<Compile Include="Entities\AiConversationMessage.cs" />
<Compile Include="Entities\AiModel.cs" />
<Compile Include="Entities\AiSetting.cs" />
<Compile Include="Entities\AiSettings.cs" /> <Compile Include="Entities\AiSettings.cs" />
<Compile Include="Entities\BeWoEntityReference.cs" />
<Compile Include="Entities\CustomerVermittlungArbeit.cs" /> <Compile Include="Entities\CustomerVermittlungArbeit.cs" />
<Compile Include="Entities\CustomerWohnhilfe.cs" /> <Compile Include="Entities\CustomerWohnhilfe.cs" />
<Compile Include="Entities\TwoFactorCode.cs" /> <Compile Include="Entities\TwoFactorCode.cs" />
@@ -792,6 +797,11 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Mappings\TwoFactorCode.hbm.xml" /> <EmbeddedResource Include="Mappings\TwoFactorCode.hbm.xml" />
<EmbeddedResource Include="Mappings\AiSettings.hbm.xml" /> <EmbeddedResource Include="Mappings\AiSettings.hbm.xml" />
<EmbeddedResource Include="Mappings\AiConversation.hbm.xml">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Mappings\AiConversationMessage.hbm.xml" />
<EmbeddedResource Include="Mappings\AiModel.hbm.xml" />
<Content Include="Mappings\Timesheet2Mail.hbm.xml" /> <Content Include="Mappings\Timesheet2Mail.hbm.xml" />
<EmbeddedResource Include="Mappings\ContactHistory.hbm.xml"> <EmbeddedResource Include="Mappings\ContactHistory.hbm.xml">
<SubType>Designer</SubType> <SubType>Designer</SubType>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts;
using Newtonsoft.Json;
namespace BeWo.Data.Entities
{
public class AiConversation : BeWoEntityBase
{
public AiConversation()
{
_Tid = TableID.AiConversation;
}
public virtual string Displayname { get; set; }
public virtual DateTime Created { get; set; }
public virtual DateTime Updated { get; set; }
public virtual AiModel Modell { get; set; }
public virtual string Context { get; set; }
public virtual IList<BeWoEntityReference> ContextBeWoObjects { get; set; }
public virtual int UIContext { get; set; }
public virtual IList<AiConversationMessage> Messages { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.Core;
namespace BeWo.Data.Entities
{
public class AiConversationMessage : BeWoEntityBase
{
public AiConversationMessage()
{
_Tid = TableID.AiConversationMessage;
}
public virtual string Message { get; set; }
public virtual AiConversationMessageRole Role { get; set; }
public virtual DateTime Created { get; set; }
public virtual AiConversation AiConversation { get; set; }
}
}

19
Data/Entities/AiModel.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using BS.Shared;
using BS.Shared.Core;
namespace BeWo.Data.Entities
{
public class AiModel : BeWoEntityBase
{
public AiModel()
{
_Tid = TableID.AiModel;
}
public virtual string ModelName { get; set; }
public virtual int Value { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Data.Entities
{
internal class AiSetting
{
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Data.Entities
{
public class BeWoEntityReference
{
public virtual long Oid { get; set; }
public virtual long Tid { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.AiConversation,BeWo.Data" table="AiConversation">
<id name="Oid" column ="Oid" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property name="InsTs"/>
<property name="InsUser"/>
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property name="UdpUser"/>
<property name="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" />
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
<property name="Notice"/>
<property name="Displayname"/>
<property name="Created"/>
<property name="Updated"/>
<property name="Context"/>
<property name="UIContext"/>
<many-to-one name="Modell"
column="Model"
not-null="true"
class="BeWo.Data.Entities.AiModel,BeWo.Data"/>
<bag name="ContextBeWoObjects" table="aiconversation2bewoobject" cascade="all">
<key>
<column name="AiConversationOid" not-null="true"/>
</key>
<composite-element class="BeWo.Data.Entities.BeWoEntityReference,BeWo.Data">
<property name="Oid" column="BeWoObjectOid" type="long"/>
<property name="Tid" column="BeWoObjectTid" type="long"/>
</composite-element>
</bag>
<bag name="Messages" cascade="all">
<key column="AiConversationOid" not-null="true"/>
<one-to-many class="BeWo.Data.Entities.AiConversationMessage, BeWo.Data"/>
</bag>
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.AiConversationMessage,BeWo.Data" table="AiConversationMessage">
<id name="Oid" column ="Oid" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property name="InsTs"/>
<property name="InsUser"/>
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property name="UdpUser"/>
<property name="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" />
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
<property name="Notice"/>
<property name="Message"/>
<property name="Role" type="BS.Shared.AiConversationMessageRole, BS.Shared"/>
<property name="Created"/>
<many-to-one name="AiConversation"
column="AiConversationOid"
not-null="true"/>
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.AiModel,BeWo.Data" table="AiModel">
<id name="Oid" column ="Oid" unsaved-value="null">
<generator class="identity" />
</id>
<version type="Int64" column="Version" name="Version" />
<property name="InsTs"/>
<property name="InsUser"/>
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
<property name="UdpUser"/>
<property name="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" />
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
<property name="Notice"/>
<property name="ModelName"/>
<property name="Value"/>
</class>
</hibernate-mapping>

View File

@@ -260,9 +260,9 @@
<appSettings> <appSettings>
<add key="AdminServiceIPAddress" value="::1" /> <add key="AdminServiceIPAddress" value="::1" />
<add key="AdminServiceIPAddress2" value="::1" /> <add key="AdminServiceIPAddress2" value="::1" />
<add key="AdminServiceAPIKey" value="HasteGedachteWa" /> <add key="AdminServiceAPIKey" value="HasteGedachteWa" />
<add key="AdminServiceEnableStackTrace" value="true" /> <add key="AdminServiceEnableStackTrace" value="true" />
<add key="SendMailOnError" value="false" /> <add key="SendMailOnError" value="false" />
<add key="SmptServer" value="mail.ownsoft.de" /> <add key="SmptServer" value="mail.ownsoft.de" />
<add key="SmtpUser" value="bewoplaner.support@ownsoft.de" /> <add key="SmtpUser" value="bewoplaner.support@ownsoft.de" />
@@ -281,13 +281,13 @@
<add key="MaxDocumentSize" value="20971520" /> <add key="MaxDocumentSize" value="20971520" />
<add key="ICD10File" value="ICD10\icd10.xml" /> <add key="ICD10File" value="ICD10\icd10.xml" />
<add key="FileRootDirectory" value="\BWP-Files" /> <add key="FileRootDirectory" value="\BWP-Files" />
<add key="GoogleDistanceMatrixApiUrl" value="https://maps.googleapis.com/maps/api/distancematrix/json" /> <add key="GoogleDistanceMatrixApiUrl" value="https://maps.googleapis.com/maps/api/distancematrix/json" />
<add key="GoogleDistanceMatrixApiKey" value="AIzaSyDZ_tfNwm_YWC9JiCLQtHsd9X2OUUKuL0c" /> <add key="GoogleDistanceMatrixApiKey" value="AIzaSyDZ_tfNwm_YWC9JiCLQtHsd9X2OUUKuL0c" />
<add key="OpenrouteServiceApiUrl" value="https://api.openrouteservice.org/v2/matrix/driving-car" /> <add key="OpenrouteServiceApiUrl" value="https://api.openrouteservice.org/v2/matrix/driving-car" />
<add key="OpenrouteServiceApiUrlGeocode" value="https://api.openrouteservice.org/geocode/search" /> <add key="OpenrouteServiceApiUrlGeocode" value="https://api.openrouteservice.org/geocode/search" />
<add key="OpenrouteServiceApiKey" value="5b3ce3597851110001cf62484b0917529e9a4008acda819dc06e47e8" /> <add key="OpenrouteServiceApiKey" value="5b3ce3597851110001cf62484b0917529e9a4008acda819dc06e47e8" />
<add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" /> <add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" />
<add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" /> <add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" />
<add key="GkvKostentragerdateiFolderPath" value="C:\GkvAbrechnung\KTDatei\" /> <add key="GkvKostentragerdateiFolderPath" value="C:\GkvAbrechnung\KTDatei\" />
@@ -302,6 +302,9 @@
<add key="SendMailModuleGkvSmtpPassword" value="JJVjJntw2yaRDAxInotF" /> <add key="SendMailModuleGkvSmtpPassword" value="JJVjJntw2yaRDAxInotF" />
<add key="SendMailModuleGkvSender" value="noreply@bewoplaner.de" /> <add key="SendMailModuleGkvSender" value="noreply@bewoplaner.de" />
<add key="SendMailModuleGkvReceiver" value="dakota.exchange@ownsoft.de" /> <add key="SendMailModuleGkvReceiver" value="dakota.exchange@ownsoft.de" />
<add key="OpenWebUIUrl" value="http://ai1.ownsoft.de:8080/"/>
<add key="OpenWebUIKey" value="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjMyNzJlZjc5LWRmZjEtNDdjYS05NWNlLWZhNjk1ZDdjZGQ4NCJ9.xImpkx6GYE1pSKpIDIzBtXwZXjNnrvXf-5L5qZ1_pRg"/>
</appSettings> </appSettings>
<!-- <> <> <> Appsettings <> <> <> --> <!-- <> <> <> Appsettings <> <> <> -->
<devExpress> <devExpress>

View File

@@ -0,0 +1,60 @@
CREATE TABLE `AiModel` (
`Oid` bigint NOT NULL AUTO_INCREMENT,
`InsTs` datetime DEFAULT NULL,
`InsUser` varchar(256) DEFAULT NULL,
`Notice` varchar(1024) DEFAULT NULL,
`Tid` int DEFAULT NULL,
`UdpUser` varchar(256) DEFAULT NULL,
`Version` bigint DEFAULT NULL,
`IsActive` tinyint DEFAULT NULL,
`SystemEntryID` int DEFAULT NULL,
`ModelName` varchar(256),
`Value` int,
PRIMARY KEY (`Oid`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE TABLE `AiConversation` (
`Oid` bigint NOT NULL AUTO_INCREMENT,
`InsTs` datetime DEFAULT NULL,
`InsUser` varchar(256) DEFAULT NULL,
`Notice` varchar(1024) DEFAULT NULL,
`Tid` int DEFAULT NULL,
`UdpUser` varchar(256) DEFAULT NULL,
`Version` bigint DEFAULT NULL,
`IsActive` tinyint DEFAULT NULL,
`SystemEntryID` int DEFAULT NULL,
`Displayname` varchar(256),
`Created` datetime,
`Updated` datetime,
`Modell` bigint NOT NULL,
`Context` varchar(256),
`UIContext` int,
PRIMARY KEY (`Oid`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE TABLE `AiConversationMessage` (
`Oid` bigint NOT NULL AUTO_INCREMENT,
`InsTs` datetime DEFAULT NULL,
`InsUser` varchar(256) DEFAULT NULL,
`Notice` varchar(1024) DEFAULT NULL,
`Tid` int DEFAULT NULL,
`UdpUser` varchar(256) DEFAULT NULL,
`Version` bigint DEFAULT NULL,
`IsActive` tinyint DEFAULT NULL,
`SystemEntryID` int DEFAULT NULL,
`AiConversationOid` bigint NOT NULL,
`Message` varchar(256),
`Role` int,
`Created` datetime,
PRIMARY KEY (`Oid`),
KEY `AICONV_FK` (`AiConversationOid`),
CONSTRAINT `FK_AICONVERSATION_OID` FOREIGN KEY (`AiConversationOid`) REFERENCES `aiconversation` (`Oid`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE Table `AiConversation2BeWoObject` (
`AiConversationOid` bigint,
`BeWoObjectOid` bigint,
`BeWoObjectTid` bigint,
PRIMARY KEY (`AiConversationOid`, `BeWoObjectOid`, `BeWoObjectTid`),
CONSTRAINT `FK_AICONVERSATION2_OID` FOREIGN KEY (`AiConversationOid`) REFERENCES `aiconversation` (`Oid`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
namespace BeWo.Service.DCEntityMapper
{
public class AiConversationDC_AiConversation : AbstractIDCEntityMapper<AiConversation, AiConversationDC>
{
public override AiConversationDC MergeWithDC(AiConversation pEntity, AiConversationDC pDataContract)
{
pDataContract.Oid = pEntity.Oid;
pDataContract.Version = pEntity.Version;
pDataContract.Notice = pEntity.Notice;
pDataContract.Displayname = pEntity.Displayname;
pDataContract.Created = pEntity.Created;
pDataContract.Updated = pEntity.Updated;
pDataContract.Context = pEntity.Context;
pDataContract.ContextBeWoObjects = pEntity.ContextBeWoObjects?.Select(x => new Tuple<long, long>(x.Oid, x.Tid)).ToList();
pDataContract.UIContext = pEntity.UIContext;
if (pEntity.Messages is IList<AiConversationMessage> list && list.Any())
pDataContract.Messages = MapperFactory.AiConversationMessage.MapToNewDCs(list);
if (pEntity.Modell is AiModel model)
pDataContract.Modell = MapperFactory.AiModel.MapToNewDC(model);
return pDataContract;
}
public override AiConversation MergeWithEntity(AiConversationDC pDataContract, AiConversation pEntity)
{
ConcurrencyCheck(pDataContract.Version, pEntity);
//pEntity.Oid = pDataContract.Oid;
//pEntity.Version = pDataContract.Version;
pEntity.Notice = pDataContract.Notice;
pEntity.Displayname = pDataContract.Displayname;
pEntity.Created = pDataContract.Created;
pEntity.Updated = pDataContract.Updated;
pEntity.Context = pDataContract.Context;
pEntity.ContextBeWoObjects = pDataContract.ContextBeWoObjects?.Select(x => new BeWoEntityReference() { Oid = x.Item1, Tid = x.Item2}).ToList();
pEntity.UIContext = pDataContract.UIContext;
MapperFactory.AiConversationMessage.MergeWithEntitys(pDataContract.Messages, pEntity.Messages);
if (pDataContract.Modell?.Oid is long oid)
pEntity.Modell = DAOFactory.GenericDAO.LoadByID<AiModel>(oid);
return pEntity;
}
protected override bool AreDCAndEntityEqual(AiConversationDC pDC, AiConversation pEntity)
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -0,0 +1,46 @@
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
namespace BeWo.Service.DCEntityMapper
{
public class AiConversationMessageDC_AiConversationMessage : AbstractIDCEntityMapper<AiConversationMessage, AiConversationMessageDC>
{
public override AiConversationMessageDC MergeWithDC(AiConversationMessage pEntity, AiConversationMessageDC pDataContract)
{
pDataContract.Oid = pEntity.Oid;
pDataContract.Version = pEntity.Version;
pDataContract.Notice = pEntity.Notice;
pDataContract.Message = pEntity.Message;
pDataContract.Role = pEntity.Role;
pDataContract.Created = pEntity.Created;
return pDataContract;
}
public override AiConversationMessage MergeWithEntity(AiConversationMessageDC pDataContract, AiConversationMessage pEntity)
{
ConcurrencyCheck(pDataContract.Version, pEntity);
pEntity.Oid = pDataContract.Oid;
pEntity.Version = pDataContract.Version;
pEntity.Notice = pDataContract.Notice;
pEntity.Message = pDataContract.Message;
pEntity.Role = pDataContract.Role;
pEntity.Created = pDataContract.Created;
return pEntity;
}
protected override bool AreDCAndEntityEqual(AiConversationMessageDC pDC, AiConversationMessage pEntity)
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -0,0 +1,45 @@
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
namespace BeWo.Service.DCEntityMapper
{
public class AiModelDC_AiModel : AbstractIDCEntityMapper<AiModel, AiModelDC>
{
public override AiModelDC MergeWithDC(AiModel pEntity, AiModelDC pDataContract)
{
pDataContract.Oid = pEntity.Oid;
pDataContract.Version = pEntity.Version;
pDataContract.Notice = pEntity.Notice;
pDataContract.ModelName = pEntity.ModelName;
pDataContract.Value = pEntity.Value;
return pDataContract;
}
public override AiModel MergeWithEntity(AiModelDC pDataContract, AiModel pEntity)
{
ConcurrencyCheck(pDataContract.Version, pEntity);
pEntity.Oid = pDataContract.Oid;
pEntity.Version = pDataContract.Version;
pEntity.Notice = pDataContract.Notice;
pEntity.ModelName = pDataContract.ModelName;
pEntity.Value = pDataContract.Value;
return pEntity;
}
protected override bool AreDCAndEntityEqual(AiModelDC pDC, AiModel pEntity)
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -27,7 +27,7 @@ namespace BeWo.Service.DCEntityMapper
to.IsSchedulerAllowed = from.IsSchedulerAllowed; to.IsSchedulerAllowed = from.IsSchedulerAllowed;
to.IsMedicationAllowed = from.IsMedicationAllowed; to.IsMedicationAllowed = from.IsMedicationAllowed;
to.BankAccount = MapperFactory.BankAccountDC_BankAccount.MapToNewDC(from.BankAccount, false); to.BankAccount = MapperFactory.BankAccount.MapToNewDC(from.BankAccount, false);
to.AllowSbd = !string.IsNullOrEmpty(to.ClientId) && to.ClientId == "SBD"; to.AllowSbd = !string.IsNullOrEmpty(to.ClientId) && to.ClientId == "SBD";
@@ -76,7 +76,7 @@ namespace BeWo.Service.DCEntityMapper
// HACK: BankAccount ist neu, alte Clients: from.BankAccount null // HACK: BankAccount ist neu, alte Clients: from.BankAccount null
if (from.BankAccount is object) if (from.BankAccount is object)
{ {
to.BankAccount = MapperFactory.BankAccountDC_BankAccount.MergeWithEntity(from.BankAccount, to.BankAccount, false); to.BankAccount = MapperFactory.BankAccount.MergeWithEntity(from.BankAccount, to.BankAccount, false);
to.SoziotherapieAnsprechpartner = MapperFactory.CompactEmployeeDC_Employee.MergeWithEntity(from.SoziotherapieAnsprechpartner, to.SoziotherapieAnsprechpartner, false); to.SoziotherapieAnsprechpartner = MapperFactory.CompactEmployeeDC_Employee.MergeWithEntity(from.SoziotherapieAnsprechpartner, to.SoziotherapieAnsprechpartner, false);
to.Logo = MapperFactory.ImageDC_Image.MergeWithEntity(from.Logo, to.Logo, false); to.Logo = MapperFactory.ImageDC_Image.MergeWithEntity(from.Logo, to.Logo, false);

View File

@@ -784,7 +784,14 @@ namespace BeWo.Service.DCEntityMapper
public static CompactGkvAbrechnungDC_GkvAbrechnung CompactGkvAbrechnungDC_GkvAbrechnung => public static CompactGkvAbrechnungDC_GkvAbrechnung CompactGkvAbrechnungDC_GkvAbrechnung =>
_CompactGkvAbrechnungDC_GkvAbrechnung ?? (_CompactGkvAbrechnungDC_GkvAbrechnung = new CompactGkvAbrechnungDC_GkvAbrechnung()); _CompactGkvAbrechnungDC_GkvAbrechnung ?? (_CompactGkvAbrechnungDC_GkvAbrechnung = new CompactGkvAbrechnungDC_GkvAbrechnung());
public static BankAccountDC_BankAccount BankAccountDC_BankAccount { get; }
= new BankAccountDC_BankAccount(); // Neuer Style
} // - Kürzere Namen -> Länge reduzieren
// - Einfaches Init -> Bei Bedarf erweitern
public static BankAccountDC_BankAccount BankAccount { get; } = new BankAccountDC_BankAccount();
public static AiConversationDC_AiConversation AiConversation { get; } = new AiConversationDC_AiConversation();
public static AiConversationMessageDC_AiConversationMessage AiConversationMessage { get; } = new AiConversationMessageDC_AiConversationMessage();
public static AiModelDC_AiModel AiModel { get; } = new AiModelDC_AiModel();
}
} }

View File

@@ -235,6 +235,9 @@
<Compile Include="Core\Utils.cs" /> <Compile Include="Core\Utils.cs" />
<Compile Include="DCEntityMapper\AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint.cs" /> <Compile Include="DCEntityMapper\AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint.cs" />
<Compile Include="DCEntityMapper\AddressRouteDC_AddressRoute.cs" /> <Compile Include="DCEntityMapper\AddressRouteDC_AddressRoute.cs" />
<Compile Include="DCEntityMapper\AiConversationMessageDC_AiConversationMessage.cs" />
<Compile Include="DCEntityMapper\AiConversationDC_AiConversation.cs" />
<Compile Include="DCEntityMapper\AiModelDC_AiModel.cs" />
<Compile Include="DCEntityMapper\BankAccountDC_BankAccount.cs" /> <Compile Include="DCEntityMapper\BankAccountDC_BankAccount.cs" />
<Compile Include="DCEntityMapper\BargeldtransaktionshistoryDC_Bargeldtransaktionshistory.cs" /> <Compile Include="DCEntityMapper\BargeldtransaktionshistoryDC_Bargeldtransaktionshistory.cs" />
<Compile Include="DCEntityMapper\CompactGkvAbrechnungDC_GkvAbrechnung.cs" /> <Compile Include="DCEntityMapper\CompactGkvAbrechnungDC_GkvAbrechnung.cs" />
@@ -538,7 +541,8 @@
<Compile Include="ServiceImplementations\UserServiceImp.cs" /> <Compile Include="ServiceImplementations\UserServiceImp.cs" />
<Compile Include="ServiceImplementations\ValueListServiceImp.cs" /> <Compile Include="ServiceImplementations\ValueListServiceImp.cs" />
<Compile Include="Configuration\AppSettings.cs" /> <Compile Include="Configuration\AppSettings.cs" />
<Compile Include="ServiceProxy\MikePHPScriptFacade.cs" /> <Compile Include="ServiceProxy\OpenWebUIFacade.cs" />
<Compile Include="ServiceUtils\AiSystemBuilder.cs" />
<Compile Include="ServiceUtils\DistanceCalculator\AddressRouteManager.cs" /> <Compile Include="ServiceUtils\DistanceCalculator\AddressRouteManager.cs" />
<Compile Include="ServiceUtils\DistanceCalculator\AddressRouteMatrix.cs" /> <Compile Include="ServiceUtils\DistanceCalculator\AddressRouteMatrix.cs" />
<Compile Include="ServiceUtils\DistanceCalculator\GoogleDistanceMatrixAPI.cs" /> <Compile Include="ServiceUtils\DistanceCalculator\GoogleDistanceMatrixAPI.cs" />
@@ -601,11 +605,14 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="AI\system_prompt.txt" /> <EmbeddedResource Include="AI\system_prompt1.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="AI\system_prompt2.txt" /> <EmbeddedResource Include="AI\system_prompt2.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AI\system_prompt3.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1,4 +1,7 @@
using BS.Shared.DataContracts; using BeWo.Data.Entities;
using BS.Shared.Attributes;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -13,26 +16,22 @@ namespace BeWo.Service.ServiceContracts
{ {
[FaultContract(typeof(BeWoFault))] [FaultContract(typeof(BeWoFault))]
[OperationContract] [OperationContract]
object Method1(object input, object input2); [RequirePermission(BS.Shared.UserRightType.AiModuleView)]
IEnumerable<AiModelDC> GetAiModels();
[FaultContract(typeof(BeWoFault))] [FaultContract(typeof(BeWoFault))]
[OperationContract] [OperationContract]
object Method2(object input, object input2); [RequirePermission(BS.Shared.UserRightType.AiModuleView)]
IEnumerable<AiConversationDC> GetAiConversations(int uicontext);
[FaultContract(typeof(BeWoFault))] [FaultContract(typeof(BeWoFault))]
[OperationContract] [OperationContract]
object Method3(object input, object input2); [RequirePermission(BS.Shared.UserRightType.AiModuleView)]
AiConversationDC CreateAiConversation(int uicontext, long model, List<Tuple<long, long>> bewoobjects);
[FaultContract(typeof(BeWoFault))] [FaultContract(typeof(BeWoFault))]
[OperationContract] [OperationContract]
object Method4(object input, object input2); [RequirePermission(BS.Shared.UserRightType.AiModuleView)]
AiConversationMessageDC[] SendNewMessage(long conversation, string message);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<AiModelDC> GetAiModels();
[FaultContract(typeof(BeWoFault))]
[OperationContract]
AiConversationMessageDC SendNewMessage(AiConversationDC conversation, string context, string input);
} }
} }

View File

@@ -1,9 +1,13 @@
using BeWo.Data.Access; using BeWo.Data.Access;
using BeWo.Data.Entities; using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceContracts; using BeWo.Service.ServiceContracts;
using BeWo.Service.ServiceProxy; using BeWo.Service.ServiceProxy;
using BeWo.Service.ServiceUtils;
using BS.Shared.DataContracts; using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts.MikePHPContracts; using BS.Shared.DataContracts.MikePHPContracts;
using DevExpress.Entity.Model.Metadata;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -17,111 +21,114 @@ namespace BeWo.Service.ServiceImplementations
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
public class OperationsEnhancedServiceImp : IOperationsEnhancedService public class OperationsEnhancedServiceImp : IOperationsEnhancedService
{ {
public object Method1(object input, object input2) public IEnumerable<AiModelDC> GetAiModels()
{ {
if (input is int i) var old_models = DAOFactory.GenericDAO.GetAll<AiModel>();
var new_models = ServiceFacade.OpenWebUI.GetAiModelle();
var unknown_models = new_models.ToList();
foreach (var old_model in old_models)
{ {
if (i == 1) bool found = false;
foreach (var new_model in new_models)
{ {
return new AiSettingDC(); if(old_model.ModelName == new_model.ModelName)
{
if (old_model.IsActive != BS.Shared.ActivationTypeId.Active)
DAOFactory.GenericDAO.SetActivationType(old_model, BS.Shared.ActivationTypeId.Active);
found = true;
unknown_models.Remove(new_model);
break;
}
} }
if (i == 2)
if (!found)
DAOFactory.GenericDAO.Deactivate(old_model);
}
if (unknown_models.Count != 0)
{
foreach (var unknown_model in unknown_models)
{ {
return new List<AiConversationDC>(); DAOFactory.GenericDAO.Insert(unknown_model);
}
if (i == 3)
{
return ServiceFacade.MikePHPScriptFacade.GetAiModelle();
} }
} }
throw new NotImplementedException(); var models = DAOFactory.GenericDAO.GetAllActive<AiModel>();
return MapperFactory.AiModel.MapToNewDCs(models);
} }
public object Method2(object input, object input2) public IEnumerable<AiConversationDC> GetAiConversations(int uicontext)
{ {
throw new NotImplementedException(); // SearchDAO
var convs = DAOFactory.GenericDAO.GetAll<AiConversation>();
var filter = convs.Where(x => x.UIContext == uicontext);
var dcs = MapperFactory.AiConversation.MapToNewDCs(filter);
return dcs;
} }
public object Method3(object input, object input2) public AiConversationDC CreateAiConversation(int uicontext, long model, List<Tuple<long, long>> bewoobjects)
{ {
throw new NotImplementedException(); var system = AiSystemBuilder.CreateSystemInstructions(uicontext, bewoobjects);
}
public object Method4(object input, object input2) var conv = new AiConversation();
{ conv.Created = DateTime.Now;
throw new NotImplementedException(); conv.ContextBeWoObjects = bewoobjects?.Select(x => new BeWoEntityReference() { Oid = x.Item1, Tid = x.Item2}).ToList();
} conv.Messages = new List<AiConversationMessage>();
conv.Modell = DAOFactory.GenericDAO.LoadByID<AiModel>(model);
conv.UIContext = uicontext;
conv.Updated = DateTime.Now;
public List<AiModelDC> GetAiModels() var msg = new AiConversationMessage();
{ msg.Message = system;
return ServiceFacade.MikePHPScriptFacade.GetAiModelle(); msg.AiConversation = conv;
} msg.Role = BS.Shared.AiConversationMessageRole.System;
msg.Created = DateTime.Now;
public AiConversationMessageDC SendNewMessage(AiConversationDC conversation, string context, string input) conv.Messages.Add(msg);
{
var model = conversation.Modell;
var dc = new AiConversationMessageDC(); DAOFactory.GenericDAO.Insert(conv);
dc.Context = context; var dc = MapperFactory.AiConversation.MapToNewDC(conv);
dc.Prompt = input;
dc.Model = model;
dc.TimeStamp = DateTime.Now;
var result = ServiceFacade.MikePHPScriptFacade.SendAiRequestComplex(dc);
dc.Result = result.Response;
return dc; return dc;
}
//var test = result.GetResponseData(); public AiConversationMessageDC[] SendNewMessage(long conversation, string message)
{
var conv = DAOFactory.GenericDAO.LoadByID<AiConversation>(conversation);
//var req = new AiMessageRequest2(); var user_msg = new AiConversationMessage();
user_msg.Message = message;
user_msg.AiConversation = conv;
user_msg.Role = BS.Shared.AiConversationMessageRole.User;
user_msg.Created = DateTime.Now;
//req.ApiData = new List<AiMessageRequestData>(); conv.Messages.Add(user_msg);
//foreach (var endpoint in test.Endpoints) { DAOFactory.GenericDAO.Update(conv);
// if (string.IsNullOrEmpty(endpoint))
// continue;
// List<string> data = new List<string>(); var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv);
// if(endpoint == "get_klienten") var user_msg_dc = MapperFactory.AiConversationMessage.MapToNewDC(user_msg);
// {
// var dat = new CustomerServiceImp().GetAllCompactCustomers();
// data = dat.Select(JsonConvert.SerializeObject).ToList();
// }
// else if (endpoint == "get_mitarbeiter")
// {
// var dat = new EmployeeServiceImp().GetAllCompactEmployees();
// data = dat.Select(JsonConvert.SerializeObject).ToList();
// }
// else if (endpoint == "get_personen")
// {
// var dat = new CustomerServiceImp().GetAllActivePersonsCompact();
// data = dat.Select(JsonConvert.SerializeObject).ToList();
// }
// else if (endpoint == "get_arbeitsverträge")
// {
// throw new Exception();
// }
// if (data.Count > 0) var result = ServiceFacade.OpenWebUI.SendAiMessageRequest(conv_dc);
// {
// req.ApiData.Add(new AiMessageRequestData() { Data = data, Name = endpoint });
// }
//}
//dc.ApiMethods = string.Join(",", req.ApiData.Select(x => x.Name)); var assi_msg = new AiConversationMessage();
assi_msg.Message = result;
assi_msg.AiConversation = conv;
assi_msg.Role = BS.Shared.AiConversationMessageRole.Assistent;
assi_msg.Created = DateTime.Now;
//var input2 = JsonConvert.SerializeObject(req); conv.Messages.Add(assi_msg);
//var result1 = ServiceFacade.MikePHPScriptFacade.SendAiRequest(dc, input2); DAOFactory.GenericDAO.Update(conv);
var assi_msg_dc = MapperFactory.AiConversationMessage.MapToNewDC(assi_msg);
//dc.Result = result1.Response;
//return dc; return new AiConversationMessageDC[] { user_msg_dc, assi_msg_dc };
} }
} }
} }

View File

@@ -1,105 +0,0 @@
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.MikePHPContracts;
using DevExpress.DataAccess.Native.EntityFramework;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Service.ServiceProxy
{
public class MikePHPScriptFacade : WebClientFacade
{
public List<AiModelDC> GetAiModelle()
{
var url = "https://ai1.ownsoft.de/osaimodels.php?show";
var dictList = SendGet<List<Dictionary<string, int>>>(url);
var rtn = new List<AiModelDC>();
foreach (var item in dictList)
{
foreach (var kvp in item)
{
rtn.Add(new AiModelDC(kvp.Key, kvp.Value));
}
}
return rtn;
}
public AiMessageResponse SendAiRequest(AiConversationMessageDC msg, string api_data)
{
var url = "https://ai1.ownsoft.de/osaiquery.php";
msg.Context2 = getSystemPrompt2() + api_data;
var request = new AiMessageRequest()
{
Context = msg.Context2,
Model = msg.Model,
Option = "json",
Prompt = msg.Prompt
};
var result = SendPost<AiMessageRequest, AiMessageResponse>(url, request);
return result;
}
public AiMessageResponse2 SendAiRequestComplex(AiConversationMessageDC msg)
{
var url = "https://ai1.ownsoft.de/osaiquery.php";
msg.Context = getSystemPrompt2() + msg.Context;
var request = new AiMessageRequest()
{
Context = msg.Context,
Model = msg.Model,
Option = "json",
Prompt = msg.Prompt
};
var result = SendPost<AiMessageRequest, AiMessageResponse2>(url, request);
return result;
}
private string getSystemPrompt()
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "BeWo.Service.AI.system_prompt.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
return result;
}
return null;
}
private string getSystemPrompt2()
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "BeWo.Service.AI.system_prompt2.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
return result;
}
return null;
}
}
}

View File

@@ -0,0 +1,103 @@
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.DataContracts.MikePHPContracts;
using DevExpress.DataAccess.Native.EntityFramework;
using Newtonsoft.Json;
using NHibernate.SqlTypes;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace BeWo.Service.ServiceProxy
{
public class OpenWebUIFacade : WebClientFacade
{
public IEnumerable<AiModel> GetAiModelle()
{
var key = getKey();
var sub_url = "api/models";
var dictList = SendGet<Dictionary<string, List<AiModelDC>>>(sub_url, key);
if (dictList.TryGetValue("data", out var models))
return MapperFactory.AiModel.MapToNewEntities(models);
return null;
}
public string SendAiMessageRequest(AiConversationDC conversation)
{
var key = getKey();
var sub_url = "api/chat/completions";
var payload = new
{
model = conversation.Modell.ModelName,
messages = conversation.Messages.Select(m => new { role = m.Role.ToString().ToLower(), content = m.Message })
};
//var requestData = JsonConvert.SerializeObject(payload);
var response = SendPostUploadString<object, string>(sub_url, payload, key);
var response_format = new
{
id = string.Empty,
model = string.Empty,
choices = new[]
{
new
{
index = 0,
message = new
{
content = string.Empty,
role = string.Empty
}
}
}
};
var json = JsonConvert.DeserializeAnonymousType(response, response_format);
foreach (var choice in json.choices)
{
if (choice?.message is object && !string.IsNullOrEmpty(choice.message.content))
return choice.message.content;
}
return "Keine Antwort";
}
protected override string getUrl()
{
var url = ConfigurationManager.AppSettings["OpenWebUIUrl"];
if (string.IsNullOrEmpty(url))
throw new InvalidOperationException("OpenWebUIUrl is missing");
return url;
}
protected override string getKey()
{
var key = ConfigurationManager.AppSettings["OpenWebUIKey"];
if (string.IsNullOrEmpty(key))
throw new InvalidOperationException("OpenWebUIKey is missing");
return key;
}
}
}

View File

@@ -8,8 +8,8 @@ namespace BeWo.Service.ServiceProxy
{ {
public static class ServiceFacade public static class ServiceFacade
{ {
private static readonly Lazy<MikePHPScriptFacade> _MikePHPScriptFacade = new Lazy<MikePHPScriptFacade>(() => new MikePHPScriptFacade()); private static readonly Lazy<OpenWebUIFacade> _OpenWebUIFacade = new Lazy<OpenWebUIFacade>(() => new OpenWebUIFacade());
public static MikePHPScriptFacade MikePHPScriptFacade => _MikePHPScriptFacade.Value; public static OpenWebUIFacade OpenWebUI => _OpenWebUIFacade.Value;
} }
} }

View File

@@ -0,0 +1,205 @@
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using DevExpress.PivotGrid.OLAP.Mdx;
using DevExpress.XtraRichEdit.Commands;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace BeWo.Service.ServiceUtils
{
public static class AiSystemBuilder
{
public static string CreateSystemInstructions(int uicontext, List<Tuple<long, long>> bewoobjects)
{
var system_prompt = getSystemPrompt(2);
string data = string.Empty;
switch (uicontext)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
break;
case 12:
break;
case 13:
break;
case 14:
break;
case 15:
break;
case 16:
break;
case 17:
break;
case 18:
break;
// Service Record
case 19:
data = createServiceRecordContext(bewoobjects);
break;
default:
throw new NotImplementedException("UI Context unknown");
}
var result = system_prompt + data;
var escape = HttpUtility.JavaScriptStringEncode(result);
return escape;
}
private static string createServiceRecordContext(List<Tuple<long, long>> bewoobjects)
{
if (bewoobjects is null || !bewoobjects.Any())
return null;
// Sortiere Liste
var sorted = getDictionary(bewoobjects);
var selected = new Dictionary<string, object>();
if (tryGetSingleValue(sorted, TableID.Customer, out long coid))
{
var customer = DAOFactory.GenericDAO.GetByID<Customer>(coid);
var customer_dc = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(customer);
selected.Add("CustomerName", customer_dc.LastNameFirstName);
}
if (tryGetSingleValue(sorted, TableID.CostBearer, out long cboid))
{
var costbearer = DAOFactory.GenericDAO.GetByID<Organisation>(cboid);
var costbearer_dc = MapperFactory.CompactOrganisationDC_Organisation.MapToNewDC(costbearer);
selected.Add("CostBearerName", costbearer_dc.Name);
}
if (tryGetSingleValue(sorted, TableID.SupportConcept, out long soid))
{
var supportconcept = DAOFactory.GenericDAO.GetByID<SupportConcept>(soid);
var supportconcept_dc = MapperFactory.CompactSupportConceptDC_SupportConcept.MapToNewDC(supportconcept);
selected.Add("SupportConceptDuration", $"{supportconcept_dc.StartDate?.Date} - {supportconcept_dc.EndDate?.Date}");
}
var records = new List<Dictionary<string, object>>();
if (tryGetMultipleValues(sorted, TableID.ServiceRecord, out List<long> oids))
{
var service_records = DAOFactory.GenericDAO.GetByIDs<ServiceRecord>(oids);
var service_records_dc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(service_records);
foreach (var service_record in service_records_dc)
{
var record_dict = new Dictionary<string, object>
{
{ "StartDate", service_record.Start },
{ "EndDate", service_record.End },
{ "Duration (Std)", service_record.DurationInStunden },
{ "ServiceCategory", service_record.ServiceDescription.Category.Name },
{ "ServiceDescription", service_record.ServiceDescription.Name },
{ "Documentation", service_record.Notice
+ "\n\n" + service_record.Notice2
+ "\n\n" + service_record.Notice3
+ "\n\n" + service_record.Notice4
+ "\n\n" + service_record.Notice5},
{ "Distance (Meter)", service_record.DistanceInMeter ?? 0 },
{ "InsertedOn", service_record.InsertedOn },
{ "Betrag", service_record.Betrag },
{ "InsertUser", service_record.InsUser },
{ "Employee", service_record.Employee }
};
records.Add(record_dict);
}
}
var dict = new Dictionary<string, object>
{
{ "Aktuelle Ansicht", "Zeiterfassung" },
{ "Selected", selected },
{ "Zeiterfassungen", records }
};
var json = JsonConvert.SerializeObject(dict);
return json;
}
private static string getSystemPrompt(int i)
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = $"BeWo.Service.AI.system_prompt{i}.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
return result;
}
return null;
}
private static Dictionary<long, List<long>> getDictionary(List<Tuple<long, long>> tuples)
{
var seperate = new Dictionary<long, List<long>>();
foreach (var bewoobject in tuples)
{
var oid = bewoobject.Item1;
var tid = bewoobject.Item2;
if (seperate.TryGetValue(tid, out var list))
{
list.Add(oid);
}
else
{
seperate.Add(tid, new List<long>() { oid });
}
}
return seperate;
}
private static bool tryGetSingleValue(Dictionary<long, List<long>> sorted, TableID tid, out long oid)
{
oid = 0;
if (!tryGetMultipleValues(sorted, tid, out List<long> oids) || oids is null || oids.Count == 0)
return false;
oid = oids[0];
return true;
}
private static bool tryGetMultipleValues(Dictionary<long, List<long>> sorted, TableID tid, out List<long> oids)
{
return sorted.TryGetValue((long)tid, out oids);
}
}
}

View File

@@ -1,4 +1,4 @@
Du bist ein intelligenter Assistent. Deine Aufgabe ist es, basierend auf einer Nutzeranfrage und den bereitgestellten Daten eine klare und präzise Antwort zu generieren. Du bist ein intelligenter Assistent. Deine Aufgabe ist es, basierend auf einer Nutzeranfrage, den bereitgestellten Daten und dem bisherigen Chatverlauf eine klare und präzise Antwort zu generieren.
WICHTIG: WICHTIG:
- Verwende ausschließlich die bereitgestellten Daten für deine Antwort. - Verwende ausschließlich die bereitgestellten Daten für deine Antwort.
@@ -10,4 +10,3 @@ WICHTIG:
### **Daten** ### **Daten**
Du erhälst folgendes: Du erhälst folgendes:

View File

@@ -0,0 +1 @@
Lets count to infinity. You take my input, add 1 and just return the number. You do nothing more.

View File

@@ -179,8 +179,12 @@ namespace BS.Shared
TwoFactorCode = 172, TwoFactorCode = 172,
CustomerWohnhilfe = 173, CustomerWohnhilfe = 173,
AiSettings = 174, AiSettings = 174,
SignatureDeletionHistory = 175 SignatureDeletionHistory = 175,
} AiConversation = 176,
AiModel = 177,
AiConversationMessage = 178,
AiContext2BeWoObject = 179
}
public enum SystemEntryID public enum SystemEntryID
{ {
@@ -1329,4 +1333,11 @@ namespace BS.Shared
Auftragsdatei, Auftragsdatei,
Nutzdatendatei Nutzdatendatei
} }
public enum AiConversationMessageRole
{
System,
Assistent,
User
}
} }

View File

@@ -19,48 +19,76 @@ namespace BS.Shared.Core
// //
// GET // GET
// //
protected TRes SendGet<TRes>(string url, string token = null) protected TRes SendGet<TRes>(string sub_url, string token = null)
=> Get<TRes>(url, token); => Get<TRes>(sub_url, token);
protected Task<TRes> SendGetAsync<TRes>(string url, string token = null) protected Task<TRes> SendGetAsync<TRes>(string sub_url, string token = null)
=> GetAsync<TRes>(url, token); => GetAsync<TRes>(sub_url, token);
// //
// POST // POST
// //
protected TRes SendPost<TReq, TRes>(string url, TReq req, string token = null) protected TRes SendPostUploadString<TReq, TRes>(string sub_url, TReq req, string token = null)
=> Send<TReq, TRes>(url, "POST", req, token); => SendUploadString<TReq, TRes>(sub_url, "POST", req, token);
protected Task<TRes> SendPostAsync<TReq, TRes>(string url, TReq req, string token = null) protected TRes SendPostUploadValues<TReq, TRes>(string sub_url, TReq req, string token = null)
=> SendAsync<TReq, TRes>(url, "POST", req, token); => SendUploadValues<TReq, TRes>(sub_url, "POST", req, token);
protected Task<TRes> SendPostUploadStringAsync<TReq, TRes>(string sub_url, TReq req, string token = null)
=> SendUploadStringAsync<TReq, TRes>(sub_url, "POST", req, token);
protected Task<TRes> SendPostUploadValuesAsync<TReq, TRes>(string sub_url, TReq req, string token = null)
=> SendUploadValuesAsync<TReq, TRes>(sub_url, "POST", req, token);
#region private #region private
// //
// Requests // Requests
// //
private TRes Get<TRes>(string url, string token = null) private TRes Get<TRes>(string sub_url, string token = null)
{ {
var url = getUrl(sub_url);
string response = Get(url, token); string response = Get(url, token);
return deserialize<TRes>(response); return deserialize<TRes>(response);
} }
private TRes Send<TReq, TRes>(string url, string method, TReq req, string token = null) private TRes SendUploadString<TReq, TRes>(string sub_url, string method, TReq req, string token = null)
{ {
var data = serialize(req); var data = serializeJson(req);
var url = getUrl(sub_url);
string response = Send(url, method, data, token); string response = SendUploadString<TRes>(url, method, data, token);
return deserialize<TRes>(response); return deserialize<TRes>(response);
} }
private async Task<TRes> GetAsync<TRes>(string url, string token = null) private TRes SendUploadValues<TReq, TRes>(string sub_url, string method, TReq req, string token = null)
{ {
var data = serialize(req);
var url = getUrl(sub_url);
string response = SendUploadValues(url, method, data, token);
return deserialize<TRes>(response);
}
private async Task<TRes> GetAsync<TRes>(string sub_url, string token = null)
{
var url = getUrl(sub_url);
string response = await GetAsync(url, token); string response = await GetAsync(url, token);
return deserialize<TRes>(response); return deserialize<TRes>(response);
} }
private async Task<TRes> SendAsync<TReq, TRes>(string url, string method, TReq req, string token = null) private async Task<TRes> SendUploadStringAsync<TReq, TRes>(string sub_url, string method, TReq req, string token = null)
{
var data = serializeJson(req);
var url = getUrl(sub_url);
string response = await SendUploadStringAsync<TRes>(url, method, data, token);
return deserialize<TRes>(response);
}
private async Task<TRes> SendUploadValuesAsync<TReq, TRes>(string sub_url, string method, TReq req, string token = null)
{ {
var data = serialize(req); var data = serialize(req);
var url = getUrl(sub_url);
string response = await SendAsync(url, method, method, token); string response = await SendUploadValuesAsync(url, method, data, token);
return deserialize<TRes>(response); return deserialize<TRes>(response);
} }
@@ -70,11 +98,15 @@ namespace BS.Shared.Core
// //
private string Get(string url, string token = null) private string Get(string url, string token = null)
=> exec(true, client => client.DownloadString(url), token); => exec(true, client => client.DownloadString(url), token);
private string Send<T>(string url, string method, T request, string token = null) private string SendUploadString<T>(string url, string method, string request, string token = null)
=> exec(false, client => client.UploadString(url, method, request), token);
private string SendUploadValues<T>(string url, string method, T request, string token = null)
=> exec(false, client => Encoding.UTF8.GetString(client.UploadValues(url, method, request?.ToNameValueCollection())), token); => exec(false, client => Encoding.UTF8.GetString(client.UploadValues(url, method, request?.ToNameValueCollection())), token);
private async Task<string> GetAsync(string url, string token = null) private async Task<string> GetAsync(string url, string token = null)
=> await execasync(true, client => client.DownloadStringTaskAsync(url), token); => await execasync(true, client => client.DownloadStringTaskAsync(url), token);
private async Task<string> SendAsync<T>(string url, string method, T request, string token = null) private async Task<string> SendUploadStringAsync<T>(string url, string method, string request, string token = null)
=> await execasync(false, async client => await client.UploadStringTaskAsync(url, method, request), token);
private async Task<string> SendUploadValuesAsync<T>(string url, string method, T request, string token = null)
=> await execasync(false, async client => Encoding.UTF8.GetString(await client.UploadValuesTaskAsync(url, method, request?.ToNameValueCollection())), token); => await execasync(false, async client => Encoding.UTF8.GetString(await client.UploadValuesTaskAsync(url, method, request?.ToNameValueCollection())), token);
// //
@@ -135,6 +167,34 @@ namespace BS.Shared.Core
{ {
return input?.ToKeyValue(); return input?.ToKeyValue();
} }
private string serializeJson<T>(T input)
{
if (typeof(T) == typeof(string))
return input as string;
var t = JsonConvert.SerializeObject(input);
return t;
}
#endregion #endregion
protected virtual string getKey()
{
return null;
}
protected virtual string getUrl()
{
return null;
}
private string getUrl(string sub_url)
{
var root = getUrl();
var baseUri = new Uri(root);
var uri = new Uri(baseUri, sub_url);
var url = uri.ToString();
return url;
}
} }
} }

View File

@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts
{
[DataContract]
public class AiConversationDC : IDataContract
{
[DataMember] public long? Oid { get; set; }
[DataMember] public long Version { get; set; }
[DataMember] public string Displayname { get; set; }
[DataMember] public DateTime Created { get; set; }
[DataMember] public string Modell { get; set; }
[DataMember] public string View { get; set; }
[DataMember] public string Context { get; set; }
[DataMember] public AiSettingDC Setting { get; set; }
[DataMember] public List<AiConversationMessageDC> Messages { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts
{
[DataContract]
public class AiConversationMessageDC : IDataContract
{
[DataMember] public long? Oid { get; set; }
[DataMember] public long? Version { get; set; }
[DataMember] public string Model { get; set; }
[DataMember] public string Context { get; set; }
[DataMember] public string Prompt { get; set; }
[DataMember] public string ApiMethods { get; set; }
[DataMember] public string Context2 { get; set; }
[DataMember] public string Result { get; set; }
[DataMember] public DateTime TimeStamp { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts
{
[DataContract]
public class AiSettingDC : IDataContract
{
[DataMember] public long Oid { get; set; }
[DataMember] public long Version { get; set; }
[DataMember] public string SelectedModel { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts.Feature.AI
{
//string:Displayname
//DateTime:Created
//DateTime:Updated
//AiModelDC:Modell
//string:Context
//List<AiContext2BeWoObject>:Context2BeWoObjects
//int:UIContext
//List<AiConversationMessageDC>:Messages
[DataContract]
public class AiConversationDC : BeWoDataContract
{
[DataMember] public string Displayname { get; set; }
[DataMember] public DateTime Created { get; set; }
[DataMember] public DateTime Updated { get; set; }
[DataMember] public AiModelDC Modell { get; set; }
[DataMember] public string Context { get; set; }
[DataMember] public List<Tuple<long, long>> ContextBeWoObjects { get; set; }
[DataMember] public int UIContext { get; set; }
[DataMember] public List<AiConversationMessageDC> Messages { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts
{
[DataContract]
public class AiConversationMessageDC : BeWoDataContract
{
[DataMember] public string Message { get; set; }
[DataMember] public AiConversationMessageRole Role { get; set; }
[DataMember] public DateTime Created { get; set; }
}
}

View File

@@ -5,9 +5,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace BS.Shared.DataContracts namespace BS.Shared.DataContracts.Feature.AI
{ {
public class AiModelDC : IDataContract, IComparable<AiModelDC> public class AiModelDC : BeWoDataContract, IComparable<AiModelDC>
{ {
public AiModelDC() public AiModelDC()
{ {
@@ -20,8 +20,10 @@ namespace BS.Shared.DataContracts
Value = value; Value = value;
} }
[JsonProperty("name")]
public string ModelName { get; set; } public string ModelName { get; set; }
[JsonProperty("ollama.details.parameter_size")]
public int Value { get; set; } public int Value { get; set; }
public int CompareTo(AiModelDC other) public int CompareTo(AiModelDC other)

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts.Feature.AI
{
[DataContract]
public class AiSettingDC : BeWoDataContract
{
[DataMember] public AiModelDC SelectedModel { get; set; }
}
}

View File

@@ -174,10 +174,10 @@
<Compile Include="DataContracts\AbsenceOverviewFilterDC.cs" /> <Compile Include="DataContracts\AbsenceOverviewFilterDC.cs" />
<Compile Include="DataContracts\AdminService\IAdminServiceDC.cs" /> <Compile Include="DataContracts\AdminService\IAdminServiceDC.cs" />
<Compile Include="DataContracts\AdminService\AdminServiceSumReqDC.cs" /> <Compile Include="DataContracts\AdminService\AdminServiceSumReqDC.cs" />
<Compile Include="DataContracts\AiConversationDC.cs" /> <Compile Include="DataContracts\Feature\AI\AiConversationDC.cs" />
<Compile Include="DataContracts\AiConversationMessageDC.cs" /> <Compile Include="DataContracts\Feature\AI\AiConversationMessageDC.cs" />
<Compile Include="DataContracts\AiModelDC.cs" /> <Compile Include="DataContracts\Feature\AI\AiModelDC.cs" />
<Compile Include="DataContracts\AiSettingDC.cs" /> <Compile Include="DataContracts\Feature\AI\AiSettingDC.cs" />
<Compile Include="DataContracts\AiSettingsDC.cs" /> <Compile Include="DataContracts\AiSettingsDC.cs" />
<Compile Include="DataContracts\AiChatDC.cs" /> <Compile Include="DataContracts\AiChatDC.cs" />
<Compile Include="DataContracts\AbwesenheitsInformationDC.cs" /> <Compile Include="DataContracts\AbwesenheitsInformationDC.cs" />
@@ -191,29 +191,29 @@
<Compile Include="DataContracts\ClientPartials\IMoKSearchableDC.cs" /> <Compile Include="DataContracts\ClientPartials\IMoKSearchableDC.cs" />
<Compile Include="DataContracts\Compact\CompactGkvAbrechnungDC.cs" /> <Compile Include="DataContracts\Compact\CompactGkvAbrechnungDC.cs" />
<Compile Include="DataContracts\CustomerVermittlungArbeitDC.cs" /> <Compile Include="DataContracts\CustomerVermittlungArbeitDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvClientRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvClientSumRequestJson.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientSumRequestJson.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvClientSumResponseJson.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientSumResponseJson.cs" />
<Compile Include="DataContracts\ImportSupportConceptResultDC.cs" /> <Compile Include="DataContracts\ImportSupportConceptResultDC.cs" />
<Compile Include="DataContracts\CheckObjectDeletionResultDC.cs" /> <Compile Include="DataContracts\CheckObjectDeletionResultDC.cs" />
<Compile Include="DataContracts\AppRequestDC.cs" /> <Compile Include="DataContracts\AppRequestDC.cs" />
<Compile Include="DataContracts\AppResponseDC.cs" /> <Compile Include="DataContracts\AppResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungGetIKRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungGetIKRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungGetIKResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungGetIKResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetStatusRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetStatusRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetStatusResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetStatusResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvClientResultRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientResultRequestDC.cs" />
<Compile Include="DataContracts\Invoicing\BankAccountDC.cs" /> <Compile Include="DataContracts\Invoicing\BankAccountDC.cs" />
<Compile Include="DataContracts\MikePHPContracts\AiMessageRequest2.cs" /> <Compile Include="DataContracts\MikePHPContracts\AiMessageRequest2.cs" />
<Compile Include="DataContracts\MikePHPContracts\AiMessageRequest.cs" /> <Compile Include="DataContracts\MikePHPContracts\AiMessageRequest.cs" />
<Compile Include="DataContracts\MikePHPContracts\AiMessageResponse2.cs" /> <Compile Include="DataContracts\MikePHPContracts\AiMessageResponse2.cs" />
<Compile Include="DataContracts\MikePHPContracts\AiMessageResponse.cs" /> <Compile Include="DataContracts\MikePHPContracts\AiMessageResponse.cs" />
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeDC.cs" /> <Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeDC.cs" />
<Compile Include="DataContracts\ImageDC.cs" /> <Compile Include="DataContracts\ImageDC.cs" />
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichBundDC.cs" /> <Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichBundDC.cs" />
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichEinkommenUndArbeitDC.cs" /> <Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichEinkommenUndArbeitDC.cs" />
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichSozialeKontakteDC.cs" /> <Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichSozialeKontakteDC.cs" />
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichSozialstrukturDC.cs" /> <Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichSozialstrukturDC.cs" />
<Compile Include="DataContracts\BeWoDataContract.cs" /> <Compile Include="DataContracts\BeWoDataContract.cs" />
<Compile Include="DataContracts\HilfeplanImportDC.cs" /> <Compile Include="DataContracts\HilfeplanImportDC.cs" />
<Compile Include="DataContracts\HilfeplanImportZielDC.cs" /> <Compile Include="DataContracts\HilfeplanImportZielDC.cs" />
@@ -235,22 +235,22 @@
<Compile Include="DataContracts\DokumentvorlageDC.cs" /> <Compile Include="DataContracts\DokumentvorlageDC.cs" />
<Compile Include="DataContracts\AdditionalServiceNoticeDC.cs" /> <Compile Include="DataContracts\AdditionalServiceNoticeDC.cs" />
<Compile Include="DataContracts\GeschenkterUrlaubstagDC.cs" /> <Compile Include="DataContracts\GeschenkterUrlaubstagDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerResultDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerResultDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerResultXml.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerResultXml.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerSendNewResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerSendNewResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvTransferProtokollDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvTransferProtokollDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetIKRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetIKRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetIKResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetIKResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvServerSendNewRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerSendNewRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungSendResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungSendResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungSendRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungSendRequestDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungCreateResponseDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungCreateResponseDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungViewFilterDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungViewFilterDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungCreateRequestDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungCreateRequestDC.cs" />
<Compile Include="DataContracts\GoalRatingDC.cs" /> <Compile Include="DataContracts\GoalRatingDC.cs" />
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungDC.cs" /> <Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungDC.cs" />
<Compile Include="DataContracts\PlatzhalterDC.cs" /> <Compile Include="DataContracts\PlatzhalterDC.cs" />
<Compile Include="DataContracts\PreisDC.cs" /> <Compile Include="DataContracts\PreisDC.cs" />
<Compile Include="DataContracts\QuittierungsbelegsstatusDC.cs" /> <Compile Include="DataContracts\QuittierungsbelegsstatusDC.cs" />