Files
BeWoPlaner/BeWo/Services/BeWoControlFactory.cs
Rene Evertz e2f72fbea0 Merge branch 'master' into feature_rene_17_xrechnung
# Conflicts:
#	BeWo/ServiceProxy/Generated.cs
#	BeWo/Services/BeWoWindowService.cs
#	BeWo/View/Controls/GkvAbrechnungDetailControl.xaml.cs
#	BeWo/View/Windows/BeWoWindowBuilder.cs
#	Data/Data.csproj
#	Host/ServiceRecordPage.aspx.cs
#	Service/Core/ServiceHelper.cs
#	Service/Security/SecurityContextInitializer.cs
#	Service/ServiceBehavior/AdminMultitenancyContextInitializer.cs
2025-06-17 13:07:41 +02:00

104 lines
2.7 KiB
C#

using BeWo.View.Controls;
using BeWo.View.Detail.AI;
using BeWo.ViewModel;
using BeWo.ViewModel.Light;
using BS.Shared;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace BeWo.Services
{
internal class BeWoControlFactory : IControlFactory
{
public Control GetAiConversationControl(UIContext uIContext, Dictionary<TableID, long[]> context, long? reference_oid = null)
{
var styleString = getStyleString(uIContext);
var control = styleString is object ? new AiConversationChatView(styleString) : new AiConversationChatView();
control.ViewModel.UIContext = (int)uIContext;
control.ViewModel.ReferenceObjectOid = reference_oid;
control.ViewModel.ContextBeWoObjects = context;
return control;
}
public PdfViewer GetPdfViewer(byte[] bytes) => GetPdfViewer(new MemoryStream(bytes));
public PdfViewer GetPdfViewer(MemoryStream ms)
{
var control = new PdfViewer();
control.PdfData = ms;
return control;
}
public TextViewer GetTextViewer(string text)
{
var textViewer = new TextViewer();
textViewer.Text = text;
return textViewer;
}
public GkvAbrechnungDetailControl GetGkvAbrechnungDetailControl(GkvAbrechnungLightVM vm)
{
var control = new GkvAbrechnungDetailControl(vm);
return control;
}
private string getStyleString(UIContext uIContext) {
switch (uIContext)
{
case UIContext.SupportConcept: return "ModuleAiControlSupportConceptStyle";
case UIContext.Customer: return "ModuleAiControlCustomerStyle";
case UIContext.Person: return "ModuleAiControlPersonStyle";
case UIContext.Employee: return "ModuleAiControlEmployeeStyle";
case UIContext.Organisation: return "ModuleAiControlOrganisationStyle";
case UIContext.Team:
break;
case UIContext.Dokumente:
break;
case UIContext.User:
break;
case UIContext.UserGroup:
break;
case UIContext.Report:
break;
case UIContext.Scheduler:
break;
case UIContext.Wohnheim:
break;
case UIContext.Vertretungen:
break;
case UIContext.CustomerTeam:
break;
case UIContext.Scheduling:
break;
case UIContext.Finance:
break;
case UIContext.Administration:
break;
case UIContext.AiConversation:
break;
case UIContext.AiConversationPopup:
break;
case UIContext.ServiceRecord: return "ModuleAiControlZeiterfassungStyle";
case UIContext.CustomerSingle: return "ModuleAiControlCustomerStyle";
case UIContext.PersonSingle: return "ModuleAiControlPersonStyle";
case UIContext.EmployeeSingle: return "ModuleAiControlEmployeeStyle";
}
return null;
}
}
}