Merge Konflikte gelöst

This commit is contained in:
2026-07-09 17:01:05 +02:00
parent 906310d04b
commit 44afdc0e20
26 changed files with 398 additions and 639 deletions

View File

@@ -237,8 +237,7 @@ namespace BeWo.Services
if (windowViewModel is DialogViewModel dialogViewModel)
{
dialogViewModel.Closing += (s, e) => window.Close();
window.Closed += (s, e) => dialogViewModel.CloseFinalCommand.Execute(null);
dialogViewModel.RequestCloseFinal += (s, e) => window.Close();
}
if (options.ShowAsDialog)

View File

@@ -52,129 +52,4 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PopUpWindowStyle2" TargetType="{x:Type GroupBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10" />
<RowDefinition Height="20" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.RowSpan="2"
Background="#FF202020"
CornerRadius="3,1,0,3" />
<Border
Grid.Row="1"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="#FF202020"
CornerRadius="0,1,0,3" />
<Path
Grid.Column="1"
Data="M 0,0 L 10,10 H 0 Z"
Fill="#FF202020"
StrokeThickness="0" />
<Border
x:Name="Header"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="0,0,0,0"
Padding="10,0,3,0"
VerticalAlignment="Bottom"
Background="{x:Null}">
<ContentPresenter
Margin="5,0,0,3"
VerticalAlignment="Stretch"
Content="{TemplateBinding Header}"
ContentSource="Header"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
RecognizesAccessKey="True"
RenderTransformOrigin="0,0.5"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.FontSize="16">
<ContentPresenter.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</ContentPresenter.RenderTransform>
</ContentPresenter>
</Border>
<Border
Grid.Row="2"
Grid.RowSpan="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Padding="5,5,5,5">
<ContentPresenter
Margin="0,0,0,0"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<Path
x:Name="isDirtyShape"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Width="18.21"
Height="17.336"
Margin="0,0,41.007,3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="M8.0969173,7.7938912 L7.3260856,1.6313261E-55 10.960733,0.056791361 9.8816968,7.8372078 17.130865,4.505709 18.209901,7.969982 10.336028,9.4841573 16.015164,15.065028 13.005222,17.336183 9.0298264,10.44961 4.7503484,17.141891 1.9107803,14.614571 7.6195467,9.5947088 4.3790577E-47,7.8281079 1.0589099,4.5910004 z"
RenderTransformOrigin="0.5,0.5"
StrokeThickness="0">
<Path.Fill>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="#FFFB6F0E" />
<GradientStop Offset="1" Color="#FF8C400A" />
</LinearGradientBrush>
</Path.Fill>
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0" ScaleY="0" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Path.RenderTransform>
</Path>
<Button
x:Name="button_close"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="1"
Width="20"
Height="20"
Margin="3,3,3,3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Command="{Binding CloseCommand}"
Style="{DynamicResource CloseButtonStyle}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="{DynamicResource MainGroupBoxForegroundBrush}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontSize" Value="11" />
</Style>
</ResourceDictionary>

View File

@@ -67,13 +67,12 @@ namespace BeWo.View.Controls.AI
{
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
viewmodel.ItemAccepted += ItemAccepted;
viewmodel.Closed += (s, e) => viewmodel.ResetSelection();
viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection();
ViewModel.AllPromptsViewModel = viewmodel;
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
viewmodel2.ItemAccepted += ItemAccepted;
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.CloseFinalCommand.Execute(null);
viewmodel2.Closed += (s, e) => viewmodel2.ResetSelection();
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
var view2 = new AiPromptbausteinComplexSelectionFavoritenView(viewmodel2);
viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
view2.Padding = new Thickness(3);

View File

@@ -186,8 +186,8 @@
<DataTrigger Binding="{Binding IsValid}" Value="False">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="IsEnabled" Value="True" />
<Setter Property="IsHitTestVisible" Value="True" />
<Setter Property="IsEnabled" Value="False" />
<Setter Property="IsHitTestVisible" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
@@ -238,26 +238,25 @@
Background="Transparent"
ContextMenuOpening="ListBox_ContextMenuOpening"
PreviewMouseDown="Grid_PreviewMouseDown_2">
<Grid IsEnabled="{Binding IsValid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="9" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="9" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle
Grid.RowSpan="2"
Width="24"
Height="24"
Fill="White" />
<StackPanel Grid.Column="2" Orientation="Horizontal">
<TextBox
<StackPanel Grid.Column="2" Orientation="Horizontal">
<TextBox
Height="21"
Margin="0,0,0,0"
Padding="0"
@@ -270,10 +269,10 @@
IsReadOnly="True"
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
ToolTipService.ShowDuration="100000">
<TextBox.ToolTip>
<StackPanel Orientation="Vertical">
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
<TextBox
<TextBox.ToolTip>
<StackPanel Orientation="Vertical">
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
<TextBox
MaxWidth="500"
Padding="3,1,0,0"
VerticalAlignment="Center"
@@ -283,16 +282,16 @@
IsReadOnly="True"
Text="{Binding Path=Description}"
TextWrapping="Wrap" />
</StackPanel>
</TextBox.ToolTip>
</TextBox>
</StackPanel>
<StackPanel
</StackPanel>
</TextBox.ToolTip>
</TextBox>
</StackPanel>
<StackPanel
Grid.Row="1"
Grid.Column="2"
Margin="0,-1,0,0"
Orientation="Horizontal">
<Border
<Border
x:Name="border1"
Width="46"
Margin="0,0,3,0"
@@ -300,27 +299,27 @@
HorizontalAlignment="Left"
Background="#E1F5EE"
CornerRadius="7">
<TextBlock
<TextBlock
Margin="1,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10"
Text="Routine"
TextWrapping="Wrap" />
</Border>
<TextBlock
</Border>
<TextBlock
Margin="3,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} Schritte">
<Binding Path="Steps.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<ListBox
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} Schritte">
<Binding Path="Steps.Count" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<ListBox
Grid.Row="2"
Grid.Column="2"
Margin="3,9,3,3"
@@ -331,20 +330,20 @@
IsHitTestVisible="False"
ItemsSource="{Binding Steps.VMList}"
Visibility="{Binding Steps.VMList.Count, Converter={StaticResource CollectionCountToVisibilityConverter}}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock
x:Name="arrow"
Margin="3"
VerticalAlignment="Center"
Text="&#x2794;" />
<Border
<Border
x:Name="border1"
Height="19"
Margin="0"
@@ -352,49 +351,48 @@
HorizontalAlignment="Left"
Background="DarkGray"
CornerRadius="7">
<TextBlock
<TextBlock
Margin="3,0,3,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10"
Text="{Binding PromptReference.Title, StringFormat={}✦ {0}}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding IsValid}" Value="false">
<Setter TargetName="border1" Property="Background" Value="LightCoral" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
<StackPanel
</Border>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding IsValid}" Value="false">
<Setter TargetName="border1" Property="Background" Value="LightCoral" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
<StackPanel
Grid.Row="3"
Grid.Column="2"
Orientation="Horizontal"
Visibility="{Binding IsValid, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=reverse}">
<Image
<Image
x:Name="imgWarning"
Grid.Column="2"
Height="20"
Margin="6,0"
Source="{Binding Source={x:Static draw:SystemIcons.Warning}, Converter={StaticResource IconToImageSourceConverter}, Mode=OneWay}" />
<!-- Visibility="{Binding ElementName=btnOpenAi4, Path=Visibility}" -->
<Label Foreground="Red">
Ungültig
</Label>
</StackPanel>
</Grid>
<!-- Visibility="{Binding ElementName=btnOpenAi4, Path=Visibility}" -->
<Label Foreground="Red">
Ungültig
</Label>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
@@ -416,16 +414,22 @@
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TreeView
<GroupBox
Grid.Row="1"
Grid.Column="0"
Margin="0,7,0,0"
Padding="0"
HorizontalAlignment="Stretch"
Header="Bibliothek"
Style="{StaticResource ObjectEditGroupBox}">
<TreeView
x:Name="treeView"
Grid.Row="1"
Grid.Column="0"
MinHeight="100"
Padding="4,16,4,16"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowDrop="True"
BorderThickness="1,1,0,1"
BorderThickness="1,0,0,1"
ContextMenuOpening="treeView_ContextMenuOpening"
Focusable="True"
ItemContainerStyle="{DynamicResource igoal_treeitemstyle}"
@@ -435,18 +439,18 @@
PreviewMouseRightButtonDown="OnPreviewMouseRightButtonDown"
SelectedItemChanged="treeView_SelectedItemChanged"
TreeViewItem.Selected="treeView_Selected">
<TreeView.Resources>
<Style x:Key="igoal_treeitemstyle" TargetType="TreeViewItem">
<Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
</Style>
</TreeView.Resources>
<TreeView.InputBindings>
<KeyBinding Key="Delete" Command="{Binding DeleteFolderCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenEditFolderDialogCommand}" />
<KeyBinding Key="N" Command="{Binding OpenAddFolderDialogCommand}" />
<!--<KeyBinding
<TreeView.Resources>
<Style x:Key="igoal_treeitemstyle" TargetType="TreeViewItem">
<Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
</Style>
</TreeView.Resources>
<TreeView.InputBindings>
<KeyBinding Key="Delete" Command="{Binding DeleteFolderCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenEditFolderDialogCommand}" />
<KeyBinding Key="N" Command="{Binding OpenAddFolderDialogCommand}" />
<!--<KeyBinding
Key="C"
Command="{Binding CopyFolderCommand}"
Modifiers="Ctrl" />
@@ -454,33 +458,33 @@
Key="V"
Command="{Binding PasteFolderCommand}"
Modifiers="Ctrl" />-->
</TreeView.InputBindings>
<TreeView.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<ResourceDictionary>
<Style TargetType="{x:Type Image}">
<Setter Property="Height" Value="24" />
</Style>
</ResourceDictionary>
</ContextMenu.Resources>
<MenuItem
</TreeView.InputBindings>
<TreeView.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<ResourceDictionary>
<Style TargetType="{x:Type Image}">
<Setter Property="Height" Value="24" />
</Style>
</ResourceDictionary>
</ContextMenu.Resources>
<MenuItem
Command="{Binding OpenAddFolderDialogCommand}"
Header="Neuer Ordner"
ToolTip="Shortcut: N">
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="{Binding OpenEditFolderDialogCommand}"
Header="Bearbeiten"
ToolTip="Shortcut: Enter">
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
</MenuItem.Icon>
</MenuItem>
<!--<Separator />
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
</MenuItem.Icon>
</MenuItem>
<!--<Separator />
<MenuItem
Command="{Binding CopyFolderCommand}"
Header="Kopieren"
@@ -497,18 +501,19 @@
<Image Source="..\..\..\Ressources\Icons\Paste24.png" />
</MenuItem.Icon>
</MenuItem>-->
<Separator />
<MenuItem
<Separator />
<MenuItem
Command="{Binding DeleteFolderCommand}"
Header="Löschen"
ToolTip="Shortcut: Entf">
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TreeView.ContextMenu>
</TreeView>
<MenuItem.Icon>
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TreeView.ContextMenu>
</TreeView>
</GroupBox>
<GridSplitter
Grid.Row="1"
Grid.Column="1"
@@ -519,7 +524,7 @@
Grid.Row="1"
Grid.Column="2"
Grid.ColumnSpan="2">
<!--<Grid.Resources>
<Grid.Resources>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=treeView, Path=SelectedItem}" Value="{x:Null}">
@@ -527,7 +532,7 @@
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>-->
</Grid.Resources>
<TabControl
x:Name="tabcontrol_1"
Padding="0"

View File

@@ -58,7 +58,7 @@
Grid.Column="2"
IsEnabled="False"
Style="{StaticResource TextEditNumber}"
Text="{Binding Oid, Mode=OneWay}" />
Text="{Binding Oid}" />
<Label
Grid.Row="1"
Grid.Column="0"
@@ -154,7 +154,7 @@
Grid.Column="2"
MaxLength="1024"
Style="{StaticResource TextBoxNoticeLarge}"
Text="{Binding Notice, UpdateSourceTrigger=PropertyChanged}"
Text="{Binding Notice}"
TextWrapping="Wrap" />
</Grid>
</TabItem>

View File

@@ -230,19 +230,24 @@ namespace BeWo.View.Detail.Accounting
var dialog = new GkvAbrechnungDialogViewModel(vm);
dialog.Closing += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
dialog.RequestCloseFinal += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
BeWoApp.MainControl.WindowService.ShowGkvAbrechnungDetailWindow(dialog);
}
private void Detail_Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
var dialog = sender as GkvAbrechnungDialogViewModel;
var vm = dialog.Abrechnung;
var bewo_window = sender as AnimatedBeWoWindow;
var detail_control = bewo_window.GroupBoxContent as GkvAbrechnungDetailControl;
var vm = detail_control.DataContext as GkvAbrechnungLightVM;
vm.CheckAllInvoiceBases();
//vm.Notice = textbox_text;
var checkbox_checked = detail_control.Checkbox_Bezahlt.IsChecked;
var textbox_text = detail_control.txt_Notice.Text;
vm.Notice = textbox_text;
if (vm.IsDirty)
{

View File

@@ -41,7 +41,7 @@
x:FieldModifier="public"
MouseDoubleClick="RootGroupBox_OnMouseDoubleClick"
MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown"
Style="{DynamicResource PopUpWindowStyle2}">
Style="{DynamicResource PopUpWindowStyle}">
<GroupBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Close" Executed="CommandBinding_Close_Executed" />
<CommandBinding Command="ApplicationCommands.Save" Executed="CommandBinding_Save_Executed" />

View File

@@ -57,7 +57,7 @@ namespace BeWo.View.Windows
{
InitializeComponent();
//CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close()));
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close()));
if(ServiceFacade.IsWaiting())
StartWaiting();
@@ -169,7 +169,7 @@ namespace BeWo.View.Windows
public void Window_Closed(object sender, EventArgs e)
{
}
public void StartWaiting()

View File

@@ -245,7 +245,7 @@ namespace BeWo.ViewModel
public AiPromptbausteinFolderVM Parent { get; set; }
public FontWeight FontWeight => !IsNew && (Parent is null || Parent.Parent is null) ? FontWeights.SemiBold : FontWeights.Medium;
public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium;
public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0;
public int TotalPromptCount

View File

@@ -26,6 +26,8 @@ namespace BeWo.ViewModel.Light
public static string PropertyName_ErstelltAm = "ErstelltAm";
private long _Oid;
private long _Version;
private string _Notice;
private long _OrganisationOid;
@@ -116,11 +118,31 @@ namespace BeWo.ViewModel.Light
public DateTime ErstelltAmDate => ErstelltAm.Date;
public long Oid
{
get => DataContract.Oid;
get { return this._Oid; }
set
{
if (this.AreDifferent(this._Oid, value))
{
this._Oid = value;
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Oid, value), nameof(Oid));
this.FirePropertyChanged(nameof(Oid));
}
}
}
public long Version
{
get => DataContract.Version;
get { return this._Version; }
set
{
if (this.AreDifferent(this._Version, value))
{
this._Version = value;
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Version, value), nameof(Version));
this.FirePropertyChanged(nameof(Version));
}
}
}
public string Notice
{
@@ -330,7 +352,7 @@ namespace BeWo.ViewModel.Light
public override void UpdateByDataContract(GkvAbrechnungLightDC pDataContract)
{
DataContract = pDataContract;
Version = pDataContract.Version;
Notice = pDataContract.Notice;
@@ -351,6 +373,9 @@ namespace BeWo.ViewModel.Light
_ErstelltAm = pDataContract.ErstelltAm;
_Oid = pDataContract.Oid;
_Version = pDataContract.Version;
_Notice = pDataContract.Notice;
_Betrag = pDataContract.Betrag;
@@ -377,6 +402,8 @@ namespace BeWo.ViewModel.Light
}
protected override GkvAbrechnungLightDC MapToDataContract(GkvAbrechnungLightDC pDataContract, bool doCommit)
{
pDataContract.Version = _Version;
pDataContract.Notice = _Notice;
pDataContract.Betrag = _Betrag;
pDataContract.Bezahlt = _Bezahlt;
@@ -394,6 +421,7 @@ namespace BeWo.ViewModel.Light
return;
}
Version = dc.Version;
Protokolle = dc.Protokolle.ToList();
IsReady2Send = dc.IsReady2Send;

View File

@@ -970,13 +970,11 @@ namespace BeWo.ViewModel
Oid = -5,
Title = "Favoriten",
Description = "Eigene Favoriten",
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>()
SubPrompts = new List<AiPromptbausteinPromptDC>()
};
var fav_vm = new AiPromptbausteinFolderVM(favoriten);
fav_vm.SubPrompts.VMList.Clear();
fav_vm.SubRoutines.VMList.Clear();
folders.VMList.Insert(0, fav_vm);

View File

@@ -74,8 +74,6 @@ namespace BeWo.ViewModel.View.AI
{
Folders = new AiPromptbausteinFolderListVM();
}
//Closing += (s, e) => ResetSelection();
}
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType) : this()
{
@@ -86,7 +84,7 @@ namespace BeWo.ViewModel.View.AI
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false, bool canOpen = true) : this(aiActionType)
{
LoadedActionType = aiActionType;
UpdateVMList(viewModel);
Folders = viewModel;
IsFavorite = isFavorite;
CanOpenContextMenu = canOpen;
}
@@ -156,9 +154,6 @@ namespace BeWo.ViewModel.View.AI
public AiPromptbausteinFolderListVM Folders { get; private set; }
public AiActionType LoadedActionType { get; set; }
public AiPromptbausteinFolderVM FavoritenFolder => Folders.VMList[0];
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
public bool HasFavoriten
{
get
@@ -168,7 +163,7 @@ namespace BeWo.ViewModel.View.AI
return true;
#endif
return Folders.Count > 1 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0);
return Folders.Count > 3 && (Folders.VMList[0].Prompts.Count > 0 || Folders.VMList[0].Routines.Count > 0);
}
}
@@ -180,8 +175,10 @@ namespace BeWo.ViewModel.View.AI
SelectedFolder = null;
// Favoriten-Popup:
var target = IsFavorite ? FavoritenFolder : RootFolders;
// Favoriten-Popup: Favoriten (VMList[0]), sonst "Eigene" (VMList[1]) vorauswählen.
var target = IsFavorite
? (Folders.VMList.Count > 0 ? Folders.VMList[0] : null)
: (Folders.VMList.Count > 1 ? Folders.VMList[1] : null);
if (target != null)
{
@@ -214,7 +211,7 @@ namespace BeWo.ViewModel.View.AI
{
VMFactory.CreateAiPromptbausteinFolderListVMAsync(AiActionType, UpdateVMList);
if (notify)
if(notify)
VMListReloaded?.Invoke(this, EventArgs.Empty);
}
private void UpdateVMList(AiPromptbausteinFolderListVM new_list)
@@ -223,23 +220,17 @@ namespace BeWo.ViewModel.View.AI
FirePropertyChanged(nameof(Folders));
if (Folders.VMList.Count > 0
&& Folders.VMList[0].DataContract.Oid == -51
&& Folders.VMList[0].SubFolders.Count > 0
&& Folders.VMList[0].SubFolders.VMList[0].DataContract.Oid == -5)
if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
{
Favoriten = Folders.VMList[0].SubFolders.VMList[0];
Favoriten = Folders.VMList[0];
if (IsFavorite)
SelectedFolder = Favoriten;
}
if (!IsFavorite &&
Folders.VMList.Count > 0
&& Folders.VMList[0].DataContract.Oid == -51
&& Folders.VMList[0].SubFolders.Count > 1
&& Folders.VMList[0].SubFolders.VMList[1].DataContract.Oid == -1)
Folders.VMList[0].SubFolders.VMList[1].IsSelected = true;
// "Eigene" (VMList[1]) im normalen Modus vorauswählen.
if (!IsFavorite && Folders.VMList.Count > 1)
Folders.VMList[1].IsSelected = true;
FirePropertyChanged(nameof(HasFavoriten));
}

View File

@@ -29,8 +29,7 @@ namespace BeWo.ViewModel.View.Administration
private AiActionType AiActionType { get; set; }
public AiPromptbausteinFolderListVM Folders { get; set; }
public AiPromptbausteinFolderVM Favoriten => Folders.VMList[0];
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
public AiPromptbausteinFolderVM Favoriten { get; set; }
public AiPromptbausteinFolderVM CopiedFolder { get; set; }
public AiPromptbausteinPromptVM CopiedPrompt { get; set; }
@@ -82,8 +81,7 @@ namespace BeWo.ViewModel.View.Administration
public AbstractBaseVM SelectedItem
{
get => _SelectedItem;
set
{
set {
var success = SetProperty(ref _SelectedItem, value, nameof(SelectedItem));
if (!success)
@@ -171,7 +169,7 @@ namespace BeWo.ViewModel.View.Administration
OpenAddRoutineDialogCommand.RaiseCanExecuteChanged();
OpenEditRoutineDialogCommand.RaiseCanExecuteChanged();
DeleteRoutineCommand.RaiseCanExecuteChanged();
ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
}
public void UpdateItemCommands()
{
@@ -187,12 +185,14 @@ namespace BeWo.ViewModel.View.Administration
listvm =>
{
Folders = listvm;
if (RootFolders.SubFolders.VMList[0].DataContract.Oid == -1)
if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
{
RootFolders.SubFolders.VMList[0].IsSelected = true;
Favoriten = Folders.VMList[0];
}
if (Folders.VMList.Count > 1)
Folders.VMList[1].IsSelected = true;
FirePropertyChanged(nameof(Folders));
});
}

View File

@@ -1,35 +1,25 @@
using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace BeWo.ViewModel.View
{
public class DialogViewModel : WindowViewModel
{
public event EventHandler Closing;
public event EventHandler Closed;
public event EventHandler RequestCloseFinal;
public DelegateCommand CloseCommand { get; set; }
public DelegateCommand CloseFinalCommand { get; set; }
protected DialogViewModel() : base()
public DialogViewModel() : base()
{
CloseCommand = new DelegateCommand(Close, canClose, false);
CloseFinalCommand = new DelegateCommand(CloseFinal, canClose, false);
}
protected virtual void Close()
{
Closing?.Invoke(this, EventArgs.Empty);
}
protected virtual void CloseFinal()
{
Closed?.Invoke(this, EventArgs.Empty);
}
protected virtual bool canClose()
{
return true;
RequestCloseFinal?.Invoke(this, EventArgs.Empty);
}
}
}

View File

@@ -7,16 +7,3 @@ WICHTIG:
- Falls die Daten nicht die benötigte Information enthalten, gib an, dass die Daten fehlen, anstatt zu raten.
- KEINE Erklärungen, KEIN Fließtext, KEINE zusätzlichen Notizen!
- Deine Antwort soll eine direkte und verständliche Antwort für den Nutzer sein.
---
### **Allgemein**
- Aktuelle Zeit: {AktuelleZeit}
### **Ansicht**
- Ich befinde mich aktuell in der "{AktuellesModule}" meiner Anwendung.
- {FilterEinstellungen}
### **Daten**
{DatenBlock}

View File

@@ -125,7 +125,6 @@
<Compile Include="Prompt\SystemPrompts\AiFunctionSystemPromptBuilder.cs" />
<Compile Include="Prompt\SystemPrompts\AiConversationSystemPromptBuilder.cs" />
<Compile Include="Prompt\Models\AiConversationContext.cs" />
<Compile Include="Prompt\SystemPrompts\AiGenericSystemPromptBuilder.cs" />
<Compile Include="Prompt\SystemPrompts\BaseSystemPromptBuilder.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

View File

@@ -1,7 +1,6 @@
using AICore.Context.Summary;
using AICore.Prompt.SystemPrompts;
using BS.Shared;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Exceptions;
using System;
using System.Collections.Generic;
@@ -14,27 +13,25 @@ namespace AICore.Prompt
{
public class AiSystemPromptFactory
{
public static string BuildContext(AiActionType actionType, string prompt_path, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType context_type)
public static string BuildContext(AiActionType actionType, string prompt_path, BaseContextSummary context, AiDataContextType context_type)
{
switch (actionType)
{
case AiActionType.ServiceRecord:
break;
case AiActionType.ServiceRecordConversation:
var factory = new AiConversationSystemPromptBuilder(prompt_path);
var prompt = factory.CreateSystemPrompt(actionType, context, context_type);
return prompt;
case AiActionType.ServiceRecordDocumentation:
return BuildGenericContext(actionType, prompt_path, view_context, context, context_type);
var factory2 = new AiFunctionSystemPromptBuilder(prompt_path);
var prompt2 = factory2.CreateServiceRecordDocumentationSystemPrompt(context);
return prompt2;
default:
break;
}
throw BeWoNotImplementedException.CreateFromEnum(actionType);
}
public static string BuildGenericContext(AiActionType actionType, string prompt_path, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType context_type)
{
var factory = new AiGenericSystemPromptBuilder(prompt_path);
return factory.CreateSystemPrompt(actionType, view_context, context, context_type);
}
}
}

View File

@@ -2,7 +2,6 @@
using AICore.Context.SummaryParser;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Exceptions;
using BS.Shared.Translation;
using System;
@@ -15,74 +14,66 @@ using System.Text.Json;
namespace AICore.Prompt.SystemPrompts
{
//internal class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder
//{
// public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) {
internal class AiConversationSystemPromptBuilder : BaseSystemPromptBuilder
{
public AiConversationSystemPromptBuilder(string prompt_path) : base(prompt_path) {
// }
}
// public string CreateSystemPrompt(AiActionType actionType, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType aiDataContextType)
// {
// var currentDateTime = DateTime.Now;
// var moduleName = Translations[actionType];
// var filter = view_context.Filter is string filter_str
// ? $"Es ist folgender Filter gesetzt: {filter_str}"
// : "Es ist kein Filter gesetzt.";
public string CreateSystemPrompt(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType)
{
var sb = new StringBuilder();
// var context =
sb.AppendLine(getCustomSystemPrompt());
sb.AppendLine();
sb.AppendLine();
sb.AppendLine("---");
sb.AppendLine();
sb.AppendLine("### **Allgemein**");
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
sb.AppendLine();
sb.AppendLine("### **Ansicht**");
sb.AppendLine($"- Ich befinde mich aktuell in der \"{Translations[actionType]}\" meiner Anwendung.");
sb.AppendLine($"- Es ist kein Filter gesetzt.");
sb.AppendLine();
sb.AppendLine("### **Daten**");
// var sb = new StringBuilder();
if (context?.Context is null)
{
sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
}
else
{
sb.AppendLine("Du erhälst folgende Daten:");
// sb.AppendLine(getCustomSystemPrompt());
// sb.AppendLine();
// sb.AppendLine();
// sb.AppendLine("---");
// sb.AppendLine();
// sb.AppendLine("### **Allgemein**");
// sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
// sb.AppendLine();
// sb.AppendLine("### **Ansicht**");
// sb.AppendLine($"- Ich befinde mich aktuell in der \"{Translations[actionType]}\" meiner Anwendung.");
// sb.AppendLine();
// sb.AppendLine("### **Daten**");
var parser = GetParser(aiDataContextType);
var parsed = parser.Parse(actionType, context);
// if (context?.Context is null)
// {
// sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
// }
// else
// {
// sb.AppendLine("Du erhälst folgende Daten:");
sb.AppendLine(parsed);
}
// var parser = GetParser(aiDataContextType);
// var parsed = parser.Parse(actionType, context);
return sb.ToString();
}
// sb.AppendLine(parsed);
// }
private BaseContextSummaryParser GetParser(AiDataContextType aiDataContextType)
{
switch (aiDataContextType)
{
case AiDataContextType.json:
return new JsonContextSummaryParser();
case AiDataContextType.csv:
return new CsvContextSummaryParser();
case AiDataContextType.tsv:
return new CsvContextSummaryParser("\t");
case AiDataContextType.csv2:
return new CsvContextSummaryParser(";", true);
case AiDataContextType.tsv2:
return new CsvContextSummaryParser("\t", true);
default:
break;
}
// return sb.ToString();
// }
// private BaseContextSummaryParser GetParser(AiDataContextType aiDataContextType)
// {
// switch (aiDataContextType)
// {
// case AiDataContextType.json:
// return new JsonContextSummaryParser();
// case AiDataContextType.csv:
// return new CsvContextSummaryParser();
// case AiDataContextType.tsv:
// return new CsvContextSummaryParser("\t");
// case AiDataContextType.csv2:
// return new CsvContextSummaryParser(";", true);
// case AiDataContextType.tsv2:
// return new CsvContextSummaryParser("\t", true);
// default:
// break;
// }
// throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType);
// }
//}
throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType);
}
}
}

View File

@@ -3,7 +3,6 @@ using AICore.Context.Summary.Function;
using AICore.Context.SummaryParser;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts.Feature.AI;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -14,53 +13,46 @@ using System.Threading.Tasks;
namespace AICore.Prompt.SystemPrompts
{
//internal class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder
//{
// public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path)
// {
internal class AiFunctionSystemPromptBuilder : BaseSystemPromptBuilder
{
public AiFunctionSystemPromptBuilder(string prompt_path) : base(prompt_path)
{
// }
}
// public string CreateServiceRecordDocumentationSystemPrompt(AiViewContextDC view_context, BaseContextSummary context)
// {
// var sb = new StringBuilder();
public string CreateServiceRecordDocumentationSystemPrompt(BaseContextSummary context)
{
var sb = new StringBuilder();
// sb.AppendLine(getCustomSystemPrompt());
// sb.AppendLine();
// sb.AppendLine();
// sb.AppendLine("---");
// sb.AppendLine();
// sb.AppendLine("### **Allgemein**");
// sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
// sb.AppendLine();
// sb.AppendLine("### **Ansicht**");
// sb.AppendLine($"- Ich befinde mich aktuell in der \"Zeiterfassung\" meiner Anwendung.");
// if(view_context.Filter is string filter_str)
// {
// sb.AppendLine($"- Es ist folgender Filter gesetzt: {filter_str}");
// }
// else
// {
// sb.AppendLine($"- Es ist kein Filter gesetzt.");
// }
// sb.AppendLine();
// sb.AppendLine("### **Daten**");
sb.AppendLine(getCustomSystemPrompt());
sb.AppendLine();
sb.AppendLine();
sb.AppendLine("---");
sb.AppendLine();
sb.AppendLine("### **Allgemein**");
sb.AppendLine($"- Aktuelle Zeit: {DateTime.Now}");
sb.AppendLine();
sb.AppendLine("### **Ansicht**");
sb.AppendLine($"- Ich befinde mich aktuell in der \"Zeiterfassung\" meiner Anwendung.");
sb.AppendLine($"- Es ist kein Filter gesetzt.");
sb.AppendLine();
sb.AppendLine("### **Daten**");
// if (context?.Context is null)
// {
// sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
// }
// else
// {
// sb.AppendLine("Du erhälst folgende Daten:");
if (context?.Context is null)
{
sb.AppendLine("Dir wurden keine Daten bereitgestellt.");
}
else
{
sb.AppendLine("Du erhälst folgende Daten:");
// var parser = new CsvContextSummaryParser();
// var parsed = parser.Parse(AiActionType.ServiceRecordDocumentation, context);
var parser = new CsvContextSummaryParser();
var parsed = parser.Parse(AiActionType.ServiceRecordDocumentation, context);
// sb.AppendLine(parsed);
// }
sb.AppendLine(parsed);
}
// return sb.ToString();
// }
//}
return sb.ToString();
}
}
}

View File

@@ -1,57 +0,0 @@
using AICore.Context.Summary;
using AICore.Context.SummaryParser;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Exceptions;
using BS.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Remoting.Messaging;
namespace AICore.Prompt.SystemPrompts
{
internal class AiGenericSystemPromptBuilder : BaseSystemPromptBuilder
{
public AiGenericSystemPromptBuilder(string prompt_path) : base(prompt_path)
{
}
public string CreateSystemPrompt(AiActionType actionType, AiViewContextDC view_context, BaseContextSummary context, AiDataContextType aiDataContextType)
{
var replace_dict = new Dictionary<string, string>()
{
{"{AktuelleZeit}", DateTime.Now.ToString() },
{"{AktuellesModule}", Translations[actionType]},
{"{FilterEinstellungen}", getFilterString(view_context.Filter)},
{"{DatenBlock}", getContextBlock(actionType, context, aiDataContextType)}
};
return createSystemPrompt(replace_dict);
}
private string getFilterString(object filter)
{
if (filter is null)
return "Es ist kein Filter gesetzt.";
return $"Es ist folgender Filter gesetzt: {filter}";
}
private string getContextBlock(AiActionType actionType, BaseContextSummary context, AiDataContextType aiDataContextType)
{
if (context is null)
{
return "Dir wurden keine Daten bereitgestellt.";
}
var parser = getParser(aiDataContextType);
var parsed = parser.Parse(actionType, context);
return $"Du erhälst folgende Daten: {Environment.NewLine}"
+ parsed;
}
}
}

View File

@@ -1,8 +1,4 @@
using AICore.Context.Summary;
using AICore.Context.SummaryParser;
using BS.Shared;
using BS.Shared.DataContracts.Feature.AI;
using BS.Shared.Exceptions;
using BS.Shared;
using System;
using System.Collections.Generic;
using System.IO;
@@ -28,45 +24,7 @@ namespace AICore.Prompt.SystemPrompts
Path = path;
}
protected string createSystemPrompt(Dictionary<string, string> replace_dict)
{
var sb = new StringBuilder();
sb.AppendLine(getCustomSystemPrompt());
foreach (var kvp in replace_dict)
{
var key = kvp.Key;
var value = kvp.Value;
sb.Replace(key, value);
}
return sb.ToString();
}
protected BaseContextSummaryParser getParser(AiDataContextType aiDataContextType)
{
switch (aiDataContextType)
{
case AiDataContextType.json:
return new JsonContextSummaryParser();
case AiDataContextType.csv:
return new CsvContextSummaryParser();
case AiDataContextType.tsv:
return new CsvContextSummaryParser("\t");
case AiDataContextType.csv2:
return new CsvContextSummaryParser(";", true);
case AiDataContextType.tsv2:
return new CsvContextSummaryParser("\t", true);
default:
break;
}
throw BeWoNotImplementedException.CreateFromEnum(aiDataContextType);
}
private string getCustomSystemPrompt()
protected string getCustomSystemPrompt()
{
var path = Path;
return File.ReadAllText(path);

View File

@@ -29,27 +29,17 @@ namespace BeWo.Service.Plugins
public IEnumerable<AiPromptbausteinFolderDC> GetAiPromptbausteinFolder(AiActionType aiActionType)
{
var bib = PredefinedAiPromptbausteinFolders.CreateRootBibNode(aiActionType);
var own_bib = getOwnFolder(aiActionType);
var public_bib = getPublicFolders(aiActionType);
var ownsoft_bib = getOwnsoftFolder(aiActionType);
bib.SubFolders.Add(own_bib);
bib.SubFolders.Add(public_bib);
if (ownsoft_bib is object)
bib.SubFolders.Add(ownsoft_bib);
foreach(var folder in bib.SubFolders)
{
folder.ParentFolderOid = bib.ParentFolderOid;
}
var result = new List<AiPromptbausteinFolderDC>() {
bib
own_bib, public_bib
};
if(ownsoft_bib is object)
result.Add(ownsoft_bib);
return result;
}
@@ -72,8 +62,6 @@ namespace BeWo.Service.Plugins
initOwnFolder(own_bib);
own_bib.CanEdit = false;
return own_bib;
}

View File

@@ -397,7 +397,7 @@ namespace BeWo.Service.Plugins
var context_loaded = AiContextLoader.LoadContext(actionType, view_context, sampleCount);
var configPath = getPromptPath(actionType);
var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, view_context, context_loaded, context_Type);
var system_prompt = AiSystemPromptFactory.BuildContext(actionType, configPath, context_loaded, context_Type);
var msg = new AiConversationMessage();
msg.Message = system_prompt;

View File

@@ -50,72 +50,112 @@ namespace BS.Shared.DataContracts.Feature.AI
};
}
public static AiPromptbausteinFolderDC CreateRootBibNode(AiActionType aiActionType)
{
var title = AiPromptbausteineTexts.RootBibNodeTitle;
var description = AiPromptbausteineTexts.RootBibNodeDescription;
var node = CreateNode(aiActionType, -51, title, description, null);
return node;
}
public static AiPromptbausteinFolderDC CreateOwnBibNode(AiActionType aiActionType)
{
var title = AiPromptbausteineTexts.OwnBibNodeTitle;
var description = AiPromptbausteineTexts.OwnBibNodeDescription;
var node = CreateNode(aiActionType, -1, title, description, null);
node.CanAddFolder = true;
node.CanAddPrompt = true;
node.CanAddRoutine = true;
return node;
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = AiPromptbausteineTexts.OwnBibNodeDescription,
Oid = -1,
ParentFolderOid = null,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = AiPromptbausteineTexts.OwnBibNodeTitle,
Version = 1,
CanAddFolder = true,
CanAddPrompt = true,
CanAddRoutine = true,
IsExpanded = true,
};
}
//public static AiPromptbausteinFolderDC CreateSharedBibNode(AiActionType aiActionType)
//{
// return new AiPromptbausteinFolderDC()
// {
// ActionType = aiActionType,
// Description = AiPromptbausteineTexts.SharedBibNodeDescription,
// Oid = -2,
// ParentFolderOid = null,
// SubFolders = new List<AiPromptbausteinFolderDC>(),
// SubPrompts = new List<AiPromptbausteinPromptDC>(),
// Title = AiPromptbausteineTexts.SharedBibNodeTitle,
// Version = 1,
// IsExpanded = true,
// IsNewFeature = true
// };
//}
public static AiPromptbausteinFolderDC CreatePublicBibNode(AiActionType aiActionType)
{
var title = AiPromptbausteineTexts.PublicBibNodeTitle;
var description = AiPromptbausteineTexts.PublicBibNodeDescription;
var node = CreateNode(aiActionType, -3, title, description, null);
return node;
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = AiPromptbausteineTexts.PublicBibNodeDescription,
Oid = -3,
ParentFolderOid = null,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = AiPromptbausteineTexts.PublicBibNodeTitle,
Version = 1,
IsExpanded = true
};
}
public static AiPromptbausteinFolderDC CreatePublicSharedBibNode(AiActionType aiActionType, string display)
{
var title = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeTitle, display);
var description = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeDescription, display);
var node = CreateNode(aiActionType, -31, title, description, null);
node.IsExpanded = false;
return node;
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeDescription, display),
Oid = -31,
ParentFolderOid = null,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = string.Format(AiPromptbausteineTexts.PublicSharedBibNodeTitle, display),
Version = 1,
IsExpanded = false
};
}
public static AiPromptbausteinFolderDC CreateOwnsoftBibNode(AiActionType aiActionType)
{
var title = AiPromptbausteineTexts.OwnsoftBibNodeTitle;
var description = AiPromptbausteineTexts.OwnsoftBibNodeDescription;
var node = CreateNode(aiActionType, -4, title, description, null);
return node;
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = AiPromptbausteineTexts.OwnsoftBibNodeDescription,
Oid = -4,
ParentFolderOid = null,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = AiPromptbausteineTexts.OwnsoftBibNodeTitle,
Version = 1,
IsExpanded = true,
IsNewFeature = false
};
}
public static AiPromptbausteinFolderDC CreateExampleNode(AiActionType aiActionType)
{
var node = CreateNode(aiActionType, -100, "Beispiel Ordner", "Beispielbeschreibung", null);
node.CanAddFolder = true;
node.CanAddPrompt = true;
node.CanAddRoutine = true;
node.CanEdit = true;
return node;
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = "Beispielbeschreibung",
Oid = -100,
ParentFolderOid = null,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = "Beispiel Ordner",
Version = 1,
CanAddFolder = true,
CanAddPrompt = true,
CanEdit = true
};
}
public static AiPromptbausteinPromptDC CreateExamplePrompt(AiActionType aiActionType)
@@ -130,26 +170,5 @@ namespace BS.Shared.DataContracts.Feature.AI
OwnsoftRefLink = "https://help.bewoplaner.de/"
};
}
public static AiPromptbausteinFolderDC CreateNode(AiActionType aiActionType, long oid, string title, string description, long? parent_folder_oid)
{
return new AiPromptbausteinFolderDC()
{
ActionType = aiActionType,
Description = description,
Oid = oid,
ParentFolderOid = parent_folder_oid,
SubFolders = new List<AiPromptbausteinFolderDC>(),
SubPrompts = new List<AiPromptbausteinPromptDC>(),
SubRoutines = new List<AiPromptbausteinRoutineDC>(),
Title = title,
Version = 1,
CanAddFolder = false,
CanAddPrompt = false,
CanAddRoutine = false,
CanEdit = false,
IsExpanded = true,
};
}
}
}

View File

@@ -16,9 +16,6 @@ namespace BS.Shared.DataContracts.Feature.AI
[DataMember]
public object Secondary { get; set; }
[DataMember]
public object Filter { get; set; }
[DataMember]
public Dictionary<TableID, long[]> References { get; set; }
}

View File

@@ -8,8 +8,6 @@ namespace BS.Shared.Text
{
public static class AiPromptbausteineTexts
{
public static string RootBibNodeTitle => "Bibliothek";
public static string RootBibNodeDescription => "Hier sehen Sie alle Prompts";
public static string OwnBibNodeTitle => "Eigene";
public static string OwnBibNodeDescription => "Hier können Sie Ihre eigenen Prompts verwalten";
public static string PublicBibNodeTitle => "Geteilt";