2026-06-05 14:56:49 +02:00
|
|
|
|
using BeWo.ServiceProxy;
|
|
|
|
|
|
using BS.Shared.DataContracts.Feature.AI;
|
|
|
|
|
|
using DevExpress.DataProcessing.InMemoryDataProcessor;
|
2025-12-30 12:35:43 +01:00
|
|
|
|
using DevExpress.Mvvm;
|
|
|
|
|
|
using DevExpress.Mvvm.POCO;
|
|
|
|
|
|
using DevExpress.XtraBars.Docking2010.Views.WindowsUI;
|
2025-12-30 11:30:01 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2025-12-30 12:35:43 +01:00
|
|
|
|
using System.Windows.Input;
|
2025-12-30 11:30:01 +01:00
|
|
|
|
|
|
|
|
|
|
namespace BeWo.ViewModel.View.Administration
|
|
|
|
|
|
{
|
2026-06-05 14:56:49 +02:00
|
|
|
|
public class AiPromptbausteinFolderViewModel : AcceptCancelDialogViewModel<AiPromptbausteinFolderDC, AiPromptbausteinFolderVM>
|
2025-12-30 11:30:01 +01:00
|
|
|
|
{
|
2026-06-05 14:56:49 +02:00
|
|
|
|
public AiPromptbausteinFolderViewModel(AiPromptbausteinFolderVM viewModel, bool isNew) : base(viewModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-12-30 12:35:43 +01:00
|
|
|
|
|
2026-06-05 14:56:49 +02:00
|
|
|
|
protected override void Save()
|
2025-12-30 12:35:43 +01:00
|
|
|
|
{
|
2026-06-05 14:56:49 +02:00
|
|
|
|
var dc = ViewModel.CommitToDataContract();
|
2025-12-30 12:35:43 +01:00
|
|
|
|
|
2026-06-05 14:56:49 +02:00
|
|
|
|
if (ViewModel.IsNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.InsertAiPromptbausteinFolder(dc), DataSave);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2025-12-30 12:35:43 +01:00
|
|
|
|
{
|
2026-06-05 14:56:49 +02:00
|
|
|
|
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.UpdateAiPromptbausteinFolder(dc), DataSave);
|
|
|
|
|
|
}
|
2025-12-30 12:35:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-05 14:56:49 +02:00
|
|
|
|
protected override bool canSave()
|
2025-12-30 12:35:43 +01:00
|
|
|
|
{
|
2026-06-05 14:56:49 +02:00
|
|
|
|
return base.canSave() && !string.IsNullOrWhiteSpace(ViewModel.Title);
|
2025-12-30 12:35:43 +01:00
|
|
|
|
}
|
2025-12-30 11:30:01 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|