Verwaltung2 update
This commit is contained in:
@@ -63,6 +63,18 @@ namespace BeWo.ServiceProxy
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteineTreeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> GetAiPromptbausteineTree();
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/CreateAiPromptbausteineTree", ReplyAction="http://tempuri.org/IAiEnhancedService/CreateAiPromptbausteineTreeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/CreateAiPromptbausteineTreeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> aiPromptbausteinDC);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteineTree", ReplyAction="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteineTreeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/UpdateAiPromptbausteineTreeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.Dictionary<long, long> UpdateAiPromptbausteineTree(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> aiPromptbausteinDCs);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteineTree", ReplyAction="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteineTreeResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/DeleteAiPromptbausteineTreeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
void DeleteAiPromptbausteineTree(System.Collections.Generic.Dictionary<long, long> oid2version);
|
||||
|
||||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteine", ReplyAction="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteineResponse")]
|
||||
[System.ServiceModel.FaultContractAttribute(typeof(BS.Shared.Core.BeWoFault), Action="http://tempuri.org/IAiEnhancedService/GetAiPromptbausteineBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BS.Shared.Core")]
|
||||
System.Collections.Generic.List<BS.Shared.DataContracts.AiPromptbausteinDC> GetAiPromptbausteine();
|
||||
@@ -176,6 +188,21 @@ namespace BeWo.ServiceProxy
|
||||
return base.Channel.GetAiPromptbausteineTree();
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> aiPromptbausteinDC)
|
||||
{
|
||||
return base.Channel.CreateAiPromptbausteineTree(aiPromptbausteinDC);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.Dictionary<long, long> UpdateAiPromptbausteineTree(System.Collections.Generic.List<BS.Shared.DataContracts.Feature.AI.AiPromptbausteinTreeDC> aiPromptbausteinDCs)
|
||||
{
|
||||
return base.Channel.UpdateAiPromptbausteineTree(aiPromptbausteinDCs);
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteineTree(System.Collections.Generic.Dictionary<long, long> oid2version)
|
||||
{
|
||||
base.Channel.DeleteAiPromptbausteineTree(oid2version);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.List<BS.Shared.DataContracts.AiPromptbausteinDC> GetAiPromptbausteine()
|
||||
{
|
||||
return base.Channel.GetAiPromptbausteine();
|
||||
|
||||
@@ -69,12 +69,12 @@
|
||||
IsEnabled="False"
|
||||
SelectedCompactEmployeeDC="{Binding Node.Creator}" />
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0">Öffentlich</Label>
|
||||
<Label Grid.Row="3" Grid.Column="0">Verborgen</Label>
|
||||
<dxe:CheckEdit
|
||||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Margin="3"
|
||||
IsChecked="{Binding Node.IsPublic}"
|
||||
IsChecked="{Binding Node.IsOnlyForCreator}"
|
||||
IsEnabled="{Binding IsEditingMode, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Button
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BeWo.View.Detail.AI
|
||||
|
||||
DataContext = ViewModel = new AiPromptbausteinTreeViewModel(BeWoApp.MainControl.WindowService);
|
||||
|
||||
Loaded += (s, e) => VMFactory.CreateAiPromptbausteinTreeListAsync(vm => ViewModel.UpdateVMList(vm));
|
||||
Loaded += (s, e) => ViewModel.ReloadVMList();
|
||||
}
|
||||
|
||||
public AiPromptbausteinTreeViewModel ViewModel { get; set; }
|
||||
|
||||
@@ -1,39 +1,49 @@
|
||||
<view:BeWoView x:Class="BeWo.View.Detail.TextbausteinView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:detail="clr-namespace:BeWo.View.Detail"
|
||||
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||
Height="Auto" Width="Auto" HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch" Focusable="True">
|
||||
<view:BeWoView.Resources>
|
||||
<detail:IsOnlyForEmployeeRightsConverter x:Key="IsOnlyForEmployeeRightsConverter" />
|
||||
<detail:TextModuleEditConverter x:Key="TextModuleEditConverter" />
|
||||
<view:BeWoView
|
||||
x:Class="BeWo.View.Detail.TextbausteinView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:detail="clr-namespace:BeWo.View.Detail"
|
||||
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Focusable="True">
|
||||
<view:BeWoView.Resources>
|
||||
<detail:IsOnlyForEmployeeRightsConverter x:Key="IsOnlyForEmployeeRightsConverter" />
|
||||
<detail:TextModuleEditConverter x:Key="TextModuleEditConverter" />
|
||||
</view:BeWoView.Resources>
|
||||
<GroupBox Name="root" Header="Aktuell definierte Textbausteine" Style="{StaticResource ObjectEditGroupBox}">
|
||||
<Grid VerticalAlignment="Stretch">
|
||||
<GroupBox
|
||||
Name="root"
|
||||
Header="Aktuell definierte Textbausteine"
|
||||
Style="{StaticResource ObjectEditGroupBox}">
|
||||
<Grid VerticalAlignment="Stretch">
|
||||
<Grid.Resources>
|
||||
<ContextMenu x:Key="ContextMenuTextModules" MenuItem.Click="ContextMenuTextModules_Click" Opened="ContextMenuTextModules_Opened">
|
||||
<ContextMenu
|
||||
x:Key="ContextMenuTextModules"
|
||||
MenuItem.Click="ContextMenuTextModules_Click"
|
||||
Opened="ContextMenuTextModules_Opened">
|
||||
<MenuItem Header="Neue Textbausteinkategorie">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png"/>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Neuer Textbaustein">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png"/>
|
||||
<Image Source="..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -43,38 +53,104 @@
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Name" />
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Path=NewVM.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="150" />
|
||||
<Label Grid.Column="2" Grid.Row="0" Content="Text" />
|
||||
<TextBox Grid.Column="3" Grid.Row="0" Grid.RowSpan="4" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Text="{Binding Path=NewVM.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=NewVM.IsParent, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolReverseConverter}}" />
|
||||
<Label Grid.Column="0" Grid.Row="1" Content="Textbausteinkategorie" />
|
||||
<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="1" Margin="3" Height="23" Width="150" EditMode="Standalone"
|
||||
ItemsSource="{Binding Path=PossibleTextModuleParents}"
|
||||
SelectedItem="{Binding Path=NewVM.Parent}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="RemoveParentTextModuleFromNewVM_OnClick" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
<Label Grid.Column="0" Grid.Row="2" Content="Leistungskategorie" />
|
||||
<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="2" Margin="3" Height="23" Width="150" EditMode="Standalone"
|
||||
IsEnabled="{Binding Path=NewVM.IsParent, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolReverseConverter}}"
|
||||
ItemsSource="{Binding Path=PossibleCategories}"
|
||||
SelectedItem="{Binding Path=NewVM.ServiceCategory}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="RemoveServiceCategoryFromNewVM_OnClick" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
<CheckBox Grid.Column="0" Grid.Row="3" Content="Ist Textbausteinkategorie" Margin="3" IsChecked="{Binding Path=NewVM.IsParent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Checked="IsTextModuleParent_Checked" />
|
||||
<Button Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="4" HorizontalAlignment="Right" Content="Hinzufügen" Margin="3,3,0,3" Click="AddTextModuleButton_Click" />
|
||||
<dxg:TreeListControl Name="TreeListControl" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="5" dx:ThemeManager.ThemeName="Office2010Black" ItemsSource="{Binding Path=VMList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0" ContextMenu="{StaticResource ContextMenuTextModules}"
|
||||
ItemsSourceChanged="TreeListControl_ItemsSourceChanged"
|
||||
PreviewMouseDown="TreeListControl_OnPreviewMouseDown">
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Content="Name" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Text="{Binding Path=NewVM.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Content="Text" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="4"
|
||||
Grid.Column="3"
|
||||
AcceptsReturn="True"
|
||||
IsEnabled="{Binding Path=NewVM.IsParent, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolReverseConverter}}"
|
||||
Text="{Binding Path=NewVM.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Content="Textbausteinkategorie" />
|
||||
<dxe:ComboBoxEdit
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Height="23"
|
||||
Margin="3"
|
||||
EditMode="Standalone"
|
||||
ItemsSource="{Binding Path=PossibleTextModuleParents}"
|
||||
SelectedItem="{Binding Path=NewVM.Parent}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo Click="RemoveParentTextModuleFromNewVM_OnClick" GlyphKind="Cancel" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
<Label
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Content="Leistungskategorie" />
|
||||
<dxe:ComboBoxEdit
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Height="23"
|
||||
Margin="3"
|
||||
EditMode="Standalone"
|
||||
IsEnabled="{Binding Path=NewVM.IsParent, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolReverseConverter}}"
|
||||
ItemsSource="{Binding Path=PossibleCategories}"
|
||||
SelectedItem="{Binding Path=NewVM.ServiceCategory}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo Click="RemoveServiceCategoryFromNewVM_OnClick" GlyphKind="Cancel" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
<CheckBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="3"
|
||||
Checked="IsTextModuleParent_Checked"
|
||||
Content="Ist Textbausteinkategorie"
|
||||
IsChecked="{Binding Path=NewVM.IsParent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="3,3,0,3"
|
||||
HorizontalAlignment="Right"
|
||||
Click="AddTextModuleButton_Click"
|
||||
Content="Hinzufügen" />
|
||||
<dxg:TreeListControl
|
||||
Name="TreeListControl"
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="0"
|
||||
dx:ThemeManager.ThemeName="Office2010Black"
|
||||
ContextMenu="{StaticResource ContextMenuTextModules}"
|
||||
ItemsSource="{Binding Path=VMList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSourceChanged="TreeListControl_ItemsSourceChanged"
|
||||
PreviewMouseDown="TreeListControl_OnPreviewMouseDown">
|
||||
<dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListColumn FieldName="IsDeleteable" FixedWidth="True" Width="24" ReadOnly="True" Header=" ">
|
||||
<dxg:TreeListColumn
|
||||
Width="24"
|
||||
FieldName="IsDeleteable"
|
||||
FixedWidth="True"
|
||||
Header=" "
|
||||
ReadOnly="True">
|
||||
<dxg:TreeListColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="r" Click="DeleteButton_Click" FontFamily="Webdings" Width="18" Height="18" VerticalAlignment="Center">
|
||||
<Button
|
||||
Width="18"
|
||||
Height="18"
|
||||
VerticalAlignment="Center"
|
||||
Click="DeleteButton_Click"
|
||||
Content="r"
|
||||
FontFamily="Webdings">
|
||||
<Button.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
@@ -88,7 +164,10 @@
|
||||
<dxg:TreeListColumn FieldName="Name">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit EditMode="InplaceInactive" FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit
|
||||
EditMode="InplaceInactive"
|
||||
FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
@@ -100,7 +179,11 @@
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}" Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit
|
||||
x:Name="PART_Editor"
|
||||
EditMode="InplaceActive"
|
||||
FontWeight="{Binding Path=DataContext.RowData.Row.FontWeight, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Text="{Binding Path=DataContext.RowData.Row.Name, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<dxe:TextEdit.IsEnabled>
|
||||
<MultiBinding Converter="{StaticResource TextModuleEditConverter}">
|
||||
<Binding />
|
||||
@@ -114,30 +197,53 @@
|
||||
<dxg:TreeListColumn FieldName="Text">
|
||||
<dxg:TreeListColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<dxe:TextEdit x:Name="PART_Editor" EditMode="InplaceActive" Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}" AcceptsReturn="True" AcceptsTab="True" TextTrimming="WordEllipsis" TextWrapping="Wrap" SelectAllOnGotFocus="False" SelectAllOnMouseUp="False" />
|
||||
<dxe:TextEdit
|
||||
x:Name="PART_Editor"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
EditMode="InplaceActive"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row, Converter={StaticResource IsOnlyForEmployeeRightsConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectAllOnGotFocus="False"
|
||||
SelectAllOnMouseUp="False"
|
||||
Text="{Binding Path=DataContext.RowData.Row.Text, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextTrimming="WordEllipsis"
|
||||
TextWrapping="Wrap" />
|
||||
</DataTemplate>
|
||||
</dxg:TreeListColumn.CellTemplate>
|
||||
</dxg:TreeListColumn>
|
||||
<dxg:TreeListColumn FieldName="ServiceCategory" Header="Leistungskategorie" AllowEditing="{Binding Path=DataContext.RowData.Row, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxg:TreeListColumn
|
||||
AllowEditing="{Binding Path=DataContext.RowData.Row, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
FieldName="ServiceCategory"
|
||||
Header="Leistungskategorie">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit EditMode="InplaceActive" IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxe:ComboBoxEdit
|
||||
EditMode="InplaceActive"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="RemoveServiceCategory_OnClick" Tag="{Binding}" />
|
||||
<dxe:ButtonInfo
|
||||
Click="RemoveServiceCategory_OnClick"
|
||||
GlyphKind="Cancel"
|
||||
Tag="{Binding}" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit x:Name="PART_Editor" EditMode="InplaceActive" IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxe:ComboBoxEdit
|
||||
x:Name="PART_Editor"
|
||||
EditMode="InplaceActive"
|
||||
IsEnabled="{Binding Path=DataContext.RowData.Row.IsParent, Converter={StaticResource BoolReverseConverter}, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleCategories, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.ServiceCategory, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="RemoveServiceCategory_OnClick" Tag="{Binding}" />
|
||||
<dxe:ButtonInfo
|
||||
Click="RemoveServiceCategory_OnClick"
|
||||
GlyphKind="Cancel"
|
||||
Tag="{Binding}" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
</ControlTemplate>
|
||||
@@ -146,28 +252,39 @@
|
||||
<dxg:TreeListColumn FieldName="Parent" Header="Textbausteinkategorie">
|
||||
<dxg:TreeListColumn.DisplayTemplate>
|
||||
<ControlTemplate>
|
||||
<dxe:ComboBoxEdit EditMode="InplaceActive" IsTextEditable="False"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleTextModuleParents, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.Parent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Tag="{Binding Path=DataContext.RowData.Row, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Loaded="FrameworkElement_OnLoaded">
|
||||
<dxe:ComboBoxEdit
|
||||
EditMode="InplaceActive"
|
||||
IsTextEditable="False"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleTextModuleParents, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
Loaded="FrameworkElement_OnLoaded"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.Parent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Tag="{Binding Path=DataContext.RowData.Row, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="ButtonInfo_OnClick" Tag="{Binding}" />
|
||||
<dxe:ButtonInfo
|
||||
Click="ButtonInfo_OnClick"
|
||||
GlyphKind="Cancel"
|
||||
Tag="{Binding}" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
</ControlTemplate>
|
||||
</dxg:TreeListColumn.DisplayTemplate>
|
||||
<dxg:TreeListColumn.EditTemplate>
|
||||
<ControlTemplate>
|
||||
<!-- Textbausteinkategorie -->
|
||||
<dxe:ComboBoxEdit x:Name="PART_Editor" EditMode="InplaceActive" IsTextEditable="False"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleTextModuleParents, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.Parent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
EditValueChanged="PART_Editor_OnEditValueChanged"
|
||||
Tag="{Binding Path=DataContext.RowData.Row, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Loaded="FrameworkElement_OnLoaded">
|
||||
<!-- Textbausteinkategorie -->
|
||||
<dxe:ComboBoxEdit
|
||||
x:Name="PART_Editor"
|
||||
EditMode="InplaceActive"
|
||||
EditValueChanged="PART_Editor_OnEditValueChanged"
|
||||
IsTextEditable="False"
|
||||
ItemsSource="{Binding Path=DataContext.PossibleTextModuleParents, RelativeSource={RelativeSource FindAncestor, AncestorType=dxg:TreeListControl}}"
|
||||
Loaded="FrameworkElement_OnLoaded"
|
||||
SelectedItem="{Binding Path=DataContext.RowData.Row.Parent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
||||
Tag="{Binding Path=DataContext.RowData.Row, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
|
||||
<dxe:ComboBoxEdit.Buttons>
|
||||
<dxe:ButtonInfo GlyphKind="Cancel" Click="ButtonInfo_OnClick" Tag="{Binding}" />
|
||||
<dxe:ButtonInfo
|
||||
Click="ButtonInfo_OnClick"
|
||||
GlyphKind="Cancel"
|
||||
Tag="{Binding}" />
|
||||
</dxe:ComboBoxEdit.Buttons>
|
||||
</dxe:ComboBoxEdit>
|
||||
</ControlTemplate>
|
||||
@@ -175,11 +292,14 @@
|
||||
</dxg:TreeListColumn>
|
||||
</dxg:TreeListControl.Columns>
|
||||
<dxg:TreeListControl.View>
|
||||
<dxg:TreeListView Name="TreeListView" AutoWidth="True" KeyFieldName="KeyField" ParentFieldName="ParentField"
|
||||
ExpandStateBinding="{Binding Path=IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
/>
|
||||
<dxg:TreeListView
|
||||
Name="TreeListView"
|
||||
AutoWidth="True"
|
||||
ExpandStateBinding="{Binding Path=IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
KeyFieldName="KeyField"
|
||||
ParentFieldName="ParentField" />
|
||||
</dxg:TreeListControl.View>
|
||||
</dxg:TreeListControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</GroupBox>
|
||||
</view:BeWoView>
|
||||
|
||||
@@ -48,12 +48,6 @@ namespace BeWo.ViewModel
|
||||
set => SetProperty(ref _Content, value, nameof(Content), () => DataContract.Content);
|
||||
}
|
||||
|
||||
public ActivationTypeId ActivationType
|
||||
{
|
||||
get => _ActivationType;
|
||||
set => SetProperty(ref _ActivationType, value, nameof(ActivationType), () => DataContract.ActivationType);
|
||||
}
|
||||
|
||||
public AiPromptbausteinType PromptbausteinType
|
||||
{
|
||||
get => _PromptbausteinType;
|
||||
@@ -114,6 +108,8 @@ namespace BeWo.ViewModel
|
||||
set => SetProperty(ref _Children, value, nameof(Children));
|
||||
}
|
||||
|
||||
public bool HasChildren => Children is object && Children.Count > 0;
|
||||
|
||||
public FontWeight FontWeight => PromptbausteinType != AiPromptbausteinType.Prompt ? FontWeights.Bold : FontWeights.Regular;
|
||||
|
||||
public AiPromptbausteinTreeVM Parent { get; set; }
|
||||
@@ -125,7 +121,6 @@ namespace BeWo.ViewModel
|
||||
|
||||
_Displayname = pDataContract.Displayname;
|
||||
_Content = pDataContract.Content;
|
||||
_ActivationType = pDataContract.ActivationType;
|
||||
_PromptbausteinType = pDataContract.PromptbausteinType;
|
||||
_Metadata = pDataContract.Metadata;
|
||||
_AiActionType = pDataContract.AiActionType;
|
||||
@@ -143,7 +138,6 @@ namespace BeWo.ViewModel
|
||||
{
|
||||
pDataContract.Displayname = _Displayname;
|
||||
pDataContract.Content = _Content;
|
||||
pDataContract.ActivationType = _ActivationType;
|
||||
pDataContract.PromptbausteinType = _PromptbausteinType;
|
||||
pDataContract.Metadata = _Metadata;
|
||||
pDataContract.AiActionType = _AiActionType;
|
||||
@@ -153,6 +147,7 @@ namespace BeWo.ViewModel
|
||||
pDataContract.ShowUserPromptByTenant = _ShowUserPromptByTenant;
|
||||
pDataContract.Position = _Position;
|
||||
pDataContract.IsExpanded = _IsExpanded;
|
||||
pDataContract.ParentOid = Parent?.DataContract.Oid;
|
||||
|
||||
if (_Children != null)
|
||||
{
|
||||
@@ -168,7 +163,6 @@ namespace BeWo.ViewModel
|
||||
|
||||
rtn.Displayname = _Displayname;
|
||||
rtn.Content = _Content;
|
||||
rtn.ActivationType = _ActivationType;
|
||||
rtn.PromptbausteinType = _PromptbausteinType;
|
||||
rtn.Metadata = _Metadata;
|
||||
rtn.AiActionType = _AiActionType;
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
public event EventHandler SelectedVMChanged;
|
||||
|
||||
public int Count => VMList.Count;
|
||||
|
||||
public virtual int AddedCount
|
||||
{
|
||||
get
|
||||
|
||||
@@ -22,54 +22,6 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
}
|
||||
}
|
||||
|
||||
//public override int AddedCount
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// var base_value = base.AddedCount;
|
||||
|
||||
// foreach (var vm in VMList)
|
||||
// {
|
||||
// if (vm.Children is object)
|
||||
// base_value += vm.Children.AddedCount;
|
||||
// }
|
||||
|
||||
// return base_value;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public override int ChangedCount
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// var base_value = base.ChangedCount;
|
||||
|
||||
// foreach (var vm in VMList)
|
||||
// {
|
||||
// if (vm.Children is object)
|
||||
// base_value += vm.Children.ChangedCount;
|
||||
// }
|
||||
|
||||
// return base_value;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public override int RemovedCount
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// var base_value = base.RemovedCount;
|
||||
|
||||
// foreach (var vm in VMList)
|
||||
// {
|
||||
// if(vm.Children is object)
|
||||
// base_value += vm.Children.RemovedCount;
|
||||
// }
|
||||
|
||||
// return base_value;
|
||||
// }
|
||||
//}
|
||||
|
||||
public bool ContainsDirtyNode()
|
||||
{
|
||||
if (IsDirty)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using BeWo.Services;
|
||||
using BeWo.ServiceProxy;
|
||||
using BeWo.Services;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.Extensions.CustomInterfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -24,7 +26,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
}
|
||||
|
||||
Func<bool> canAddPrompt = () => SelectedNode.IsOrdner() || SelectedNode.IsKette();
|
||||
Func<bool> canAddOrdner = () => SelectedNode.IsOrdner();
|
||||
Func<bool> canAddOrdner = () => SelectedNode.IsOrdner() || true;
|
||||
Func<bool> canAddKette = () => SelectedNode.IsOrdner() && false;
|
||||
Func<bool> canEdit = () => SelectedNode is object;
|
||||
Func<bool> canCopy = () => SelectedNode.IsKette() || SelectedNode.IsOrdner();
|
||||
@@ -81,9 +83,43 @@ namespace BeWo.ViewModel.View.Administration
|
||||
|
||||
public void SaveVMList()
|
||||
{
|
||||
// BFS -> 1. Sobald Knoten gefunden wird mit IsNew=true: Teilbaum als neu markieren
|
||||
if (!IsDirty)
|
||||
return;
|
||||
|
||||
// DFS -> 1. Sobald Knoten gefunden wird mit IsNew=true: Teilbaum als neu markieren
|
||||
// 2. Sobald Knoten gefunden wird mit IsNew=false && IsDirty=true: Knoten als update markieren
|
||||
// 3. Checken, welche Knoten gelöscht wurden
|
||||
|
||||
var toadd = new List<AiPromptbausteinTreeVM>();
|
||||
var toupdate = new List<AiPromptbausteinTreeVM>();
|
||||
DFS_Search_AddUpdate(ListVM, ref toadd, ref toupdate);
|
||||
|
||||
var todelete = new List<AiPromptbausteinTreeDC>();
|
||||
DFS_Search_Delete(ListVM, ref todelete);
|
||||
|
||||
var toadd_dcs = toadd.Select(x => x.CommitToDataContract());
|
||||
var toupdate_dcs = toupdate.Select(x => x.CommitToDataContract());
|
||||
|
||||
var actions = new List<Action<IAiEnhancedService>>();
|
||||
|
||||
if (toadd_dcs.Any())
|
||||
actions.Add(x => x.CreateAiPromptbausteineTree(toadd_dcs.ToList()));
|
||||
|
||||
if (toupdate_dcs.Any())
|
||||
actions.Add(x => x.UpdateAiPromptbausteineTree(toupdate_dcs.ToList()));
|
||||
|
||||
if (todelete.Any())
|
||||
actions.Add(x => x.DeleteAiPromptbausteineTree(todelete.ToDictionary(x1 => x1.Oid.Value, x2 => x2.Version.Value)));
|
||||
|
||||
ServiceFacade.DoMultipleAiEnhancedServicesAsync(actions, () =>
|
||||
{
|
||||
ReloadVMList();
|
||||
});
|
||||
}
|
||||
|
||||
internal void ReloadVMList()
|
||||
{
|
||||
VMFactory.CreateAiPromptbausteinTreeListAsync(vm => UpdateVMList(vm));
|
||||
}
|
||||
public void UpdateVMList(AiPromptbausteinTreeListVM new_list)
|
||||
{
|
||||
@@ -165,5 +201,40 @@ namespace BeWo.ViewModel.View.Administration
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DFS_Search_AddUpdate(AiPromptbausteinTreeListVM search, ref List<AiPromptbausteinTreeVM> toAdd, ref List<AiPromptbausteinTreeVM> toUpdate)
|
||||
{
|
||||
foreach (var node in search.VMList)
|
||||
{
|
||||
if (node.IsNew)
|
||||
{
|
||||
toAdd.Add(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node.IsDirty)
|
||||
toUpdate.Add(node);
|
||||
|
||||
if (node.HasChildren)
|
||||
DFS_Search_AddUpdate(node.Children, ref toAdd, ref toUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DFS_Search_Delete(AiPromptbausteinTreeListVM search, ref List<AiPromptbausteinTreeDC> toDelete)
|
||||
{
|
||||
foreach(var node_dc in search.DCBackup)
|
||||
{
|
||||
if (search.VMList.FirstOrDefault(vm => vm.DataContract == node_dc) is AiPromptbausteinTreeVM node_vm)
|
||||
{
|
||||
if (node_vm.Children.DCBackup is object && node_vm.Children.DCBackup.Count > 0)
|
||||
DFS_Search_Delete(node_vm.Children, ref toDelete);
|
||||
}
|
||||
else
|
||||
{
|
||||
toDelete.Add(node_dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2778,6 +2778,14 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{
|
||||
return criteria.List<TextModule>();
|
||||
}
|
||||
|
||||
public IEnumerable<AiPromptbausteinTree> GetActiveRootAiPromptbausteine()
|
||||
{
|
||||
var criteria = CreateCriteriaIsActive<AiPromptbausteinTree>()
|
||||
.Add(Restrictions.IsNull(nameof(AiPromptbausteinTree.ParentOid)));
|
||||
|
||||
return criteria.List<AiPromptbausteinTree>();
|
||||
}
|
||||
|
||||
public IEnumerable<AiPromptbaustein> GetActiveAiPromptbausteine(bool shouldOnlyLoadOwnAiPromptbausteine, bool hasRightToSeeOther, bool isInAdministrationView, long employeeOid)
|
||||
{
|
||||
var criteria = CreateCriteriaIsActive<AiPromptbaustein>();
|
||||
|
||||
@@ -239,6 +239,7 @@
|
||||
<Compile Include="Entities\AiConfig.cs" />
|
||||
<Compile Include="Entities\AiPromptbaustein.cs" />
|
||||
<Compile Include="Entities\AiModel.cs" />
|
||||
<Compile Include="Entities\AiPromptbausteinTree.cs" />
|
||||
<Compile Include="Entities\AiSetting.cs" />
|
||||
<Compile Include="Entities\AbsenceTimeHistory.cs" />
|
||||
<Compile Include="Entities\AiSettings.cs" />
|
||||
@@ -459,6 +460,7 @@
|
||||
<Compile Include="Entities\Person.cs" />
|
||||
<Compile Include="UpdInsInterceptor.cs" />
|
||||
<Compile Include="Utils\AppointmentSearchResult.cs" />
|
||||
<Compile Include="Utils\BeWoEntityExtension.cs" />
|
||||
<Compile Include="Utils\ServiceRecord2SignatureStates.cs" />
|
||||
<Compile Include="Utils\IntervalFinderHelper.cs" />
|
||||
<Compile Include="Utils\SignatureStateInfoFromServiceRecordHistoryEntry.cs" />
|
||||
@@ -861,6 +863,9 @@
|
||||
<EmbeddedResource Include="Mappings\AiPromptbaustein.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Mappings\AiPromptbausteinTree.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Content Include="Mappings\Timesheet2Mail.hbm.xml" />
|
||||
<EmbeddedResource Include="Mappings\ContactHistory.hbm.xml">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
45
Data/Entities/AiPromptbausteinTree.cs
Normal file
45
Data/Entities/AiPromptbausteinTree.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using BS.Shared.Interface;
|
||||
|
||||
namespace BeWo.Data.Entities
|
||||
{
|
||||
public class AiPromptbausteinTree : BeWoEntityBase, IAiPromptbaustein
|
||||
{
|
||||
public AiPromptbausteinTree()
|
||||
{
|
||||
_Tid = TableID.AiPromptbausteinTree;
|
||||
}
|
||||
|
||||
public virtual string Displayname { get; set; }
|
||||
|
||||
public virtual string Content { get; set; }
|
||||
|
||||
public virtual AiPromptbausteinType PromptbausteinType { get; set; }
|
||||
|
||||
public virtual string Metadata { get; set; }
|
||||
|
||||
public virtual AiActionType AiActionType { get; set; }
|
||||
|
||||
public virtual Employee Creator { get; set; }
|
||||
|
||||
public virtual bool IsOnlyForCreator { get; set; }
|
||||
|
||||
public virtual bool ShowUserPrompt { get; set; }
|
||||
|
||||
public virtual bool ShowUserPromptByTenant { get; set; }
|
||||
|
||||
public virtual int Position { get; set; }
|
||||
|
||||
public virtual bool IsExpanded { get; set; }
|
||||
|
||||
public virtual IList<AiPromptbausteinTree> Children { get; set; } = new List<AiPromptbausteinTree>();
|
||||
|
||||
public virtual long? ParentOid { get; set; }
|
||||
}
|
||||
}
|
||||
35
Data/Mappings/AiPromptbausteinTree.hbm.xml
Normal file
35
Data/Mappings/AiPromptbausteinTree.hbm.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
|
||||
<class name="BeWo.Data.Entities.AiPromptbausteinTree,BeWo.Data" table="aipromptbausteintree">
|
||||
<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="Content"/>
|
||||
<property name="PromptbausteinType" type="BS.Shared.AiPromptbausteinType, BS.Shared"/>
|
||||
<property name="Metadata"/>
|
||||
<property name="AiActionType" type="BS.Shared.AiActionType, BS.Shared"/>
|
||||
<property name="IsOnlyForCreator"/>
|
||||
<property name="ShowUserPrompt"/>
|
||||
<property name="ShowUserPromptByTenant"/>
|
||||
<property name="Position"/>
|
||||
<property name="IsExpanded"/>
|
||||
<property name="ParentOid"/>
|
||||
|
||||
<many-to-one name="Creator" column="CreatorOid" class="BeWo.Data.Entities.Employee,BeWo.Data" cascade="none" fetch="join"/>
|
||||
|
||||
<bag name="Children" table="aipromptbausteintree" generic="true" cascade="all-delete-orphan" batch-size="250" where="IsActive = 1">
|
||||
<key column="ParentOid" />
|
||||
<one-to-many class="BeWo.Data.Entities.AiPromptbausteinTree, BeWo.Data" />
|
||||
</bag>
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
15
Data/Utils/BeWoEntityExtension.cs
Normal file
15
Data/Utils/BeWoEntityExtension.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using BeWo.Data.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BeWo.Data.Utils
|
||||
{
|
||||
public static class BeWoEntityExtension
|
||||
{
|
||||
public static Dictionary<long, long> ToOidVersionDictionary(this IEnumerable<BeWoEntityBase> entities)
|
||||
=> entities.ToDictionary(x => x.Oid.Value, x => x.Version.Value);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
to.Content = from.Text;
|
||||
to.Displayname = from.Name;
|
||||
//dataContract.IsOnlyForEmployee = entity.IsOnlyForEmployee;
|
||||
to.ActivationType = from.IsActive;
|
||||
//to.ActivationType = from.IsActive;
|
||||
|
||||
if (from.Employee != null)
|
||||
to.Creator = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(from.Employee);
|
||||
@@ -32,7 +32,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
to.Text = from.Content;
|
||||
to.Name = from.Displayname;
|
||||
//to.IsOnlyForEmployee = from.IsOnlyForEmployee;
|
||||
to.IsActive = from.ActivationType;
|
||||
//to.IsActive = from.ActivationType;
|
||||
|
||||
if (from.Creator != null)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
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 AiPromptbausteinTreeDC_AiPromptbausteinTree : BeWoDataContract_BeWoEntityBase<AiPromptbausteinTree, AiPromptbausteinTreeDC>
|
||||
{
|
||||
public override AiPromptbausteinTreeDC MergeWithDC(AiPromptbausteinTree pEntity, AiPromptbausteinTreeDC pDataContract)
|
||||
{
|
||||
base.MergeWithDC(pEntity, pDataContract);
|
||||
|
||||
pDataContract.Displayname = pEntity.Displayname;
|
||||
pDataContract.Content = pEntity.Content;
|
||||
pDataContract.PromptbausteinType = pEntity.PromptbausteinType;
|
||||
pDataContract.Metadata = pEntity.Metadata;
|
||||
pDataContract.AiActionType = pEntity.AiActionType;
|
||||
pDataContract.IsOnlyForCreator = pEntity.IsOnlyForCreator;
|
||||
pDataContract.ShowUserPrompt = pEntity.ShowUserPrompt;
|
||||
pDataContract.ShowUserPromptByTenant = pEntity.ShowUserPromptByTenant;
|
||||
pDataContract.Position = pEntity.Position;
|
||||
pDataContract.IsExpanded = pEntity.IsExpanded;
|
||||
pDataContract.ParentOid = pEntity.ParentOid;
|
||||
|
||||
if (pEntity.Creator is object)
|
||||
pDataContract.Creator = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Creator);
|
||||
|
||||
if(pEntity.Children is object)
|
||||
pDataContract.Children = MapperFactory.AiPromptbausteinTreeTree.MapToNewDCs(pEntity.Children);
|
||||
else
|
||||
pDataContract.Children = new List<AiPromptbausteinTreeDC>();
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override AiPromptbausteinTree MergeWithEntity(AiPromptbausteinTreeDC pDataContract, AiPromptbausteinTree pEntity)
|
||||
{
|
||||
base.MergeWithDC(pEntity, pDataContract);
|
||||
|
||||
pEntity.Displayname = pDataContract.Displayname;
|
||||
pEntity.Content = pDataContract.Content;
|
||||
pEntity.PromptbausteinType = pDataContract.PromptbausteinType;
|
||||
//pEntity.Metadata = pDataContract.Metadata;
|
||||
pEntity.AiActionType = pDataContract.AiActionType;
|
||||
pEntity.IsOnlyForCreator = pDataContract.IsOnlyForCreator;
|
||||
//pEntity.ShowUserPrompt = pDataContract.ShowUserPrompt;
|
||||
pEntity.ShowUserPromptByTenant = pDataContract.ShowUserPromptByTenant;
|
||||
pEntity.Position = pDataContract.Position;
|
||||
//pEntity.IsExpanded = pDataContract.IsExpanded;
|
||||
pEntity.ParentOid = pDataContract.ParentOid;
|
||||
|
||||
MapperFactory.AiPromptbausteinTreeTree.MergeWithEntitys(pDataContract.Children, pEntity.Children);
|
||||
|
||||
if (pDataContract.Creator != null)
|
||||
pEntity.Creator = DAOFactory.GenericDAO.LoadByID<Employee>(pDataContract.Creator.EmployeeOid);
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -818,6 +818,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
public static AiModelDC_AiModel AiModel { get; } = new AiModelDC_AiModel();
|
||||
public static AiConfigDC_AiConfig AiConfig { get; } = new AiConfigDC_AiConfig();
|
||||
public static AiPromptbausteinTreeDC_AiPromptbaustein AiPromptbausteinTree { get; } = new AiPromptbausteinTreeDC_AiPromptbaustein();
|
||||
public static AiPromptbausteinTreeDC_AiPromptbausteinTree AiPromptbausteinTreeTree { get; } = new AiPromptbausteinTreeDC_AiPromptbausteinTree();
|
||||
public static AddressDC_Address Address { get; } = new AddressDC_Address();
|
||||
public static GkvAbrechnungLightDC_GkvAbrechnungLight GkvAbrechnungLight { get; } = new GkvAbrechnungLightDC_GkvAbrechnungLight();
|
||||
public static GkvTransferProtokollLightDC_GkvTransferprotokollLight GkvTransferprotokollLight { get; } = new GkvTransferProtokollLightDC_GkvTransferprotokollLight();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Data.Utils;
|
||||
using BeWo.Service.Core;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared.DataContracts;
|
||||
@@ -22,9 +23,9 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
public IEnumerable<AiPromptbausteinTreeDC> GetAiPromptbausteineTree()
|
||||
{
|
||||
var allAiPromptbausteine = DAOFactory.GenericDAO.GetAll<AiPromptbaustein>();
|
||||
var dcs = MapperFactory.AiPromptbausteinTree.MapToNewDCs(allAiPromptbausteine);
|
||||
//return dcs;
|
||||
var roots = DAOFactory.SearchDAO.GetActiveRootAiPromptbausteine();
|
||||
var dcs = MapperFactory.AiPromptbausteinTreeTree.MapToNewDCs(roots);
|
||||
return dcs;
|
||||
|
||||
var predefined = new PredefinedAiPromptbausteine();
|
||||
return predefined.GetFullPromptbausteineTree();
|
||||
@@ -32,11 +33,11 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
public IEnumerable<AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs)
|
||||
{
|
||||
var aiPromptbausteine = MapperFactory.AiPromptbausteinTree.MapToNewEntities(aiPromptbausteinDCs);
|
||||
var aiPromptbausteine = MapperFactory.AiPromptbausteinTreeTree.MapToNewEntities(aiPromptbausteinDCs);
|
||||
|
||||
DAOFactory.GenericDAO.Insert(aiPromptbausteine);
|
||||
|
||||
var dcs = MapperFactory.AiPromptbausteinTree.MapToNewDCs(aiPromptbausteine);
|
||||
var dcs = MapperFactory.AiPromptbausteinTreeTree.MapToNewDCs(aiPromptbausteine);
|
||||
|
||||
return dcs;
|
||||
}
|
||||
@@ -54,21 +55,13 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
public Dictionary<long, long> UpdateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs)
|
||||
{
|
||||
var aiPromptbausteine = MapperFactory.AiPromptbausteinTree.MapToNewEntities(aiPromptbausteinDCs);
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinTree>(aiPromptbausteinDCs.Select(sc => sc.Oid.Value));
|
||||
var aiPromptbausteinDCs2 = aiPromptbausteinDCs.ToList();
|
||||
MapperFactory.AiPromptbausteinTreeTree.MergeWithEntitys(aiPromptbausteinDCs2, originale);
|
||||
|
||||
/*
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbaustein>(aiPromptbausteinDCs.Select(sc => sc.Oid.Value));
|
||||
foreach (var item in aiPromptbausteinDCs)
|
||||
{
|
||||
item.ActivationType = ActivationTypeId.Active;
|
||||
}
|
||||
MapperFactory.AiPromptbausteinTree.MergeWithEntitys(aiPromptbausteinDCs, originale);
|
||||
*/
|
||||
DAOFactory.GenericDAO.Update(originale);
|
||||
|
||||
DAOFactory.GenericDAO.Update(aiPromptbausteine);
|
||||
|
||||
// todo: dictionary erstellen
|
||||
throw new System.NotImplementedException();
|
||||
return originale.ToOidVersionDictionary();
|
||||
}
|
||||
|
||||
public Dictionary<long, long> UpdateAiPromptbausteine(IEnumerable<AiPromptbausteinDC> aiPromptbausteinDCs)
|
||||
@@ -90,6 +83,14 @@ namespace BeWo.Service.Plugins
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteineTree(Dictionary<long, long> oid2version)
|
||||
{
|
||||
var originale = DAOFactory.GenericDAO.LoadByIDs<AiPromptbausteinTree>(oid2version.Select(e => e.Key));
|
||||
originale.DoForEach(or => MapperFactory.AiPromptbausteinTreeTree.ConcurrencyCheck(oid2version[or.Oid.Value], or));
|
||||
|
||||
DAOFactory.GenericDAO.SetActivationType(originale, BS.Shared.ActivationTypeId.Deleted);
|
||||
}
|
||||
|
||||
public void DeleteAiPromptbausteine(Dictionary<long, long> oid2version)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -242,6 +242,7 @@
|
||||
<Compile Include="DCEntityMapper\AiConfigDC_AiConfig.cs" />
|
||||
<Compile Include="DCEntityMapper\AiModelDC_AiModel.cs" />
|
||||
<Compile Include="DCEntityMapper\AiPromptbausteinTreeDC_AiPromptbaustein.cs" />
|
||||
<Compile Include="DCEntityMapper\AiPromptbausteinTreeDC_AiPromptbausteinTree.cs" />
|
||||
<Compile Include="DCEntityMapper\BankAccountDC_BankAccount.cs" />
|
||||
<Compile Include="DCEntityMapper\BargeldtransaktionshistoryDC_Bargeldtransaktionshistory.cs" />
|
||||
<Compile Include="DCEntityMapper\BeWoDataContract_BeWoEntityBase.cs" />
|
||||
|
||||
@@ -72,20 +72,20 @@ namespace BeWo.Service.ServiceContracts.Enhanced
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineView)]
|
||||
IEnumerable<AiPromptbausteinTreeDC> GetAiPromptbausteineTree();
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineAdd)]
|
||||
//IEnumerable<AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDC);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
//Dictionary<long, long> UpdateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs);
|
||||
|
||||
//[FaultContract(typeof(BeWoFault))]
|
||||
//[OperationContract]
|
||||
//[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineRemove)]
|
||||
//void DeleteAiPromptbausteineTree(Dictionary<long, long> oid2version);
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineAdd)]
|
||||
IEnumerable<AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDC);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineEdit)]
|
||||
Dictionary<long, long> UpdateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
[RequireWcfAuthorization(UserRightType.AiModulePromptbausteineRemove)]
|
||||
void DeleteAiPromptbausteineTree(Dictionary<long, long> oid2version);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
|
||||
@@ -56,14 +56,14 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
|
||||
public IEnumerable<AiPromptbausteinTreeDC> GetAiPromptbausteineTree()
|
||||
=> GetAiPromptbausteineService().GetAiPromptbausteineTree();
|
||||
|
||||
//public IEnumerable<AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDC)
|
||||
// => GetAiPromptbausteineService().CreateAiPromptbausteine(aiPromptbausteinDC);
|
||||
public IEnumerable<AiPromptbausteinTreeDC> CreateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDC)
|
||||
=> GetAiPromptbausteineService().CreateAiPromptbausteineTree(aiPromptbausteinDC);
|
||||
|
||||
//public Dictionary<long, long> UpdateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs)
|
||||
// => GetAiPromptbausteineService().UpdateAiPromptbausteine(aiPromptbausteinDCs);
|
||||
public Dictionary<long, long> UpdateAiPromptbausteineTree(IEnumerable<AiPromptbausteinTreeDC> aiPromptbausteinDCs)
|
||||
=> GetAiPromptbausteineService().UpdateAiPromptbausteineTree(aiPromptbausteinDCs);
|
||||
|
||||
//public void DeleteAiPromptbausteineTree(Dictionary<long, long> oid2version)
|
||||
// => GetAiPromptbausteineService().DeleteAiPromptbausteine(oid2version);
|
||||
public void DeleteAiPromptbausteineTree(Dictionary<long, long> oid2version)
|
||||
=> GetAiPromptbausteineService().DeleteAiPromptbausteineTree(oid2version);
|
||||
|
||||
public IEnumerable<AiPromptbausteinDC> GetAiPromptbausteine()
|
||||
=> GetAiPromptbausteineService().GetAiPromptbausteine();
|
||||
|
||||
@@ -192,7 +192,8 @@ namespace BS.Shared
|
||||
AiConfig = 182,
|
||||
StoredFile = 183,
|
||||
Person2Team = 184,
|
||||
AiPromptbaustein = 185
|
||||
AiPromptbaustein = 185,
|
||||
AiPromptbausteinTree = 186
|
||||
}
|
||||
|
||||
public enum SystemEntryID
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public string Displayname { get; set; }
|
||||
[DataMember] public string Content { get; set; }
|
||||
|
||||
[DataMember] public ActivationTypeId ActivationType { get; set; }
|
||||
[DataMember] public AiPromptbausteinType PromptbausteinType { get; set; }
|
||||
[DataMember] public string Metadata { get; set; }
|
||||
[DataMember] public AiActionType AiActionType { get; set; }
|
||||
@@ -22,6 +21,7 @@ namespace BS.Shared.DataContracts.Feature.AI
|
||||
[DataMember] public bool ShowUserPromptByTenant { get; set; }
|
||||
[DataMember] public int Position { get; set; }
|
||||
[DataMember] public bool IsExpanded { get; set; }
|
||||
[DataMember] public long? ParentOid { get; set; }
|
||||
|
||||
[DataMember] public List<AiPromptbausteinTreeDC> Children { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user