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

@@ -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);
}
}
}