Merge pull request 'Data editing' (#77) from data-editing into main
Reviewed-on: #77
This commit was merged in pull request #77.
This commit is contained in:
@@ -71,4 +71,11 @@
|
||||
|
||||
<Folder Include="assets\fonts\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="PreviewWindow.axaml.cs">
|
||||
<DependentUpon>PreviewWindow.axaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -79,6 +79,14 @@
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MnIAdSetView" Click="MnIAdSetView_OnClick">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<LucideIcon Kind="Eye" Width="12" Height="12" Size="12" />
|
||||
<Label Content="Anzeigen" VerticalContentAlignment="Center" />
|
||||
</StackPanel>
|
||||
</MenuItem.Header>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetDelete_OnClick" IsEnabled="True">
|
||||
<MenuItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@@ -1377,4 +1377,14 @@ public partial class MainWindow : Window
|
||||
BtnCombineAddressSetSortUp.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void MnIAdSetView_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (LstCustomerAdressSets.SelectedItems.Count > 0)
|
||||
{
|
||||
var preview = new PreviewWindow((LstCustomerAdressSets.SelectedItems[0] as KasAddressList).KasPersons);
|
||||
preview.Show();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Icon="assets/icon.ico"
|
||||
xmlns:local="using:Logof_Client" Closing="Window_OnClosing"
|
||||
x:Class="Logof_Client.PreviewWindow"
|
||||
Title="Datensätze bearbeiten" x:DataType="local:PreviewWindow">
|
||||
<Grid ColumnDefinitions="*,400"
|
||||
Margin="10">
|
||||
|
||||
<!-- Adressliste -->
|
||||
<ListBox Grid.Column="0"
|
||||
x:Name="AddressList"
|
||||
ItemsSource="{Binding Addresses}"
|
||||
SelectedItem="{Binding SelectedAddress}"
|
||||
SelectionMode="Single">
|
||||
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
<Grid ColumnDefinitions="70,150,180,250,80,180,150"
|
||||
Height="32">
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding id}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding vorname}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="{Binding name}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="3"
|
||||
Text="{Binding strasse}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="4"
|
||||
Text="{Binding plz}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="5"
|
||||
Text="{Binding ort}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<TextBlock Grid.Column="6"
|
||||
Text="{Binding land}"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
</ListBox>
|
||||
|
||||
|
||||
<!-- Editor -->
|
||||
<ScrollViewer Grid.Column="1"
|
||||
Margin="15,0,0,0">
|
||||
|
||||
<StackPanel Spacing="6">
|
||||
|
||||
<TextBlock Text="Adresse bearbeiten"
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
|
||||
<Grid ColumnDefinitions="120,*"
|
||||
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" RowSpacing="4">
|
||||
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="ID"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.id}"
|
||||
IsReadOnly="True" IsEnabled="False"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="RefSID"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.refsid}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="Anrede"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.anrede}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="3"
|
||||
Text="Titel"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.titel}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="Vorname"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.vorname}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="5"
|
||||
Text="Adel"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.adel}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="6"
|
||||
Text="Name"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="7"
|
||||
Text="Namenszusatz"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.namezus}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="8"
|
||||
Text="Anredzusatz"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.anredzus}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="9"
|
||||
Text="Straße"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.strasse}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="10"
|
||||
Text="Straße 2"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="10"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.strasse2}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="11"
|
||||
Text="PLZ"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="11"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.plz}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="12"
|
||||
Text="Ort"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="12"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.ort}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="13"
|
||||
Text="Land"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="13"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.land}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="14"
|
||||
Text="PPLZ"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="14"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.pplz}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="15"
|
||||
Text="Postfach"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="15"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.postfach}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="16"
|
||||
Text="Name 1"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="16"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name1}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="17"
|
||||
Text="Name 2"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="17"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name2}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="18"
|
||||
Text="Name 3"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="18"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name3}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="19"
|
||||
Text="Name 4"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="19"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name4}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="20"
|
||||
Text="Name 5"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="20"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.name5}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="21"
|
||||
Text="Funktion"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="21"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.funktion}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="22"
|
||||
Text="Funktion 2"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="22"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.funktion2}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="23"
|
||||
Text="Abteilung"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="23"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.abteilung}"/>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="24"
|
||||
Text="Funktion AD"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="24"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedAddress.funktionad}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Logof_Client;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
||||
{
|
||||
public ObservableCollection<KasPerson> Addresses { get; }
|
||||
|
||||
private KasPerson? _selectedAddress;
|
||||
|
||||
public KasPerson? SelectedAddress
|
||||
{
|
||||
get => _selectedAddress;
|
||||
set
|
||||
{
|
||||
_selectedAddress = value;
|
||||
PropertyChanged?.Invoke(
|
||||
this,
|
||||
new PropertyChangedEventArgs(nameof(SelectedAddress)));
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Addresses = new ObservableCollection<KasPerson>(addresses);
|
||||
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
|
||||
{
|
||||
Settings.Save();
|
||||
Global.Save();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@
|
||||
<!-- </DataGrid.Columns> -->
|
||||
<!-- -->
|
||||
<!-- </DataGrid> -->
|
||||
<ListBox ItemsSource="{Binding Results}" SelectedItems="{Binding SelectedResults}">
|
||||
<ListBox ItemsSource="{Binding Results}" SelectionMode="Multiple" x:Name="LbResults" SelectedItems="{Binding SelectedResults}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel />
|
||||
|
||||
+14
-1
@@ -230,7 +230,20 @@ public partial class ResultWindow : Window, INotifyPropertyChanged
|
||||
|
||||
private void BtnShowSelected_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
// once upon a time, there was a feature like this
|
||||
if (LbResults.SelectedItems.Count > 0)
|
||||
{
|
||||
var selectedPersons = LbResults.SelectedItems
|
||||
.Cast<ResultItem>()
|
||||
.Select(x => x.Person)
|
||||
.ToList();
|
||||
|
||||
if (selectedPersons.Count == 0)
|
||||
return;
|
||||
|
||||
var preview = new PreviewWindow(selectedPersons);
|
||||
preview.Show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnExecuteFilter_OnClick(object? sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user