75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using BeWo.View.Controls;
|
|
using BeWo.View.Detail.AI;
|
|
using BeWo.ViewModel;
|
|
using BeWo.ViewModel.View.AI;
|
|
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
|
|
{
|
|
public class BeWoControlFactory
|
|
{
|
|
public Control GetAiConversationControl(AiConversationChatViewModel vm)
|
|
{
|
|
var styleString = getStyleString(vm.ActionType);
|
|
|
|
var control = styleString is object ? new AiConversationChatView(vm, styleString) : new AiConversationChatView(vm);
|
|
|
|
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(AiActionType actionType) {
|
|
switch (actionType)
|
|
{
|
|
case AiActionType.ServiceRecordConversation: return "ModuleAiControlZeiterfassungStyle";
|
|
case AiActionType.ServiceRecordDocumentation: return "ModuleAiControlZeiterfassungStyle";
|
|
|
|
//case AiContextType.SupportConceptNavigation: return "ModuleAiControlSupportConceptStyle";
|
|
//case AiContextType.CustomerNavigation: return "ModuleAiControlCustomerStyle";
|
|
//case AiContextType.PersonNavigation: return "ModuleAiControlPersonStyle";
|
|
//case AiContextType.EmployeeNavigation: return "ModuleAiControlEmployeeStyle";
|
|
//case AiContextType.OrganisationNavigation: return "ModuleAiControlOrganisationStyle";
|
|
//case AiContextType.ServiceRecord: return "ModuleAiControlZeiterfassungStyle";
|
|
//case AiContextType.CustomerDetail: return "ModuleAiControlCustomerStyle";
|
|
//case AiContextType.PersonDetail: return "ModuleAiControlPersonStyle";
|
|
//case AiContextType.EmployeeDetail: return "ModuleAiControlEmployeeStyle";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
} |