Zwischenstand. Zeiterfassung sieht ganz hübsch aus
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
<view:BeWoView x:Class="BeWo.AI.View.AiChatView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:view="clr-namespace:BeWo.View"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:validation="clr-namespace:BeWo.Validation"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
|
||||
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
|
||||
mc:Ignorable="d" VerticalAlignment="Stretch" Focusable="True">
|
||||
<view:BeWoView
|
||||
x:Class="BeWo.AI.View.AiChatView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
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:validation="clr-namespace:BeWo.Validation"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<view:BeWoView.Resources>
|
||||
<!--<Expander x:Name="ExpanderTemplate" IsExpanded="True">
|
||||
<Expander.Header>
|
||||
@@ -25,60 +30,120 @@
|
||||
</Expander.Header>
|
||||
</Expander>-->
|
||||
</view:BeWoView.Resources>
|
||||
<Grid Margin="0" Background="{DynamicResource ObjectEditBackgroundBrush}">
|
||||
<Grid Margin="0" Background="{DynamicResource ObjectEditBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<dxlc:LayoutControl Orientation="Vertical" Padding="0">
|
||||
<dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True" Height="200">
|
||||
<dxlc:LayoutControl Padding="0" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Height="200" dxlc:LayoutControl.AllowVerticalSizing="True">
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Row="0" Content="Einstellungen" HorizontalAlignment="Left" Click="btnSettings_Click"/>
|
||||
<Popup Grid.Row="0" Grid.RowSpan="3" StaysOpen="True" Placement="MousePoint" Width="400" Height="300" x:Name="PopupTemplate">
|
||||
<Grid Background="{DynamicResource ObjectEditBackgroundBrush}" Margin="2,2,2,2">
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
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>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="{t:Translate Datensatz Template}"></Label>
|
||||
<TextBox x:Name="TextBoxTemplate" Grid.Row="1" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"></TextBox>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Grid.Row="2" Content="Übernehmen" Click="btnSaveSettings_Click" Margin="3"/>
|
||||
<Button Grid.Row="2" Content="Abbrechen" Click="btnCancelSettings_Click" Margin="3"/>
|
||||
<Label Grid.Row="0" Content="{t:Translate Datensatz Template}" />
|
||||
<TextBox
|
||||
x:Name="TextBoxTemplate"
|
||||
Grid.Row="1"
|
||||
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>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Popup>
|
||||
<Label Grid.Row="1" Content="{t:Translate Formulieren Sie hier Ihre Anfrage}"></Label>
|
||||
<TextBox x:Name="TextBoxAnfrage" Grid.Row="2" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"></TextBox>
|
||||
<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"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Grid>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True">
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{t:Translate Ergebnis}"></Label>
|
||||
<TextBox x:Name="TextBoxErgebnis" Grid.Row="1" MinHeight="60" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" TextWrapping="Wrap" ></TextBox>
|
||||
<Label Content="{t:Translate Ergebnis}" />
|
||||
<TextBox
|
||||
x:Name="TextBoxErgebnis"
|
||||
Grid.Row="1"
|
||||
MinHeight="60"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Grid>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutControl>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Height="Auto" Margin="5,10,10,10" HorizontalAlignment="Right">
|
||||
<Button x:Name="btnSend" Content="{t:Translate Absenden}" Margin="0,0,3,0" Height="25" Click="btnSend_Click"/>
|
||||
<Button x:Name="btnClose" Content=" Schließen " Margin="0,0,3,0" Height="25" Click="btnClose_Click"/>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
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>
|
||||
</Grid>
|
||||
</view:BeWoView>
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<Page x:Class="BeWo.LockedPage"
|
||||
Title="LockedPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:markup="clr-namespace:BeWo.MultiLanguage.Markup"
|
||||
mc:Ignorable="d" Width="Auto" Background="{StaticResource LoginBackground}" SnapsToDevicePixels="False" Focusable="True">
|
||||
<Page
|
||||
x:Class="BeWo.LockedPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="LockedPage"
|
||||
Width="Auto"
|
||||
Background="{StaticResource LoginBackground}"
|
||||
Focusable="True"
|
||||
SnapsToDevicePixels="False"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<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:01" Value="1" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
@@ -21,7 +29,14 @@
|
||||
</Page.Triggers>
|
||||
<Grid>
|
||||
<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>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
@@ -30,7 +45,12 @@
|
||||
<TranslateTransform X="0" Y="0" />
|
||||
</TransformGroup>
|
||||
</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.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
@@ -44,31 +64,142 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</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"/>
|
||||
<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" />
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,100,0,0" MaxWidth="330">
|
||||
<Label x:Name="lblGesperrt" Content="Gesperrt" Foreground="#FF000000" FontSize="12" FontWeight="Bold" Margin="0,30,0,0" HorizontalAlignment="Center" />
|
||||
<TextBlock Text="Bitte melden Sie sich an, um den BeWoPlaner zu entsperren." TextWrapping="Wrap" Foreground="#FF000000" FontSize="12" />
|
||||
<Image
|
||||
Grid.Row="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Height="45"
|
||||
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>
|
||||
<Label Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Content="{markup:Translate Benutzername:}" Foreground="#FF000000" Background="#00000000" />
|
||||
<Label Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Content="Passwort:" Foreground="#FF000000" Background="#00000000" />
|
||||
<TextBox TabIndex="0" SnapsToDevicePixels="True" Grid.Column="2" Grid.Row="1" Margin="10,10,20,10" Height="24" x:Name="TextBoxUsername" HorizontalAlignment="Stretch" Text="" />
|
||||
<PasswordBox Margin="10,0,20,0" Height="24" Grid.Column="2" Grid.Row="2" x:Name="PasswordBoxPassword" Password="" HorizontalAlignment="Stretch" TabIndex="1" />
|
||||
<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" />
|
||||
<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" />
|
||||
<TextBlock Grid.Row="3" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="10" Margin="0,0,12,10">
|
||||
<Hyperlink TargetName="newWindow" Foreground="#FF818181" NavigateUri="https://www.ownsoft.de/">www.ownsoft.de</Hyperlink>
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Background="#00000000"
|
||||
Content="{markup:Translate Benutzername:}"
|
||||
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>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="70" X2="585" Y2="70" StrokeThickness="1"></Line>
|
||||
<Line Grid.ColumnSpan="4" Stroke="#FFADADAD" X1="14" Y1="370" X2="585" Y2="370" StrokeThickness="1"></Line>
|
||||
<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>
|
||||
<Rectangle Width="600" Height="400" RenderTransformOrigin="0.5,0.5">
|
||||
<Rectangle
|
||||
Width="600"
|
||||
Height="400"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Rectangle.OpacityMask>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0.418">
|
||||
<GradientStop Color="#00000000" Offset="0" />
|
||||
<GradientStop Color="#4CFFFFFF" Offset="1" />
|
||||
<LinearGradientBrush StartPoint="0.5,0.418" EndPoint="0.5,1">
|
||||
<GradientStop Offset="0" Color="#00000000" />
|
||||
<GradientStop Offset="1" Color="#4CFFFFFF" />
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.OpacityMask>
|
||||
<Rectangle.RenderTransform>
|
||||
|
||||
@@ -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">
|
||||
<BeWo:BSLogoControl Width="400" Height="400" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="LayoutRoot"
|
||||
Width="300"
|
||||
Height="300">
|
||||
<BeWo:BSLogoControl Width="400" Height="400" />
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -38,26 +38,26 @@ namespace BeWo
|
||||
{
|
||||
public enum UIContext
|
||||
{
|
||||
SupportConcept,
|
||||
Customer,
|
||||
Person,
|
||||
Employee,
|
||||
Organisation,
|
||||
Team,
|
||||
Dokumente,
|
||||
User,
|
||||
UserGroup,
|
||||
Report,
|
||||
Scheduler,
|
||||
Wohnheim,
|
||||
Vertretungen,
|
||||
CustomerTeam,
|
||||
Scheduling,
|
||||
Finance,
|
||||
Administration,
|
||||
AiConversation,
|
||||
AiConversationPopup,
|
||||
ServiceRecord
|
||||
SupportConcept = 0,
|
||||
Customer = 1,
|
||||
Person = 2,
|
||||
Employee = 3,
|
||||
Organisation = 4,
|
||||
Team = 5,
|
||||
Dokumente = 6,
|
||||
User = 7,
|
||||
UserGroup = 8,
|
||||
Report = 9,
|
||||
Scheduler = 10,
|
||||
Wohnheim = 11,
|
||||
Vertretungen = 12,
|
||||
CustomerTeam = 13,
|
||||
Scheduling = 14,
|
||||
Finance = 15,
|
||||
Administration = 16,
|
||||
AiConversation = 17,
|
||||
AiConversationPopup = 18,
|
||||
ServiceRecord = 19
|
||||
}
|
||||
|
||||
public partial class MainControl
|
||||
|
||||
@@ -10,66 +10,28 @@
|
||||
|
||||
namespace BeWo.ServiceProxy
|
||||
{
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
|
||||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="BeWo.ServiceProxy.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.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.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")]
|
||||
@@ -106,34 +68,24 @@ namespace BeWo.ServiceProxy
|
||||
{
|
||||
}
|
||||
|
||||
public object Method1(object input, object input2)
|
||||
{
|
||||
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()
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiModelDC> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,44 @@
|
||||
<localView:BeWoView x:Class="BeWo.View.Detail.AbsenceReasonView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View"
|
||||
xmlns:val="clr-namespace:BeWo.Validation" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
xmlns:xtraEditors="clr-namespace:DevExpress.XtraEditors;assembly=DevExpress.XtraEditors.v23.2"
|
||||
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" Focusable="True">
|
||||
<GroupBox Name="root" Header="Aktuell definierte Abwesenheitskategorien" Style="{StaticResource ObjectEditGroupBox}">
|
||||
<localView:BeWoView
|
||||
x:Class="BeWo.View.Detail.AbsenceReasonView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:localView="clr-namespace:BeWo.View"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:val="clr-namespace:BeWo.Validation"
|
||||
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.Resources>
|
||||
<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 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>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -34,28 +55,72 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0">Bezeichnung</Label>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23"
|
||||
Text="{val:ValidationBinding Path=NewVM.Description, UpdateSourceTrigger=PropertyChanged}" Width="125" />
|
||||
<Label Grid.Column="2" Grid.Row="0">max. abrechenbare Stunden (pro Woche)</Label>
|
||||
|
||||
<dxe:SpinEdit Name="spinedit_hours" AllowNullInput="True" IsFloatValue="False" MinValue="0" Grid.Column="3" Grid.Row="0"
|
||||
Height="23" Width="50" EditValue="{Binding Path=NewVM.Hours, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label Grid.Column="4" Grid.Row="0">Minuten</Label>
|
||||
<dxe:SpinEdit Name="spinedit_minutes" AllowNullInput="True" IsFloatValue="False" Grid.Column="5" Grid.Row="0"
|
||||
Height="23" Width="50" MinValue="0"
|
||||
MaxValue="59"
|
||||
EditValue="{Binding Path=NewVM.Minutes, Converter={StaticResource Int2DecimalConverter}, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Name="button_addReason" Click="button_addReason_Click" Grid.Column="4" Grid.Row="1" Height="25"
|
||||
Margin="3" IsDefault="True" Grid.ColumnSpan="2" HorizontalAlignment="Right">Hinzufügen</Button>
|
||||
<Label Grid.Column="0" Grid.Row="1">
|
||||
<Label Grid.Row="0" Grid.Column="0">Bezeichnung</Label>
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="125"
|
||||
Height="23"
|
||||
Margin="3"
|
||||
Text="{val:ValidationBinding Path=NewVM.Description,
|
||||
UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label Grid.Row="0" Grid.Column="2">max. abrechenbare Stunden (pro Woche)</Label>
|
||||
|
||||
<dxe:SpinEdit
|
||||
Name="spinedit_hours"
|
||||
Grid.Row="0"
|
||||
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
|
||||
</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>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="12" Rows="12" IsItemsHost="True" />
|
||||
<UniformGrid
|
||||
Columns="12"
|
||||
IsItemsHost="True"
|
||||
Rows="12" />
|
||||
</ItemsPanelTemplate>
|
||||
</ComboBox.ItemsPanel>
|
||||
<ComboBox.ItemContainerStyle>
|
||||
@@ -65,57 +130,124 @@
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
</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>
|
||||
<ComboBox x:Name="combo_visibilitytype"
|
||||
Grid.Column="3" Grid.Row="1" VerticalAlignment="Center" Margin="3,1,3,3"
|
||||
HorizontalAlignment="Stretch"
|
||||
ItemsSource="{x:Static core:EnumTranslations.AbsenceReasonVisibility2Translations}"
|
||||
SelectedValue="{Binding NewVM.Sichtbarkeit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key"
|
||||
DisplayMemberPath="Value"
|
||||
Height="23" Width="200"/>
|
||||
<ComboBox
|
||||
x:Name="combo_visibilitytype"
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
Width="200"
|
||||
Height="23"
|
||||
Margin="3,1,3,3"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
DisplayMemberPath="Value"
|
||||
ItemsSource="{x:Static core:EnumTranslations.AbsenceReasonVisibility2Translations}"
|
||||
SelectedValue="{Binding NewVM.Sichtbarkeit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key" />
|
||||
</StackPanel>
|
||||
<dxg:GridControl x:Name="datagrid_absencereasons" Margin="0,10,0,0" Grid.Column="0" Grid.Row="2"
|
||||
Grid.ColumnSpan="7" DataSource="{Binding VMList}">
|
||||
<dxg:GridControl
|
||||
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:GridColumn FieldName="IsDeleteable" Header="" FixedWidth="True" Width="24" ReadOnly="True">
|
||||
<dxg:GridColumn
|
||||
Width="24"
|
||||
FieldName="IsDeleteable"
|
||||
FixedWidth="True"
|
||||
Header=""
|
||||
ReadOnly="True">
|
||||
<dxg:GridColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="r"
|
||||
Visibility="{Binding Path=EditValue, Converter={StaticResource BoolVisibilityConverter}}"
|
||||
FontFamily="Webdings" Click="DeleteButton_Click" Width="18" Height="18"
|
||||
VerticalAlignment="Center" />
|
||||
<Button
|
||||
Width="18"
|
||||
Height="18"
|
||||
VerticalAlignment="Center"
|
||||
Click="DeleteButton_Click"
|
||||
Content="r"
|
||||
FontFamily="Webdings"
|
||||
Visibility="{Binding Path=EditValue, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
</DataTemplate>
|
||||
</dxg:GridColumn.CellTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn FieldName="Description" Header="Bezeichnung" Width="180" />
|
||||
<dxg:GridColumn FieldName="Hours" Header="max. abrechenbare Stunden" Width="180" />
|
||||
<dxg:GridColumn FieldName="Minutes" Header="Minuten" Width="180" />
|
||||
<dxg:GridColumn x:Name="column_visibility" FieldName="Sichtbarkeit" Header="Nur auswählbar für" Width="150" />
|
||||
<dxg:GridColumn x:Name="column_Color" FieldName="Brush" Header="Farbe" Width="70">
|
||||
<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" BorderThickness="0" Style="{x:Null}" Background="{Binding EditValue}" Foreground="{Binding EditValue}" Height="21" HorizontalAlignment="Stretch" Click="button_select_color_Click"></Button>
|
||||
</ControlTemplate>
|
||||
</dxg:GridColumn.EditTemplate>
|
||||
</dxg:GridColumn>
|
||||
<dxg:GridColumn
|
||||
Width="180"
|
||||
FieldName="Description"
|
||||
Header="Bezeichnung" />
|
||||
<dxg:GridColumn
|
||||
Width="180"
|
||||
FieldName="Hours"
|
||||
Header="max. abrechenbare Stunden" />
|
||||
<dxg:GridColumn
|
||||
Width="180"
|
||||
FieldName="Minutes"
|
||||
Header="Minuten" />
|
||||
<dxg:GridColumn
|
||||
x:Name="column_visibility"
|
||||
Width="150"
|
||||
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.View>
|
||||
<dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False"
|
||||
NavigationStyle="Cell" />
|
||||
<dxg:TableView
|
||||
AutoWidth="true"
|
||||
NavigationStyle="Cell"
|
||||
ShowGroupPanel="False"
|
||||
ShowGroupedColumns="false"
|
||||
ShowTotalSummary="False" />
|
||||
</dxg:GridControl.View>
|
||||
</dxg:GridControl>
|
||||
<Popup x:Name="popup_color" StaysOpen="false" Placement="MousePoint">
|
||||
<ListBox x:Name="listbox_colorpicker" BorderThickness="0" Loaded="colorEditor_Loaded" SelectionChanged="listbox_colorpicker_SelectionChanged">
|
||||
<Popup
|
||||
x:Name="popup_color"
|
||||
Placement="MousePoint"
|
||||
StaysOpen="false">
|
||||
<ListBox
|
||||
x:Name="listbox_colorpicker"
|
||||
BorderThickness="0"
|
||||
Loaded="colorEditor_Loaded"
|
||||
SelectionChanged="listbox_colorpicker_SelectionChanged">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="12" Rows="12" IsItemsHost="True" />
|
||||
<UniformGrid
|
||||
Columns="12"
|
||||
IsItemsHost="True"
|
||||
Rows="12" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemContainerStyle>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
Width="36"
|
||||
Height="24"
|
||||
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">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
|
||||
@@ -29,17 +29,13 @@ namespace BeWo.View.Detail
|
||||
InitializeComponent();
|
||||
|
||||
OpenAiSettingCommand = new DelegateCommand(OpenAiSetting);
|
||||
ReloadConversationsCommand = new DelegateCommand(ReloadConversations);
|
||||
ReloadModelsCommand = new DelegateCommand(ReloadModels);
|
||||
}
|
||||
|
||||
public AiConversationChatView(object o) : this()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public AiConversationChatView(string context) : this()
|
||||
{
|
||||
ViewModel.ContextInput = context;
|
||||
}
|
||||
|
||||
public AiConversationListVM ViewModel
|
||||
@@ -49,16 +45,32 @@ namespace BeWo.View.Detail
|
||||
}
|
||||
|
||||
public DelegateCommand OpenAiSettingCommand { get; set; }
|
||||
public DelegateCommand ReloadConversationsCommand { get; set; }
|
||||
public DelegateCommand ReloadModelsCommand { get; set; }
|
||||
|
||||
private void BeWoView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ReloadModels();
|
||||
ReloadConversations();
|
||||
|
||||
//if (Dispatcher.CheckAccess())
|
||||
//{
|
||||
// ReloadModels();
|
||||
// ReloadConversations();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Dispatcher.BeginInvoke(new Action(() =>
|
||||
// {
|
||||
// ReloadModels();
|
||||
// ReloadConversations();
|
||||
// }));
|
||||
//}
|
||||
}
|
||||
|
||||
private void ReloadButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ReloadModels();
|
||||
ReloadConversations();
|
||||
}
|
||||
|
||||
private void OpenAiSetting()
|
||||
@@ -81,5 +93,16 @@ namespace BeWo.View.Detail
|
||||
|
||||
}, 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5074,13 +5074,16 @@ namespace BeWo.View.Detail.Zeiterfassung
|
||||
{
|
||||
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);
|
||||
|
||||
window.ShowDialog();
|
||||
window.Show();
|
||||
}
|
||||
private IEnumerable<ServiceRecordVM> GetVisibleRecordVMs()
|
||||
{
|
||||
|
||||
@@ -9,13 +9,7 @@ namespace BeWo.ViewModel
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class AiConversationMessageVM : AbstractDCMapperVM<AiConversationMessageDC>
|
||||
{
|
||||
private string _ApiMethods;
|
||||
private string _Context;
|
||||
private string _Context2;
|
||||
private string _Prompt;
|
||||
private string _Model;
|
||||
private string _Result;
|
||||
private DateTime _TimeStamp;
|
||||
private string _Message;
|
||||
|
||||
public AiConversationMessageVM(AiConversationMessageDC dc) : base(dc, dc.Oid is null)
|
||||
{
|
||||
@@ -27,129 +21,35 @@ namespace BeWo.ViewModel
|
||||
get => JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
[JsonProperty(Order = 4)]
|
||||
public string ApiMethods
|
||||
[JsonProperty(Order = 1)]
|
||||
public string Message
|
||||
{
|
||||
get { return _ApiMethods; }
|
||||
get { return _Message; }
|
||||
set
|
||||
{
|
||||
if (!AreDifferent(ApiMethods, value))
|
||||
if (!AreDifferent(Message, value))
|
||||
return;
|
||||
|
||||
_ApiMethods = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.ApiMethods, value), nameof(ApiMethods));
|
||||
FirePropertyChanged(nameof(ApiMethods));
|
||||
}
|
||||
}
|
||||
|
||||
[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));
|
||||
_Message = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.Message, value), nameof(Message));
|
||||
FirePropertyChanged(nameof(Message));
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(Order = 2)]
|
||||
public string Prompt
|
||||
{
|
||||
get { return _Prompt; }
|
||||
set
|
||||
{
|
||||
if (!AreDifferent(_Prompt, value))
|
||||
return;
|
||||
public string Role => DataContract.Role.ToString();
|
||||
|
||||
_Prompt = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.Prompt, value), nameof(Prompt));
|
||||
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));
|
||||
}
|
||||
}
|
||||
[JsonProperty(Order = 3)]
|
||||
public string Time => DataContract.Created.ToString();
|
||||
|
||||
protected override void InitByDataContract(AiConversationMessageDC pDataContract)
|
||||
{
|
||||
_Context = pDataContract.Context;
|
||||
_Prompt = pDataContract.Prompt;
|
||||
_Model = pDataContract.Model;
|
||||
_Result = pDataContract.Result;
|
||||
_TimeStamp = pDataContract.TimeStamp;
|
||||
_Context2 = pDataContract.Context2;
|
||||
_ApiMethods = pDataContract.ApiMethods;
|
||||
_Message = pDataContract.Message;
|
||||
}
|
||||
|
||||
protected override AiConversationMessageDC MapToDataContract(AiConversationMessageDC pDataContract, bool doCommit)
|
||||
{
|
||||
pDataContract.Context = _Context;
|
||||
pDataContract.Prompt = _Prompt;
|
||||
pDataContract.Model = _Model;
|
||||
pDataContract.Result = _Result;
|
||||
pDataContract.TimeStamp = _TimeStamp;
|
||||
pDataContract.Message = _Message;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BeWo.ViewModel
|
||||
@@ -13,11 +15,7 @@ namespace BeWo.ViewModel
|
||||
public class AiConversationVM : AbstractDCMapperVM<AiConversationDC>
|
||||
{
|
||||
private string _Displayname;
|
||||
private DateTime _Created;
|
||||
private string _Modell;
|
||||
private string _View;
|
||||
private string _Context;
|
||||
private AiSettingDC _Setting;
|
||||
private DateTime _Updated;
|
||||
private AiConversationMessageListVM _Messages;
|
||||
|
||||
public AiConversationVM() : this(new AiConversationDC()) { }
|
||||
@@ -48,74 +46,17 @@ namespace BeWo.ViewModel
|
||||
}
|
||||
|
||||
[JsonProperty]
|
||||
public DateTime Created
|
||||
public DateTime Updated
|
||||
{
|
||||
get { return _Created; }
|
||||
get { return _Updated; }
|
||||
set
|
||||
{
|
||||
if (!AreDifferent(_Created, value))
|
||||
if (!AreDifferent(Updated, value))
|
||||
return;
|
||||
|
||||
_Created = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.Created, value), nameof(Created));
|
||||
FirePropertyChanged(nameof(Created));
|
||||
}
|
||||
}
|
||||
|
||||
[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));
|
||||
_Updated = value;
|
||||
StoreDirtyInformation(AreDifferent(DataContract.Updated, value), nameof(Updated));
|
||||
FirePropertyChanged(nameof(Updated));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
_Displayname = pDataContract.Displayname;
|
||||
_Created = pDataContract.Created;
|
||||
_Modell = pDataContract.Modell;
|
||||
_View = pDataContract.View;
|
||||
_Setting = pDataContract.Setting;
|
||||
_Updated = pDataContract.Updated;
|
||||
|
||||
if (pDataContract.Messages is object)
|
||||
_Messages = new AiConversationMessageListVM(pDataContract.Messages);
|
||||
@@ -148,10 +92,7 @@ namespace BeWo.ViewModel
|
||||
protected override AiConversationDC MapToDataContract(AiConversationDC pDataContract, bool doCommit)
|
||||
{
|
||||
pDataContract.Displayname = _Displayname;
|
||||
pDataContract.Created = _Created;
|
||||
pDataContract.Modell = _Modell;
|
||||
pDataContract.View = _View;
|
||||
pDataContract.Setting = _Setting;
|
||||
pDataContract.Updated = _Updated;
|
||||
pDataContract.Messages = _Messages?.CopyToDCList(doCommit);
|
||||
|
||||
return pDataContract;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BeWo.ServiceProxy;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.Extensions;
|
||||
using ChatController.Utilities.Extensions;
|
||||
using DevExpress.Mvvm;
|
||||
@@ -11,6 +12,7 @@ using System.Linq;
|
||||
using System.Runtime.Remoting.Contexts;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace BeWo.ViewModel.ListViewModel
|
||||
@@ -24,20 +26,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -64,6 +53,7 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
FirePropertyChanged(nameof(SelectedModel));
|
||||
}
|
||||
}
|
||||
|
||||
public string MessageInput
|
||||
{
|
||||
get { return _MessageInput; }
|
||||
@@ -90,66 +80,79 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public void SendNewMessage()
|
||||
{
|
||||
var msg = MessageInput;
|
||||
|
||||
var context = ContextInput;
|
||||
|
||||
ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(SelectedVM.CommitToDataContract(), context, msg), (message) =>
|
||||
{
|
||||
SelectedVM.Messages.VMList.Add(new AiConversationMessageVM(message));
|
||||
});
|
||||
}
|
||||
public int UIContext{ get; set; }
|
||||
public List<Tuple<long, long>> ContextBeWoObjects { get; set; }
|
||||
|
||||
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;
|
||||
dc.Displayname = "Example";
|
||||
dc.Modell = SelectedModel?.ToString();
|
||||
public void SendNewMessage()
|
||||
{
|
||||
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()
|
||||
{
|
||||
var limit = 5;
|
||||
throw new NotImplementedException();
|
||||
|
||||
var models = ServiceFacade.DoOperationsEnhancedServiceSnyc(x => x.GetAiModels());
|
||||
Models.MakeEqualTo(models);
|
||||
//var limit = 5;
|
||||
|
||||
VMList.Clear();
|
||||
//var models = ServiceFacade.DoOperationsEnhancedServiceSnyc(x => x.GetAiModels());
|
||||
//Models.MakeEqualTo(models);
|
||||
|
||||
foreach (var vm in Models)
|
||||
{
|
||||
var dc = new AiConversationDC();
|
||||
//VMList.Clear();
|
||||
|
||||
dc.Created = DateTime.Now;
|
||||
dc.Displayname = "Example";
|
||||
dc.Modell = vm.ToString();
|
||||
//foreach (var vm in Models)
|
||||
//{
|
||||
// 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?";
|
||||
var context = "Frau Müller wurde am 1.1.1950 geboren. Aktuelle haben wir folgende Universalzeit: " + DateTime.Now.ToUniversalTime();
|
||||
// VMList.Add(pvm);
|
||||
//}
|
||||
|
||||
for (var i = 0; i < limit; i++)
|
||||
{
|
||||
foreach (var vm in VMList)
|
||||
{
|
||||
ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(vm.CommitToDataContract(), context, msg), (message) =>
|
||||
{
|
||||
vm.Messages.VMList.Add(new AiConversationMessageVM(message));
|
||||
});
|
||||
}
|
||||
}
|
||||
//var msg = "Wie alt ist Frau Müller?";
|
||||
//var context = "Frau Müller wurde am 1.1.1950 geboren. Aktuelle haben wir folgende Universalzeit: " + DateTime.Now.ToUniversalTime();
|
||||
|
||||
//for (var i = 0; i < limit; i++)
|
||||
//{
|
||||
// foreach (var vm in VMList)
|
||||
// {
|
||||
// ServiceFacade.DoOperationsEnhancedServiceAsnyc(x => x.SendNewMessage(vm.CommitToDataContract(), context, msg), (message) =>
|
||||
// {
|
||||
// vm.Messages.VMList.Add(new AiConversationMessageVM(message));
|
||||
// });
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
private bool CanSendNewMessage()
|
||||
|
||||
@@ -1917,5 +1917,28 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,6 +124,11 @@ namespace BeWo.Data.Access
|
||||
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()
|
||||
{
|
||||
return CreateCriteria<T>().Add(Restrictions.Eq(BeWoEntityBase.PropertyName_IsActive, ActivationTypeId.Active)).Add(Restrictions.In(BeWoEntityBase.PropertyName_Oid, pOids.ToArray())).List<T>();
|
||||
|
||||
@@ -217,7 +217,12 @@
|
||||
<Compile Include="Access\UserDAO.cs" />
|
||||
<Compile Include="ASPHibernateSessionManager.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\BeWoEntityReference.cs" />
|
||||
<Compile Include="Entities\CustomerVermittlungArbeit.cs" />
|
||||
<Compile Include="Entities\CustomerWohnhilfe.cs" />
|
||||
<Compile Include="Entities\TwoFactorCode.cs" />
|
||||
@@ -792,6 +797,11 @@
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Mappings\TwoFactorCode.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" />
|
||||
<EmbeddedResource Include="Mappings\ContactHistory.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
28
Data/Entities/AiConversation.cs
Normal file
28
Data/Entities/AiConversation.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
21
Data/Entities/AiConversationMessage.cs
Normal file
21
Data/Entities/AiConversationMessage.cs
Normal 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
19
Data/Entities/AiModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
Data/Entities/AiSetting.cs
Normal file
12
Data/Entities/AiSetting.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
||||
14
Data/Entities/BeWoEntityReference.cs
Normal file
14
Data/Entities/BeWoEntityReference.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
39
Data/Mappings/AiConversation.hbm.xml
Normal file
39
Data/Mappings/AiConversation.hbm.xml
Normal 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>
|
||||
23
Data/Mappings/AiConversationMessage.hbm.xml
Normal file
23
Data/Mappings/AiConversationMessage.hbm.xml
Normal 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>
|
||||
19
Data/Mappings/AiModel.hbm.xml
Normal file
19
Data/Mappings/AiModel.hbm.xml
Normal 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>
|
||||
@@ -260,9 +260,9 @@
|
||||
<appSettings>
|
||||
<add key="AdminServiceIPAddress" value="::1" />
|
||||
<add key="AdminServiceIPAddress2" value="::1" />
|
||||
<add key="AdminServiceAPIKey" value="HasteGedachteWa" />
|
||||
<add key="AdminServiceEnableStackTrace" value="true" />
|
||||
|
||||
<add key="AdminServiceAPIKey" value="HasteGedachteWa" />
|
||||
<add key="AdminServiceEnableStackTrace" value="true" />
|
||||
|
||||
<add key="SendMailOnError" value="false" />
|
||||
<add key="SmptServer" value="mail.ownsoft.de" />
|
||||
<add key="SmtpUser" value="bewoplaner.support@ownsoft.de" />
|
||||
@@ -281,13 +281,13 @@
|
||||
<add key="MaxDocumentSize" value="20971520" />
|
||||
<add key="ICD10File" value="ICD10\icd10.xml" />
|
||||
<add key="FileRootDirectory" value="\BWP-Files" />
|
||||
|
||||
|
||||
<add key="GoogleDistanceMatrixApiUrl" value="https://maps.googleapis.com/maps/api/distancematrix/json" />
|
||||
<add key="GoogleDistanceMatrixApiKey" value="AIzaSyDZ_tfNwm_YWC9JiCLQtHsd9X2OUUKuL0c" />
|
||||
<add key="OpenrouteServiceApiUrl" value="https://api.openrouteservice.org/v2/matrix/driving-car" />
|
||||
<add key="OpenrouteServiceApiUrlGeocode" value="https://api.openrouteservice.org/geocode/search" />
|
||||
<add key="OpenrouteServiceApiKey" value="5b3ce3597851110001cf62484b0917529e9a4008acda819dc06e47e8" />
|
||||
|
||||
|
||||
<add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" />
|
||||
<add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" />
|
||||
<add key="GkvKostentragerdateiFolderPath" value="C:\GkvAbrechnung\KTDatei\" />
|
||||
@@ -302,6 +302,9 @@
|
||||
<add key="SendMailModuleGkvSmtpPassword" value="JJVjJntw2yaRDAxInotF" />
|
||||
<add key="SendMailModuleGkvSender" value="noreply@bewoplaner.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 <> <> <> -->
|
||||
<devExpress>
|
||||
|
||||
60
Model/Changes_2025_04_01 AI Feature.txt
Normal file
60
Model/Changes_2025_04_01 AI Feature.txt
Normal 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;
|
||||
65
Service/DCEntityMapper/AiConversationDC_AiConversation.cs
Normal file
65
Service/DCEntityMapper/AiConversationDC_AiConversation.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Service/DCEntityMapper/AiModelDC_AiModel.cs
Normal file
45
Service/DCEntityMapper/AiModelDC_AiModel.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
to.IsSchedulerAllowed = from.IsSchedulerAllowed;
|
||||
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";
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
// HACK: BankAccount ist neu, alte Clients: from.BankAccount null
|
||||
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.Logo = MapperFactory.ImageDC_Image.MergeWithEntity(from.Logo, to.Logo, false);
|
||||
|
||||
|
||||
@@ -784,7 +784,14 @@ namespace BeWo.Service.DCEntityMapper
|
||||
public static CompactGkvAbrechnungDC_GkvAbrechnung 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();
|
||||
}
|
||||
}
|
||||
@@ -235,6 +235,9 @@
|
||||
<Compile Include="Core\Utils.cs" />
|
||||
<Compile Include="DCEntityMapper\AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint.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\BargeldtransaktionshistoryDC_Bargeldtransaktionshistory.cs" />
|
||||
<Compile Include="DCEntityMapper\CompactGkvAbrechnungDC_GkvAbrechnung.cs" />
|
||||
@@ -538,7 +541,8 @@
|
||||
<Compile Include="ServiceImplementations\UserServiceImp.cs" />
|
||||
<Compile Include="ServiceImplementations\ValueListServiceImp.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\AddressRouteMatrix.cs" />
|
||||
<Compile Include="ServiceUtils\DistanceCalculator\GoogleDistanceMatrixAPI.cs" />
|
||||
@@ -601,11 +605,14 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="AI\system_prompt.txt" />
|
||||
<EmbeddedResource Include="AI\system_prompt1.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="AI\system_prompt2.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="AI\system_prompt3.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
|
||||
@@ -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.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -13,26 +16,22 @@ namespace BeWo.Service.ServiceContracts
|
||||
{
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
object Method1(object input, object input2);
|
||||
|
||||
[RequirePermission(BS.Shared.UserRightType.AiModuleView)]
|
||||
IEnumerable<AiModelDC> GetAiModels();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
object Method2(object input, object input2);
|
||||
|
||||
[RequirePermission(BS.Shared.UserRightType.AiModuleView)]
|
||||
IEnumerable<AiConversationDC> GetAiConversations(int uicontext);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[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))]
|
||||
[OperationContract]
|
||||
object Method4(object input, object input2);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
List<AiModelDC> GetAiModels();
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
AiConversationMessageDC SendNewMessage(AiConversationDC conversation, string context, string input);
|
||||
[RequirePermission(BS.Shared.UserRightType.AiModuleView)]
|
||||
AiConversationMessageDC[] SendNewMessage(long conversation, string message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BeWo.Service.ServiceProxy;
|
||||
using BeWo.Service.ServiceUtils;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.DataContracts.MikePHPContracts;
|
||||
using DevExpress.Entity.Model.Metadata;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -17,111 +21,114 @@ namespace BeWo.Service.ServiceImplementations
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]
|
||||
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>();
|
||||
}
|
||||
if (i == 3)
|
||||
{
|
||||
return ServiceFacade.MikePHPScriptFacade.GetAiModelle();
|
||||
DAOFactory.GenericDAO.Insert(unknown_model);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
var conv = new AiConversation();
|
||||
conv.Created = DateTime.Now;
|
||||
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()
|
||||
{
|
||||
return ServiceFacade.MikePHPScriptFacade.GetAiModelle();
|
||||
}
|
||||
var msg = new AiConversationMessage();
|
||||
msg.Message = system;
|
||||
msg.AiConversation = conv;
|
||||
msg.Role = BS.Shared.AiConversationMessageRole.System;
|
||||
msg.Created = DateTime.Now;
|
||||
|
||||
public AiConversationMessageDC SendNewMessage(AiConversationDC conversation, string context, string input)
|
||||
{
|
||||
var model = conversation.Modell;
|
||||
conv.Messages.Add(msg);
|
||||
|
||||
var dc = new AiConversationMessageDC();
|
||||
DAOFactory.GenericDAO.Insert(conv);
|
||||
|
||||
dc.Context = context;
|
||||
dc.Prompt = input;
|
||||
dc.Model = model;
|
||||
dc.TimeStamp = DateTime.Now;
|
||||
|
||||
var result = ServiceFacade.MikePHPScriptFacade.SendAiRequestComplex(dc);
|
||||
|
||||
dc.Result = result.Response;
|
||||
var dc = MapperFactory.AiConversation.MapToNewDC(conv);
|
||||
|
||||
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) {
|
||||
// if (string.IsNullOrEmpty(endpoint))
|
||||
// continue;
|
||||
DAOFactory.GenericDAO.Update(conv);
|
||||
|
||||
// List<string> data = new List<string>();
|
||||
// if(endpoint == "get_klienten")
|
||||
// {
|
||||
// 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();
|
||||
// }
|
||||
var conv_dc = MapperFactory.AiConversation.MapToNewDC(conv);
|
||||
var user_msg_dc = MapperFactory.AiConversationMessage.MapToNewDC(user_msg);
|
||||
|
||||
// if (data.Count > 0)
|
||||
// {
|
||||
// req.ApiData.Add(new AiMessageRequestData() { Data = data, Name = endpoint });
|
||||
// }
|
||||
//}
|
||||
var result = ServiceFacade.OpenWebUI.SendAiMessageRequest(conv_dc);
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
//dc.Result = result1.Response;
|
||||
var assi_msg_dc = MapperFactory.AiConversationMessage.MapToNewDC(assi_msg);
|
||||
|
||||
//return dc;
|
||||
return new AiConversationMessageDC[] { user_msg_dc, assi_msg_dc };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
103
Service/ServiceProxy/OpenWebUIFacade.cs
Normal file
103
Service/ServiceProxy/OpenWebUIFacade.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace BeWo.Service.ServiceProxy
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
205
Service/ServiceUtils/AiSystemBuilder.cs
Normal file
205
Service/ServiceUtils/AiSystemBuilder.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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:
|
||||
- Verwende ausschließlich die bereitgestellten Daten für deine Antwort.
|
||||
@@ -10,4 +10,3 @@ WICHTIG:
|
||||
|
||||
### **Daten**
|
||||
Du erhälst folgendes:
|
||||
|
||||
|
||||
1
Service/ai/system_prompt3.txt
Normal file
1
Service/ai/system_prompt3.txt
Normal file
@@ -0,0 +1 @@
|
||||
Lets count to infinity. You take my input, add 1 and just return the number. You do nothing more.
|
||||
@@ -179,8 +179,12 @@ namespace BS.Shared
|
||||
TwoFactorCode = 172,
|
||||
CustomerWohnhilfe = 173,
|
||||
AiSettings = 174,
|
||||
SignatureDeletionHistory = 175
|
||||
}
|
||||
SignatureDeletionHistory = 175,
|
||||
AiConversation = 176,
|
||||
AiModel = 177,
|
||||
AiConversationMessage = 178,
|
||||
AiContext2BeWoObject = 179
|
||||
}
|
||||
|
||||
public enum SystemEntryID
|
||||
{
|
||||
@@ -1329,4 +1333,11 @@ namespace BS.Shared
|
||||
Auftragsdatei,
|
||||
Nutzdatendatei
|
||||
}
|
||||
|
||||
public enum AiConversationMessageRole
|
||||
{
|
||||
System,
|
||||
Assistent,
|
||||
User
|
||||
}
|
||||
}
|
||||
@@ -19,48 +19,76 @@ namespace BS.Shared.Core
|
||||
//
|
||||
// GET
|
||||
//
|
||||
protected TRes SendGet<TRes>(string url, string token = null)
|
||||
=> Get<TRes>(url, token);
|
||||
protected Task<TRes> SendGetAsync<TRes>(string url, string token = null)
|
||||
=> GetAsync<TRes>(url, token);
|
||||
protected TRes SendGet<TRes>(string sub_url, string token = null)
|
||||
=> Get<TRes>(sub_url, token);
|
||||
protected Task<TRes> SendGetAsync<TRes>(string sub_url, string token = null)
|
||||
=> GetAsync<TRes>(sub_url, token);
|
||||
|
||||
//
|
||||
// POST
|
||||
//
|
||||
protected TRes SendPost<TReq, TRes>(string url, TReq req, string token = null)
|
||||
=> Send<TReq, TRes>(url, "POST", req, token);
|
||||
protected Task<TRes> SendPostAsync<TReq, TRes>(string url, TReq req, string token = null)
|
||||
=> SendAsync<TReq, TRes>(url, "POST", req, token);
|
||||
protected TRes SendPostUploadString<TReq, TRes>(string sub_url, TReq req, string token = null)
|
||||
=> SendUploadString<TReq, TRes>(sub_url, "POST", req, token);
|
||||
protected TRes SendPostUploadValues<TReq, TRes>(string sub_url, TReq req, string token = null)
|
||||
=> 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
|
||||
//
|
||||
// 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);
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
||||
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 url = getUrl(sub_url);
|
||||
|
||||
string response = await SendAsync(url, method, method, token);
|
||||
string response = await SendUploadValuesAsync(url, method, data, token);
|
||||
|
||||
return deserialize<TRes>(response);
|
||||
}
|
||||
@@ -70,11 +98,15 @@ namespace BS.Shared.Core
|
||||
//
|
||||
private string Get(string url, string token = null)
|
||||
=> 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);
|
||||
private async Task<string> GetAsync(string url, string token = null)
|
||||
=> 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);
|
||||
|
||||
//
|
||||
@@ -135,6 +167,34 @@ namespace BS.Shared.Core
|
||||
{
|
||||
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
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
33
Shared/DataContracts/Feature/AI/AiConversationDC.cs
Normal file
33
Shared/DataContracts/Feature/AI/AiConversationDC.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
Shared/DataContracts/Feature/AI/AiConversationMessageDC.cs
Normal file
18
Shared/DataContracts/Feature/AI/AiConversationMessageDC.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
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()
|
||||
{
|
||||
@@ -20,8 +20,10 @@ namespace BS.Shared.DataContracts
|
||||
Value = value;
|
||||
}
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string ModelName { get; set; }
|
||||
|
||||
[JsonProperty("ollama.details.parameter_size")]
|
||||
public int Value { get; set; }
|
||||
|
||||
public int CompareTo(AiModelDC other)
|
||||
15
Shared/DataContracts/Feature/AI/AiSettingDC.cs
Normal file
15
Shared/DataContracts/Feature/AI/AiSettingDC.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -174,10 +174,10 @@
|
||||
<Compile Include="DataContracts\AbsenceOverviewFilterDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\IAdminServiceDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\AdminServiceSumReqDC.cs" />
|
||||
<Compile Include="DataContracts\AiConversationDC.cs" />
|
||||
<Compile Include="DataContracts\AiConversationMessageDC.cs" />
|
||||
<Compile Include="DataContracts\AiModelDC.cs" />
|
||||
<Compile Include="DataContracts\AiSettingDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiConversationDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiConversationMessageDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiModelDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\AI\AiSettingDC.cs" />
|
||||
<Compile Include="DataContracts\AiSettingsDC.cs" />
|
||||
<Compile Include="DataContracts\AiChatDC.cs" />
|
||||
<Compile Include="DataContracts\AbwesenheitsInformationDC.cs" />
|
||||
@@ -191,29 +191,29 @@
|
||||
<Compile Include="DataContracts\ClientPartials\IMoKSearchableDC.cs" />
|
||||
<Compile Include="DataContracts\Compact\CompactGkvAbrechnungDC.cs" />
|
||||
<Compile Include="DataContracts\CustomerVermittlungArbeitDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvClientRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvClientSumRequestJson.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvClientSumResponseJson.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientSumRequestJson.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientSumResponseJson.cs" />
|
||||
<Compile Include="DataContracts\ImportSupportConceptResultDC.cs" />
|
||||
<Compile Include="DataContracts\CheckObjectDeletionResultDC.cs" />
|
||||
<Compile Include="DataContracts\AppRequestDC.cs" />
|
||||
<Compile Include="DataContracts\AppResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungGetIKRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungGetIKResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetStatusRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetStatusResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvClientResultRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungGetIKRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungGetIKResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetStatusRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetStatusResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvClientResultRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\BankAccountDC.cs" />
|
||||
<Compile Include="DataContracts\MikePHPContracts\AiMessageRequest2.cs" />
|
||||
<Compile Include="DataContracts\MikePHPContracts\AiMessageRequest.cs" />
|
||||
<Compile Include="DataContracts\MikePHPContracts\AiMessageResponse2.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\Wohnhilfe\CustomerWohnhilfeBereichBundDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichEinkommenUndArbeitDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichSozialeKontakteDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeBereichSozialstrukturDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichBundDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichEinkommenUndArbeitDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichSozialeKontakteDC.cs" />
|
||||
<Compile Include="DataContracts\Feature\Wohnhilfe\CustomerWohnhilfeBereichSozialstrukturDC.cs" />
|
||||
<Compile Include="DataContracts\BeWoDataContract.cs" />
|
||||
<Compile Include="DataContracts\HilfeplanImportDC.cs" />
|
||||
<Compile Include="DataContracts\HilfeplanImportZielDC.cs" />
|
||||
@@ -235,22 +235,22 @@
|
||||
<Compile Include="DataContracts\DokumentvorlageDC.cs" />
|
||||
<Compile Include="DataContracts\AdditionalServiceNoticeDC.cs" />
|
||||
<Compile Include="DataContracts\GeschenkterUrlaubstagDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerResultDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerResultXml.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerSendNewResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvTransferProtokollDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetIKRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerGetIKResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvServerSendNewRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungSendResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungSendRequestDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungCreateResponseDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungViewFilterDC.cs" />
|
||||
<Compile Include="DataContracts\GkvAbrechnung\GkvAbrechnungCreateRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerResultDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerResultXml.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerSendNewResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvTransferProtokollDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetIKRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerGetIKResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvServerSendNewRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungSendResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungSendRequestDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungCreateResponseDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungViewFilterDC.cs" />
|
||||
<Compile Include="DataContracts\Invoicing\GkvAbrechnung\GkvAbrechnungCreateRequestDC.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\PreisDC.cs" />
|
||||
<Compile Include="DataContracts\QuittierungsbelegsstatusDC.cs" />
|
||||
|
||||
Reference in New Issue
Block a user