Vorbereitung für Rename
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
<view:BeWoView
|
||||
x:Class="BeWo.AI.View.AiChatView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
|
||||
xmlns:core="clr-namespace:BS.Shared.Core;assembly=BS.Shared"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:t="clr-namespace:BeWo.MultiLanguage.Markup"
|
||||
xmlns:validation="clr-namespace:BeWo.Validation"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<view:BeWoView.Resources>
|
||||
<!--<Expander x:Name="ExpanderTemplate" IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Margin="0" />
|
||||
</Grid>
|
||||
</Expander.Header>
|
||||
</Expander>-->
|
||||
</view:BeWoView.Resources>
|
||||
<Grid Margin="0" Background="{DynamicResource ObjectEditBackgroundBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<dxlc:LayoutControl Padding="0" Orientation="Vertical">
|
||||
<dxlc:LayoutGroup Height="200" dxlc:LayoutControl.AllowVerticalSizing="True">
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Left"
|
||||
Click="btnSettings_Click"
|
||||
Content="Einstellungen" />
|
||||
<Popup
|
||||
x:Name="PopupTemplate"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="3"
|
||||
Width="400"
|
||||
Height="300"
|
||||
Placement="MousePoint"
|
||||
StaysOpen="True">
|
||||
<Grid Margin="2,2,2,2" Background="{DynamicResource ObjectEditBackgroundBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="{t:Translate Datensatz Template}" />
|
||||
<TextBox
|
||||
x:Name="TextBoxTemplate"
|
||||
Grid.Row="1"
|
||||
MinHeight="60"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="3"
|
||||
Click="btnSaveSettings_Click"
|
||||
Content="Übernehmen" />
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="3"
|
||||
Click="btnCancelSettings_Click"
|
||||
Content="Abbrechen" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Popup>
|
||||
<Label Grid.Row="1" Content="{t:Translate Formulieren Sie hier Ihre Anfrage}" />
|
||||
<TextBox
|
||||
x:Name="TextBoxAnfrage"
|
||||
Grid.Row="2"
|
||||
MinHeight="60"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Grid>
|
||||
</dxlc:LayoutGroup>
|
||||
<dxlc:LayoutGroup dxlc:LayoutControl.AllowVerticalSizing="True">
|
||||
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{t:Translate Ergebnis}" />
|
||||
<TextBox
|
||||
x:Name="TextBoxErgebnis"
|
||||
Grid.Row="1"
|
||||
MinHeight="60"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
TextWrapping="Wrap"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
</Grid>
|
||||
</dxlc:LayoutGroup>
|
||||
</dxlc:LayoutControl>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Height="Auto"
|
||||
Margin="5,10,10,10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnSend"
|
||||
Height="25"
|
||||
Margin="0,0,3,0"
|
||||
Click="btnSend_Click"
|
||||
Content="{t:Translate Absenden}" />
|
||||
<Button
|
||||
x:Name="btnClose"
|
||||
Height="25"
|
||||
Margin="0,0,3,0"
|
||||
Click="btnClose_Click"
|
||||
Content=" Schließen " />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</view:BeWoView>
|
||||
@@ -1,160 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
|
||||
using BeWo.Annotations;
|
||||
using BeWo.Core;
|
||||
using BeWo.ServiceProxy;
|
||||
using BeWo.Validation;
|
||||
using BeWo.View;
|
||||
using BeWo.ViewModel;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Translation;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.Xpf.Editors;
|
||||
using DevExpress.Xpf.Grid;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
|
||||
namespace BeWo.AI.View
|
||||
{
|
||||
public partial class AiChatView : BeWoView
|
||||
{
|
||||
public event Action CloseButtonClicked;
|
||||
|
||||
int type = 0; //0 = ServiceRecordQuery, 1 = SingleCustomerQuery, 2 = AllCustomerQuery
|
||||
|
||||
private long cb2scOid;
|
||||
private long customerOid;
|
||||
private TableID tableID;
|
||||
private DateTime startDate;
|
||||
private DateTime endDate;
|
||||
private AiSettingsDC aiSettings;
|
||||
|
||||
public AiChatView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
public void InitServiceRecordQuery(long c2sOid, DateTime start, DateTime end)
|
||||
{
|
||||
type = 0;
|
||||
this.cb2scOid = c2sOid;
|
||||
this.startDate = start;
|
||||
this.endDate = end;
|
||||
|
||||
LoadAiSettings(1);
|
||||
}
|
||||
|
||||
|
||||
public void InitSingleCustomerQuery(long customerOid)
|
||||
{
|
||||
type = 1;
|
||||
this.customerOid = customerOid;
|
||||
}
|
||||
|
||||
public void InitObjectQuery(TableID tableId)
|
||||
{
|
||||
type = 2;
|
||||
tableID = tableId;
|
||||
}
|
||||
|
||||
private void LoadAiSettings(int settingsType)
|
||||
{
|
||||
aiSettings = ServiceFacade.DoOperationsServiceSync(s => s.GetAiSettings(settingsType));
|
||||
}
|
||||
|
||||
private void ReloadViewModel(AiChatDC dc)
|
||||
{
|
||||
TextBoxErgebnis.Text = dc.Result;
|
||||
}
|
||||
|
||||
private void btnSend_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var acdc = new AiChatDC();
|
||||
acdc.Prompt = TextBoxAnfrage.Text;
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
ServiceFacade.DoOperationsServiceAsync(s => s.CreateAiQueryForSingleCustomer(acdc, customerOid),
|
||||
dc =>
|
||||
{
|
||||
this.Dispatch(delegate
|
||||
{
|
||||
ReloadViewModel(dc);
|
||||
});
|
||||
});
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
ServiceFacade.DoOperationsServiceAsync(s => s.CreateAiQueryForObjects(acdc, (int)tableID),
|
||||
dc =>
|
||||
{
|
||||
this.Dispatch(delegate
|
||||
{
|
||||
ReloadViewModel(dc);
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
ServiceFacade.DoOperationsServiceAsync(s => s.CreateAiQueryForServiceRecords(acdc, cb2scOid, startDate, endDate),
|
||||
dc =>
|
||||
{
|
||||
this.Dispatch(delegate
|
||||
{
|
||||
ReloadViewModel(dc);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CloseButtonClicked?.Invoke();
|
||||
}
|
||||
|
||||
private void btnSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (aiSettings != null)
|
||||
{
|
||||
TextBoxTemplate.Text = aiSettings.Settings;
|
||||
}
|
||||
PopupTemplate.IsOpen = true;
|
||||
}
|
||||
|
||||
|
||||
private void btnSaveSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PopupTemplate.IsOpen = false;
|
||||
if (aiSettings != null)
|
||||
{
|
||||
aiSettings.Settings = TextBoxTemplate.Text;
|
||||
|
||||
ServiceFacade.DoOperationsServiceAsync(s => s.UpdateAiSettings(aiSettings),
|
||||
dc =>
|
||||
{
|
||||
this.Dispatch(delegate
|
||||
{
|
||||
aiSettings = dc;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCancelSettings_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PopupTemplate.IsOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,10 +331,6 @@
|
||||
<Reference Include="WindowsBase">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Page Include="AI\View\AiChatView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="BSLogoControl.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -1130,10 +1126,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="AI\AiChatController.cs" />
|
||||
<Compile Include="AI\View\AiChatView.xaml.cs">
|
||||
<DependentUpon>AiChatView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BSLogoControl.xaml.cs">
|
||||
<DependentUpon>BSLogoControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -829,27 +829,6 @@
|
||||
</TransformGroup>
|
||||
</Button.RenderTransform>
|
||||
</localView:ImageButton>
|
||||
|
||||
<localView:ImageButton
|
||||
x:Name="button_ai_chat"
|
||||
Width="90"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{StaticResource ModuleAiChatTabItem}"
|
||||
Click="button_ai_chat_Click"
|
||||
Content="{t:Translate AiModuleMenuItem}"
|
||||
ImageSource="Ressources\Icons\chatbot2.png"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Style="{StaticResource NavBarButton}"
|
||||
Visibility="Collapsed">
|
||||
<Button.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
<SkewTransform AngleX="0" AngleY="0" />
|
||||
<RotateTransform Angle="0" />
|
||||
<TranslateTransform X="0" Y="0" />
|
||||
</TransformGroup>
|
||||
</Button.RenderTransform>
|
||||
</localView:ImageButton>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -61,9 +61,7 @@ namespace BeWo
|
||||
Scheduling = 14,
|
||||
Finance = 15,
|
||||
Administration = 16,
|
||||
AiConversation = 17,
|
||||
AiConversationPopup = 18,
|
||||
ServiceRecord = 19
|
||||
ServiceRecord = 19,
|
||||
}
|
||||
|
||||
public partial class MainControl
|
||||
@@ -357,12 +355,6 @@ namespace BeWo
|
||||
case UIContext.Finance:
|
||||
view = new FinanceView();
|
||||
break;
|
||||
case UIContext.AiConversation:
|
||||
view = new AiConversationView();
|
||||
break;
|
||||
case UIContext.AiConversationPopup:
|
||||
view = new AiConversationView();
|
||||
break;
|
||||
}
|
||||
_Views[uiContext] = view;
|
||||
|
||||
@@ -1261,14 +1253,6 @@ namespace BeWo
|
||||
}
|
||||
}
|
||||
|
||||
private void button_ai_chat_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DoSaveCheck())
|
||||
{
|
||||
NavigateTo(GetViewForUIContext(UIContext.AiConversation));
|
||||
}
|
||||
}
|
||||
|
||||
//private void button_assessmentSheetEntry_Click(object sender, RoutedEventArgs e)
|
||||
//{
|
||||
// if (this.DoSaveCheck())
|
||||
@@ -1944,14 +1928,5 @@ namespace BeWo
|
||||
NavigateTo(GetViewForUIContext(UIContext.Scheduling));
|
||||
}
|
||||
}
|
||||
|
||||
private void button_ai_chat_popup_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var view = GetViewForUIContext(UIContext.AiConversationPopup);
|
||||
|
||||
var window = BeWoWindowBuilder.GetBeWoWindow("Ai Chat", view, 800, 1200);
|
||||
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -923,9 +923,9 @@
|
||||
Content="Geburtstag" />
|
||||
<Grid Grid.Row="3" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<dxe:DateEdit
|
||||
Grid.Column="0"
|
||||
@@ -936,18 +936,16 @@
|
||||
AllowNullInput="True"
|
||||
EditValue="{Binding Path=DateOfBirth, UpdateSourceTrigger=PropertyChanged}"
|
||||
MaskType="DateTimeAdvancingCaret" />
|
||||
<Label
|
||||
Grid.Column="1"
|
||||
Content="Geburtsort" />
|
||||
<Label Grid.Column="1" Content="Geburtsort" />
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
Height="23"
|
||||
Margin="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{val:ValidationBinding Path=PlaceOfBirth,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Grid>
|
||||
|
||||
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
@@ -1313,29 +1311,6 @@
|
||||
Increment="1"
|
||||
IsFloatValue="False"
|
||||
MinValue="0" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="ButtonOpenAiChat"
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
Width="Auto"
|
||||
Margin="5,2,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
PreviewMouseLeftButtonDown="OpenAiChat">
|
||||
<Hyperlink
|
||||
Foreground="Transparent"
|
||||
NavigateUri="https://www.bewoplaner.de"
|
||||
TargetName="newWindow">
|
||||
|
||||
<Image
|
||||
Width="48"
|
||||
Height="48"
|
||||
HorizontalAlignment="Left"
|
||||
Source="..\..\Ressources\Icons\chatbot.png"
|
||||
Style="{StaticResource toolbarImageStyle}" />
|
||||
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox
|
||||
|
||||
@@ -50,7 +50,6 @@ using HorizontalAlignment = System.Windows.HorizontalAlignment;
|
||||
using Hyperlink = System.Windows.Documents.Hyperlink;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using VerticalAlignment = System.Windows.VerticalAlignment;
|
||||
using BeWo.AI;
|
||||
using BeWo.View.Navigation;
|
||||
using DevExpress.Mvvm;
|
||||
using System.Collections;
|
||||
@@ -168,14 +167,6 @@ namespace BeWo.View.Detail
|
||||
|
||||
}
|
||||
|
||||
if (BeWoApp.AppSettings.ShowAIInternal)
|
||||
{
|
||||
ButtonOpenAiChat.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonOpenAiChat.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
#if DEBUG
|
||||
tabitem_stundenplan.Visibility = Visibility.Visible;
|
||||
#endif
|
||||
@@ -1938,13 +1929,6 @@ namespace BeWo.View.Detail
|
||||
BeWoUtils.ShowImageForm(Img.Source);
|
||||
}
|
||||
|
||||
private void OpenAiChat(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
AiChatController.ShowAiChatViewForSingleCustomer(ViewModel.DataContract.CustomerOid.Value, Math.Min(800, this.ActualHeight), Math.Min(1200, this.ActualWidth));
|
||||
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
|
||||
@@ -600,27 +600,6 @@
|
||||
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
x:Name="ButtonOpenAiChat"
|
||||
Grid.Column="2"
|
||||
Width="Auto"
|
||||
Margin="5,2,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
PreviewMouseLeftButtonDown="OpenAiChat"
|
||||
Visibility="{Binding OpenAiChatButtonVisible, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Hyperlink
|
||||
Foreground="Transparent"
|
||||
NavigateUri="https://www.bewoplaner.de"
|
||||
TargetName="newWindow">
|
||||
|
||||
<Image
|
||||
Width="48"
|
||||
Height="48"
|
||||
HorizontalAlignment="Left"
|
||||
Source="..\..\..\Ressources\Icons\chatbot.png"
|
||||
Style="{StaticResource toolbarImageStyle}" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
@@ -3321,9 +3300,8 @@
|
||||
Margin="10,0,0,0"
|
||||
Command="{Binding Path=OpenAiWindowCommand, RelativeSource={RelativeSource AncestorType={x:Type localView:BeWoView}}}"
|
||||
Content="{StaticResource AiDesignsIconKIChatWeissOrange}"
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}" >
|
||||
</Button>
|
||||
</StackPanel>
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -50,8 +50,7 @@ using Size = System.Windows.Size;
|
||||
using SupportConceptService = BeWo.Core.Service.SupportConceptService;
|
||||
using VerticalAlignment = System.Windows.VerticalAlignment;
|
||||
using DependencyObject = System.Windows.DependencyObject;
|
||||
using BeWo.AI.View;
|
||||
using BeWo.AI;
|
||||
using BeWo.View.Detail.AI;
|
||||
using BeWo.View.Windows;
|
||||
using BeWo.Core.Commands;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
@@ -5063,32 +5062,6 @@ namespace BeWo.View.Detail.Zeiterfassung
|
||||
BeWoUtils.NavigateToReportUri(url, "Druckvorschau");
|
||||
}
|
||||
|
||||
private void OpenAiChat(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var node = ViewModel.SelectedCustomerNode;
|
||||
long c2sOid = 0;
|
||||
|
||||
if (node != null && node.SupportConceptTreeNodeDC != null && node.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
|
||||
{
|
||||
c2sOid = node.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.CostBearer2SupportConceptOid.Value;
|
||||
}
|
||||
|
||||
var sr = ViewModel.ServiceRecordsForSelectedCustomer;
|
||||
|
||||
var earliestStartDate = sr.Any() ? sr.OrderBy(o => o.StartDate).First().StartDate : DateTime.Now;
|
||||
var latestEndDate = sr.Any()
|
||||
? sr.OrderByDescending(o => o.EndDate).First().EndDate
|
||||
: DateTime.Now.AddSeconds(1);
|
||||
|
||||
if (latestEndDate.Hour == 0 && latestEndDate.Minute == 0 && latestEndDate.Second == 1)
|
||||
{
|
||||
latestEndDate = latestEndDate.AddHours(23);
|
||||
latestEndDate = latestEndDate.AddMinutes(59);
|
||||
}
|
||||
|
||||
AiChatController.ShowAiChatViewForServiceRecords(c2sOid, earliestStartDate, latestEndDate, Math.Min(800, this.ActualHeight), Math.Min(1200, this.ActualWidth));
|
||||
|
||||
}
|
||||
private void multiSupportConceptControl_ListChanged(object sender, EventArgs<IList<CompactSupportConceptDC>> e)
|
||||
{
|
||||
ViewModel.UpdateGroupServiceAccountings(e.Data);
|
||||
|
||||
@@ -331,7 +331,6 @@
|
||||
MainGroupHeader="{markup:Translate Klienten}"
|
||||
MainListItemStyle="{StaticResource CustomerDetailStyle}"
|
||||
OnReloadData="MainNavigationView_OnReloadData"
|
||||
OpenAiChat="MainNavigationView_OpenAiChat"
|
||||
OpenMailMergeWindow="MainNavigationView_OnOpenMailMergeWindow"
|
||||
OpenObject="mainNavigationView_OpenObject"
|
||||
Print="mainNavigationView_Print"
|
||||
|
||||
@@ -23,7 +23,6 @@ using BS.Shared.Extensions;
|
||||
using BS.Shared.Translation;
|
||||
|
||||
using Microsoft.Win32;
|
||||
using BeWo.AI;
|
||||
using BeWo.View.Document;
|
||||
using DevExpress.Mvvm;
|
||||
using System;
|
||||
@@ -71,11 +70,6 @@ namespace BeWo.View.Navigation
|
||||
//supportConceptFilterComboBox.SelectionChanged = "sortCombo_SelectionChanged";
|
||||
supportConceptFilterComboBox.Style = FindResource("SortComboBox") as Style;
|
||||
|
||||
if (BeWoApp.AppSettings.ShowAIInternal)
|
||||
{
|
||||
mainNavigationView.btnOpenAi.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
if (BeWoApp.LoggedOnUser.HasRight(UserRightType.CustomerView_View) || BeWoApp.LoggedOnUser.HasRight(UserRightType.ViewAll))
|
||||
{
|
||||
supportConceptFilterComboBox.Items.Add(new CustomerFilterItem(CustomerFilterEnum.All));
|
||||
@@ -549,10 +543,5 @@ namespace BeWo.View.Navigation
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void MainNavigationView_OpenAiChat()
|
||||
{
|
||||
AiChatController.ShowAiChatViewForObjects(TableID.Customer, 800, 1200);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,13 +267,6 @@
|
||||
Click="btnDelete_Click"
|
||||
Content="Löschen"
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}" />
|
||||
<Button
|
||||
x:Name="btnOpenAi"
|
||||
Margin="10,0,0,0"
|
||||
Click="btnOpenAi_Click"
|
||||
Content="KI"
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}"
|
||||
Visibility="Collapsed" />
|
||||
<StackPanel Margin="0" Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
@@ -96,8 +96,6 @@ namespace BeWo.View.Navigation
|
||||
|
||||
public delegate void ImportObjectsDelegate();
|
||||
|
||||
public delegate void OpenAiChatDelegate();
|
||||
|
||||
public delegate bool DeleteObjectDelegate(IFilterableDC obj);
|
||||
|
||||
public delegate void OpenObjectDelegate(IFilterableDC obj);
|
||||
@@ -114,8 +112,6 @@ namespace BeWo.View.Navigation
|
||||
|
||||
public event ImportObjectsDelegate ImportObjects;
|
||||
|
||||
public event OpenAiChatDelegate OpenAiChat;
|
||||
|
||||
public event DeleteObjectDelegate DeleteObject;
|
||||
|
||||
public event EventHandler<EventArgs<IEnumerable<IFilterableDC>>> ExcelExport;
|
||||
@@ -225,19 +221,6 @@ namespace BeWo.View.Navigation
|
||||
}
|
||||
}
|
||||
|
||||
public bool OpenAiButtonVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
return btnOpenAi.Visibility == Visibility.Visible;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
btnOpenAi.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
//[TypeConverter(typeof(UserRightTypeArrayConverter))]
|
||||
//public UserRightType[] ImportDemands
|
||||
//{
|
||||
@@ -627,35 +610,6 @@ namespace BeWo.View.Navigation
|
||||
}
|
||||
}
|
||||
|
||||
// Christian
|
||||
private void btnOpenAi_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (OpenAiChat != null)
|
||||
{
|
||||
OpenAiChat();
|
||||
}
|
||||
}
|
||||
|
||||
// Rene Window
|
||||
private void btnOpenAi2_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
if (OpenAiChat != null)
|
||||
{
|
||||
OpenAiChat();
|
||||
}
|
||||
}
|
||||
|
||||
// Rene ModalPopup
|
||||
private void btnOpenAi3_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (OpenAiChat != null)
|
||||
{
|
||||
OpenAiChat();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnCopy_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (CopyObject != null)
|
||||
|
||||
@@ -453,11 +453,6 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
get { return BeWoApp.AppSettings.ShowHilfeplanStatistikReport && SelectedCustomerNode != null && SelectedCustomerNode.SupportConceptTreeNodeDC != null; }
|
||||
}
|
||||
|
||||
public bool OpenAiChatButtonVisible
|
||||
{
|
||||
get { return BeWoApp.AppSettings.ShowAI && (BeWoApp.LoggedOnUser.HasRight(UserRightType.AiChatInZeiterfassung)) && SelectedCustomerNode != null && SelectedCustomerNode.SupportConceptTreeNodeDC != null; }
|
||||
}
|
||||
|
||||
public ServiceRecordTimeInterval ServiceRecordTimeInterval
|
||||
{
|
||||
get { return _ServiceRecordTimeInterval; }
|
||||
|
||||
Reference in New Issue
Block a user