Files
BeWoPlaner/BeWo/AI/AiChatController.cs
2025-04-14 10:15:45 +02:00

47 lines
1.4 KiB
C#

using BeWo.AI.View;
using BeWo.View;
using BeWo.View.Windows;
using BS.Shared;
using BS.Shared.Translation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.AI
{
class AiChatController
{
private static void CreateAiChatWindow(AiChatView view, double height, double width)
{
var beWoWindow = BeWoWindowBuilder.GetBeWoWindow(Translator.Translate("Frage unsere KI"), view, height, width);
view.CloseButtonClicked += () => beWoWindow.Close();
beWoWindow.ShowDialog();
}
public static void ShowAiChatViewForServiceRecords(long c2sOid, DateTime start, DateTime end, double height, double width)
{
var ctrl = new AiChatView();
ctrl.InitServiceRecordQuery(c2sOid, start, end);
CreateAiChatWindow(ctrl, height, width);
}
public static void ShowAiChatViewForSingleCustomer(long customerOid, double height, double width)
{
var ctrl = new AiChatView();
ctrl.InitSingleCustomerQuery(customerOid);
CreateAiChatWindow(ctrl, height, width);
}
public static void ShowAiChatViewForObjects(TableID tableId, double height, double width)
{
var ctrl = new AiChatView();
ctrl.InitObjectQuery(tableId);
CreateAiChatWindow(ctrl, height, width);
}
}
}