Button zum Start des Import in Overview eingebaut, Dialog für die Auswahl von Meldeklassen erstellt

This commit is contained in:
Daniel Schick 2021-11-29 09:18:36 +01:00
parent 47ced21a34
commit a6b055e76f
10 changed files with 221 additions and 11 deletions

View File

@ -35,6 +35,7 @@ namespace ENI2.DetailViewControls
{
InitializeComponent();
this.Loaded += BorderPoliceDetailControl_Loaded;
}
private void BorderPoliceDetailControl_Loaded(object sender, RoutedEventArgs e)

View File

@ -83,16 +83,16 @@
<Button IsEnabled="False" Name="buttonSendPDF" Grid.Column="3" Grid.Row="6" Margin="2" Click="buttonSendPDF_Click" Content="{x:Static p:Resources.textCreatePDF}"/>
<Button Name="buttonQueryHIS" Grid.Column="4" Grid.Row="6" Margin="2" Click="buttonQueryHIS_Click" Content="{x:Static p:Resources.textQueryHIS}"/>
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="6">
<Button Name="buttonRefresh" Margin="2" Click="buttonRefresh_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipRefresh}">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/nav_refresh_blue.png" Margin="0,0,5,0" Height="24"/>
<!--TextBlock Text="{x:Static p:Resources.textRefresh}" VerticalAlignment="Center"/-->
</StackPanel>
</Button>
<Button Name="buttonRefresh" Margin="2" Click="buttonRefresh_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipRefresh}">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/nav_refresh_blue.png" Margin="0,0,5,0" Height="24"/>
<!--TextBlock Text="{x:Static p:Resources.textRefresh}" VerticalAlignment="Center"/-->
</StackPanel>
</Button>
<Button Name="buttonInfoCore" Margin="2" Click="buttonInfoCore_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipDetails}">
<Image Source="../Resources/document_view.png" Margin="0,0,5,0" Height="24" />
</Button>
<Button Name="buttonValidate" Margin="2" Click="buttonValidate_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipValidation}">
<Image Source="../Resources/hand_point.png" Margin="0,0,5,0" Height="24" />
</Button>
@ -105,6 +105,9 @@
<Label Grid.Column="0" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelCancelled" VerticalContentAlignment="Center" FontWeight="Bold" />
<Label Grid.Column="1" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelHIS" VerticalContentAlignment="Center" Content="{x:Static p:Resources.textSendToHIS}" />
<ComboBox Grid.Column="2" Grid.Row="7" Margin="2" Name="comboBoxInitialHis" VerticalContentAlignment="Center" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding Path=InitialHIS}" />
<Button Grid.Column="3" Grid.Row="7" Margin="2" Name="buttonExcelImport" Content="{x:Static p:Resources.textExcelImport}" Click="buttonExcelImport_Click">
<!-- hier könnte noch ein nettes Icon hin -->
</Button>
<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="7" Visibility="Hidden" Name="stackPanelLock">
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />

View File

@ -713,6 +713,20 @@ namespace ENI2.DetailViewControls
this.OnRequestValidate();
}
private void buttonExcelImport_Click(object sender, RoutedEventArgs e)
{
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
if((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
{
// get here if user selected some classes
// start importer
// show import result?
}
}
#endregion
#region mouse wheel
@ -725,6 +739,6 @@ namespace ENI2.DetailViewControls
}
#endregion
}
}

View File

@ -37,7 +37,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>6.6.3.0</ApplicationVersion>
<ApplicationVersion>6.7.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -358,6 +358,9 @@
<Compile Include="EditControls\NewWithIdDialog.xaml.cs">
<DependentUpon>NewWithIdDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\SelectImportClassesDialog.xaml.cs">
<DependentUpon>SelectImportClassesDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\ShowIdDialog.xaml.cs">
<DependentUpon>ShowIdDialog.xaml</DependentUpon>
</Compile>
@ -607,6 +610,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\SelectImportClassesDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\ShowIdDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -0,0 +1,28 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectImportClassesDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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"
xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textSelectImportClasses}" Height="700" Width="250" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="27" />
<RowDefinition Height="1*" />
<RowDefinition Height="27" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".5*"/>
<ColumnDefinition Width=".5*"/>
</Grid.ColumnDefinitions>
<Button x:Name="buttonAll" Grid.Column="0" Margin="2" Content="{x:Static p:Resources.textSelectAll}" Click="buttonAll_Click" />
<Button x:Name="buttonNone" Grid.Column="1" Margin="2" Content="{x:Static p:Resources.textSelectNone}" Click="buttonNone_Click"/>
</Grid>
<xctk:CheckListBox x:Name="checkListBoxClasses" Grid.Row="1" Margin="2" VerticalAlignment="Stretch" ValueMemberPath="Class" DisplayMemberPath="Name" SelectedMemberPath="IsSelected" />
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,109 @@
// Copyright (c) 2017-today schick Informatik
// Description: Select classes for import
// Returns: Array of selected classes as property
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using bsmd.database;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for SelectImportClassesDialog.xaml
/// </summary>
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
{
private List<SelectClass> _selectClasses = new List<SelectClass>();
private List<bsmd.database.Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
public SelectImportClassesDialog()
{
InitializeComponent();
this.Loaded += SelectImportClassesDialog_Loaded;
}
public List<bsmd.database.Message.NotificationClass> SelectedClasses
{
get { return _selectedClasses; }
}
private void SelectImportClassesDialog_Loaded(object sender, RoutedEventArgs e)
{
foreach(bsmd.database.Message.NotificationClass notificationClass in Enum.GetValues(typeof(bsmd.database.Message.NotificationClass)))
{
SelectClass sc = new SelectClass();
sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), notificationClass);
sc.Class = notificationClass;
sc.IsSelected = false;
_selectClasses.Add(sc);
}
_selectClasses.Sort();
this.checkListBoxClasses.ItemsSource = _selectClasses;
this.OKClicked += SelectImportClassesDialog_OKClicked;
}
private void SelectImportClassesDialog_OKClicked()
{
foreach(SelectClass sc in _selectClasses)
{
if (sc.IsSelected) _selectedClasses.Add(sc.Class);
}
}
class SelectClass : IComparable, INotifyPropertyChanged
{
private bool _isSelected;
public string Name { get; set; }
public bsmd.database.Message.NotificationClass Class { get; set; }
public bool IsSelected
{
get { return _isSelected; }
set
{
_isSelected = value;
OnPropertyChanged("IsSelected");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
if(PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public int CompareTo(object obj)
{
return Name.CompareTo(((SelectClass)obj).Name);
}
}
private void buttonAll_Click(object sender, RoutedEventArgs e)
{
foreach (SelectClass sc in _selectClasses)
sc.IsSelected = true;
}
private void buttonNone_Click(object sender, RoutedEventArgs e)
{
foreach (SelectClass sc in _selectClasses)
sc.IsSelected = false;
}
}
}

View File

@ -2081,6 +2081,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Excel Import.
/// </summary>
public static string textExcelImport {
get {
return ResourceManager.GetString("textExcelImport", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Excepted quantities.
/// </summary>
@ -4025,6 +4034,33 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Select all.
/// </summary>
public static string textSelectAll {
get {
return ResourceManager.GetString("textSelectAll", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select classes to import.
/// </summary>
public static string textSelectImportClasses {
get {
return ResourceManager.GetString("textSelectImportClasses", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select none.
/// </summary>
public static string textSelectNone {
get {
return ResourceManager.GetString("textSelectNone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Send date.
/// </summary>

View File

@ -1738,4 +1738,16 @@
<data name="undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="textExcelImport" xml:space="preserve">
<value>Excel Import</value>
</data>
<data name="textSelectAll" xml:space="preserve">
<value>Select all</value>
</data>
<data name="textSelectImportClasses" xml:space="preserve">
<value>Select classes to import</value>
</data>
<data name="textSelectNone" xml:space="preserve">
<value>Select none</value>
</data>
</root>

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("6.6.0")]
[assembly: AssemblyInformationalVersion("6.7.0")]
[assembly: AssemblyCopyright("Copyright © 2014-2021 schick Informatik")]
[assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("6.6.0.*")]
[assembly: AssemblyVersion("6.7.0.*")]