Compare commits

..

3 Commits

77 changed files with 921 additions and 2097 deletions

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
(c) 2017-present Informatikbüro Daniel Schick
-->
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
<applicationSettings>
<ENI2.Properties.Settings>
@ -28,101 +28,26 @@
<setting name="LockingServerAddress" serializeAs="String">
<value>http://192.168.2.24/LockingService/LockingService.svc</value>
</setting>
<setting name="ReportAuthor" serializeAs="String">
<value>BSMD ReportGenerator</value>
</setting>
<setting name="ConnectionString" serializeAs="String">
<value>Initial Catalog=nswtest;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
<value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
</setting>
</ENI2.Properties.Settings>
</applicationSettings>
<userSettings>
<ENI2.Properties.Settings>
<setting name="MainWindowPlacement" serializeAs="String">
<value />
</setting>
<setting name="Width" serializeAs="String">
<value>825</value>
</setting>
<setting name="Height" serializeAs="String">
<value>450</value>
</setting>
<setting name="W1Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W1Top" serializeAs="String">
<value>0</value>
</setting>
<setting name="W2Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W2Top" serializeAs="String">
<value>0</value>
</setting>
<setting name="W3Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W3Top" serializeAs="String">
<value>0</value>
<value/>
</setting>
</ENI2.Properties.Settings>
</userSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647" />
<binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:11651/LockingService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="LockingServiceReference.IService" name="BasicHttpBinding_IService" />
<endpoint address="http://localhost:11651/LockingService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="LockingServiceReference.IService" name="BasicHttpBinding_IService"/>
</client>
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.2" newVersion="6.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -8,7 +8,6 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
namespace ENI2.Controls
{
@ -162,9 +161,8 @@ namespace ENI2.Controls
}
if (!abort)
{
var tabControl = Parent as TabControl;
tabControl.SelectedItem = null;
_ = Dispatcher.BeginInvoke(new Action(() => tabControl.Items.Remove(this)), DispatcherPriority.Background);
var tabControl = Parent as ItemsControl;
tabControl.Items.Remove(this);
}
};
dockPanel.Children.Add(closeButton);

View File

@ -1,113 +0,0 @@
<UserControl x:Class="ENI2.Controls.EasyPeasyControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ENI2.Controls"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="1024" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded">
<DockPanel>
<!-- Header with logo -->
<Border DockPanel.Dock="Top" Padding="10" Background="#FFFDF6">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<!-- Embed SVG via Image (optional): place your SVG as a DrawingImage in resources, or replace with PNG -->
<TextBlock Text="🍋 easy-peasy" FontSize="20" FontWeight="Bold" Margin="0,0,16,0"/>
<TextBlock Text="Edit • Paste • Export XML" VerticalAlignment="Center"/>
</StackPanel>
</Border>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Margin="12" Orientation="Vertical" >
<!-- Top-level fields -->
<UniformGrid Columns="4" Rows="3" Margin="0,0,0,12" Height="84">
<TextBlock Text="Art der Identification (Vertreter)" Margin="0,0,4,0" VerticalAlignment="Center" TextAlignment="Right"/>
<TextBox Text="{Binding DelegateIdentificationType, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Art der Identifikation (Kunde)" VerticalAlignment="Center" Margin="0,0,4,0" TextAlignment="Right" />
<TextBox Text="{Binding TraderIdentificationType, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="LRN" TextAlignment="Right" Margin="0,0,4,0" VerticalAlignment="Center"/>
<TextBox Text="{Binding LRN, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Identifikationsnummer (Kunde)" Margin="0,0,4,0" VerticalAlignment="Center" TextAlignment="Right" />
<TextBox Text="{Binding TraderIdentificationNumber, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Land" TextAlignment="Right" Margin="0,0,4,0" VerticalAlignment="Center"/>
<TextBox Text="{Binding Country, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Identifikationsnummer (Vertreter)" Margin="0,0,4,0" VerticalAlignment="Center" TextAlignment="Right"/>
<TextBox Text="{Binding DelegateIdentificationNumber, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
</UniformGrid>
<!-- ProofInformation -->
<GroupBox Header="Kennung des Antrags auf Nachweis TZ2L(F)">
<StackPanel Margin="8">
<UniformGrid Columns="4" Rows="4" Margin="0,0,0,12" >
<TextBlock Text="Zuständige Zollstelle" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.CompetentCustomsOffice, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Art der Anmeldung" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.DeclarationType, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Text="Datum Anmeldung
(yyyy-MM-ddTHH:mm:ss)" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.DeclarationDate, StringFormat={}{0:yyyy-MM-ddTHH:mm:ss}, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center" />
<TextBlock Text="Gesamtrohmasse (kg)" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox x:Name="textBoxTotalGrossMass" Text="{Binding ProofInformationT2LT2LF.TotalGrossMassKg, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Text="Antrag auf Gültigkeitsdauer des Nachweises (in Tagen)" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.RequestedValidityOfTheProof.NumberOfDays, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Art des Antrags" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.RequestType, UpdateSourceTrigger=PropertyChanged}" Margin="2" VerticalContentAlignment="Center"/>
</UniformGrid>
<GroupBox Header="Warenort">
<UniformGrid Columns="6" Margin="8" Height="28">
<TextBlock Text="Art des Ortes" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.LocationOfGoods.TypeOfLocation}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Art der Ortsbestimmung" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.LocationOfGoods.QualifierOfIdentification}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="UNLocode" TextAlignment="Right" VerticalAlignment="Center" Margin="0,0,4,0"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.LocationOfGoods.UNLocode}" Margin="2" VerticalContentAlignment="Center"/>
</UniformGrid>
</GroupBox>
<CheckBox Content="In Containern beförderte Waren" Margin="8"
IsChecked="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.ContainerIndication}"/>
<!-- Goods Items grid (paste target) -->
<TextBlock Text="Warenpositionen (Paste tab/CSV with columns: HS, Item#, Description, Gross, Net, Pkgs, Type, Marks)" Margin="4,12,0,4"/>
<DataGrid ItemsSource="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF}"
AutoGenerateColumns="False" SelectionMode="Extended" x:Name="dataGridGoodsItems" CanUserAddRows="False"
PreviewKeyDown="DataGrid_PreviewKeyDown" Focusable="True" MinHeight="80" IsTabStop="True" MaxHeight="320">
<DataGrid.Columns>
<DataGridTextColumn Header="HS Code" Binding="{Binding Commodity.HarmonizedSystemSubHeadingCode}"/>
<DataGridTextColumn Header="Item #" Binding="{Binding GoodsItemNumber}"/>
<DataGridTextColumn Header="Description" Binding="{Binding DescriptionOfGoods}" Width="2*"/>
<DataGridTextColumn Header="Gross" Binding="{Binding GoodsMeasure.GrossMass}"/>
<DataGridTextColumn Header="Net" Binding="{Binding GoodsMeasure.NetMass}"/>
<DataGridTextColumn Header="Pkgs" Binding="{Binding Packaging.NumberOfPackages}"/>
<DataGridTextColumn Header="Type" Binding="{Binding Packaging.TypeOfPackages}"/>
<DataGridTextColumn Header="Marks" Binding="{Binding Packaging.ShippingMarks}" Width="*"/>
</DataGrid.Columns>
</DataGrid>
<GroupBox Header="Dokumente" Margin="0,12,0,0">
<UniformGrid Columns="4" Margin="8" Height="28">
<TextBlock Text="Art des Dokuments" Margin="0,0,4,0" VerticalAlignment="Center" TextAlignment="Right"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.TransportDocuments.Type}" Margin="2" VerticalContentAlignment="Center"/>
<TextBlock Text="Referenznummer" Margin="0,0,4,0" VerticalAlignment="Center" TextAlignment="Right"/>
<TextBox Text="{Binding ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.TransportDocuments.ReferenceNumber}" Margin="2" VerticalContentAlignment="Center" />
</UniformGrid>
</GroupBox>
</StackPanel>
</GroupBox>
<!-- Actions -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,16,0,0">
<Button x:Name="buttonImport" Content="Import" Width="100" Margin="0,0,8,0" Click="buttonImport_Click" />
<Button x:Name="buttonClear" Content="Clear" Width="100" Margin="0,0,8,0" Click="buttonClear_Click"/>
<Button x:Name="buttonExport" Content="Export" Width="120" Click="buttonExport_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</DockPanel>
</UserControl>

View File

@ -1,506 +0,0 @@
// Copyright (c) 2017- schick Informatik
// Description: Display dialog for customs XML data upload app
//
using bsmd.database.EasyPeasy;
using ENI2.Util;
using Microsoft.Win32;
using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Xml;
using System.Xml.Serialization;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for EasyPeasyControl.xaml
/// </summary>
public partial class EasyPeasyControl : UserControl
{
private ProofRequest _vm;
#region Construction
public EasyPeasyControl()
{
InitializeComponent();
this.dataGridGoodsItems.ContextMenu = new ContextMenu();
MenuItem addItem = new MenuItem();
addItem.Header = Properties.Resources.textAdd;
addItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/add.png")) };
addItem.Click += AddItem_Click;
this.dataGridGoodsItems.ContextMenu.Items.Add(addItem);
MenuItem deleteItem = new MenuItem();
deleteItem.Header = Properties.Resources.textDelete;
deleteItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/delete.png")) };
deleteItem.Click += DeleteItem_Click;
this.dataGridGoodsItems.ContextMenu.Items.Add(deleteItem);
// Add separator and paste option
this.dataGridGoodsItems.ContextMenu.Items.Add(new Separator());
MenuItem pasteItem = new MenuItem();
pasteItem.Header = "Paste";
pasteItem.Click += (s, e) => HandlePasteOperation();
this.dataGridGoodsItems.ContextMenu.Items.Add(pasteItem);
// Add command bindings for proper keyboard handling
this.dataGridGoodsItems.CommandBindings.Add(new CommandBinding(
ApplicationCommands.Paste,
(s, e) => HandlePasteOperation(),
(s, e) => e.CanExecute = Clipboard.ContainsText()));
}
#endregion
public void SaveState()
{
try
{
EasyPeasyState.Save(_vm);
}
catch { }
}
#region context menu event handler
private void AddItem_Click(object sender, RoutedEventArgs e)
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF == null) return;
var list = _vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF;
int nextItemNo = list.Any() ? list.Max(x => x.GoodsItemNumber) + 1 : 1;
var item = new GoodsItemForT2LT2LF
{
GoodsItemNumber = nextItemNo
};
list.Add(item);
}
private void DeleteItem_Click(object sender, RoutedEventArgs e)
{
foreach(GoodsItemForT2LT2LF item in this.dataGridGoodsItems.SelectedItems.Cast<GoodsItemForT2LT2LF>().ToArray())
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF == null) return;
var list = _vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF;
list.Remove(item);
}
}
#endregion
#region button event handler
private void buttonClear_Click(object sender, RoutedEventArgs e)
{
CleanupAutoCalculation();
this._vm = EasyPeasyState.CreateDefault();
if (_vm.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF == null)
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF = new ObservableCollection<GoodsItemForT2LT2LF>();
_vm.ProofInformationT2LT2LF.DeclarationDate = DateTime.Now; // reset to today
_vm.ProofInformationT2LT2LF.RequestedValidityOfTheProof.NumberOfDays = 90; // default 90 days
this.DataContext = this._vm;
SetupAutoCalculation();
}
private void buttonExport_Click(object sender, RoutedEventArgs e)
{
var dlg = new SaveFileDialog
{
FileName = "proofRequest.xml",
Filter = "XML file|*.xml",
OverwritePrompt = true
};
if (dlg.ShowDialog() == true)
{
try
{
var ser = new XmlSerializer(typeof(ProofRequest));
// Namespaces (if needed)
// var ns = new XmlSerializerNamespaces();
// ns.Add("xsd", "http://www.w3.org/2001/XMLSchema");
// ns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance");
var settings = new XmlWriterSettings
{
Indent = true,
OmitXmlDeclaration = true
};
using (var fs = File.Create(dlg.FileName))
using (var xw = XmlWriter.Create(fs, settings))
{
ser.Serialize(xw, _vm); //, ns);
}
MessageBox.Show("Exported successfully.", "easy-peasy", MessageBoxButton.OK, MessageBoxImage.Information);
}
catch (Exception ex)
{
MessageBox.Show("Export failed:\n" + ex.Message, "easy-peasy", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
private void buttonImport_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "XML file|*.xml";
ofd.RestoreDirectory = true;
ofd.Multiselect = false;
if (ofd.ShowDialog() == true)
{
using (var fs = File.OpenRead(ofd.FileName))
{
CleanupAutoCalculation();
var ser = new XmlSerializer(typeof(ProofRequest));
_vm = (ProofRequest)ser.Deserialize(fs);
// after loading/creating _vm
if (_vm.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF == null)
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF = new ObservableCollection<GoodsItemForT2LT2LF>();
_vm.ProofInformationT2LT2LF.DeclarationDate = DateTime.Now; // reset to today
if(_vm.ProofInformationT2LT2LF.RequestedValidityOfTheProof.NumberOfDays == 9)
_vm.ProofInformationT2LT2LF.RequestedValidityOfTheProof.NumberOfDays = 90; // default 90 days
this.DataContext = _vm;
SetupAutoCalculation();
}
}
}
#endregion
#region loaded/unloaded event handler
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
_vm = EasyPeasyState.LoadOrCreate();
if (_vm.ProofInformationT2LT2LF == null)
_vm.ProofInformationT2LT2LF = new ProofInformationT2LT2LF();
if (_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF == null)
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF = new GoodsShipmentForT2LT2LF
{
LocationOfGoods = new LocationOfGoods(),
TransportDocuments = new TransportDocuments()
};
_vm.ProofInformationT2LT2LF.DeclarationDate = DateTime.Now; // reset to today
this.DataContext = _vm;
SetupAutoCalculation();
}
private void UserControl_Unloaded(object sender, RoutedEventArgs e)
{
CleanupAutoCalculation();
try
{
EasyPeasyState.Save(_vm);
}
catch { }
}
#endregion
#region auto calculation total gross mass
private void SetupAutoCalculation()
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF != null)
{
// Subscribe to collection changes (add/remove items)
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF.CollectionChanged += GoodsItems_CollectionChanged;
// Subscribe to DataGrid cell changes
dataGridGoodsItems.CellEditEnding += DataGridGoodsItems_CellEditEnding;
// Calculate initial total
CalculateTotalGrossMass();
}
}
private void CleanupAutoCalculation()
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF != null)
{
// Unsubscribe from collection changes
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF.CollectionChanged -= GoodsItems_CollectionChanged;
dataGridGoodsItems.CellEditEnding -= DataGridGoodsItems_CellEditEnding;
}
}
private void DataGridGoodsItems_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
// Check if the edited column is GrossMass
if (e.Column.Header.ToString() == "Gross")
{
// Delay calculation to allow the binding to update
Dispatcher.BeginInvoke(new Action(() => {
CalculateTotalGrossMass();
}), System.Windows.Threading.DispatcherPriority.Background);
}
}
private void GoodsItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
// Recalculate total after any collection change
CalculateTotalGrossMass();
}
private void CalculateTotalGrossMass()
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF?.GoodsItemsForT2LT2LF != null)
{
var total = _vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF
.Sum(item => item.GoodsMeasure?.GrossMass ?? 0m);
_vm.ProofInformationT2LT2LF.TotalGrossMassKg = total;
// Force UI update by refreshing the binding
var binding = BindingOperations.GetBindingExpression(
FindTotalGrossMassTextBox(), TextBox.TextProperty);
binding?.UpdateTarget();
}
}
// Simple property changed notification helper
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private TextBox FindTotalGrossMassTextBox()
{
// Find the TextBox that displays TotalGrossMassKg
return this.FindName("textBoxTotalGrossMass") as TextBox ??
this.GetTemplateChild("textBoxTotalGrossMass") as TextBox;
}
#endregion
#region cut & paste logic
private void HandlePasteOperation()
{
if (Clipboard.ContainsText())
{
var text = Clipboard.GetText();
if (!TryPaste_EspHsPkgsGross(text))
PasteGoodsItems(text);
}
}
private void DataGrid_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.V && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
{
if (Clipboard.ContainsText())
{
var text = Clipboard.GetText();
if(!TryPaste_EspHsPkgsGross(text))
PasteGoodsItems(text);
e.Handled = true;
}
}
}
private void PasteGoodsItems(string text)
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF == null) return;
var lines = text.Replace("\r\n", "\n").Replace('\r', '\n')
.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
// Split by tab first; if only one column, try CSV
var cells = line.Split('\t');
if (cells.Length == 1) cells = SplitCsv(line);
// Expected order: HS, Item#, Description, Gross, Net, Pkgs, Type, Marks
var item = new GoodsItemForT2LT2LF();
if (cells.Length > 0) item.Commodity.HarmonizedSystemSubHeadingCode = cells[0].Trim();
if (cells.Length > 1 && int.TryParse(cells[1], out var n)) item.GoodsItemNumber = n;
if (cells.Length > 2) item.DescriptionOfGoods = cells[2].Trim();
if (cells.Length > 3 && decimal.TryParse(cells[3], out var gross)) item.GoodsMeasure.GrossMass = gross;
if (cells.Length > 4 && decimal.TryParse(cells[4], out var net)) item.GoodsMeasure.NetMass = net;
if (cells.Length > 5 && int.TryParse(cells[5], out var pkgs)) item.Packaging.NumberOfPackages = pkgs;
if (cells.Length > 6) item.Packaging.TypeOfPackages = cells[6].Trim();
if (cells.Length > 7) item.Packaging.ShippingMarks = cells[7].Trim();
_vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF.Add(item);
}
}
// Very small CSV splitter (handles quotes)
private static string[] SplitCsv(string line)
{
var res = new System.Collections.Generic.List<string>();
var sb = new StringBuilder();
bool inQuotes = false;
for (int i = 0; i < line.Length; i++)
{
char c = line[i];
if (c == '\"')
{
if (inQuotes && i + 1 < line.Length && line[i + 1] == '\"')
{ sb.Append('\"'); i++; }
else { inQuotes = !inQuotes; }
}
else if (c == ',' && !inQuotes)
{ res.Add(sb.ToString()); sb.Clear(); }
else { sb.Append(c); }
}
res.Add(sb.ToString());
return res.ToArray();
}
private bool TryPaste_EspHsPkgsGross(string text)
{
if (_vm?.ProofInformationT2LT2LF?.GoodsShipmentForT2LT2LF == null) return false;
// Normalize and split lines
var lines = text.Replace("\r\n", "\n").Replace('\r', '\n')
.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
if (lines.Length == 0) return false;
// Determine next item number
var list = _vm.ProofInformationT2LT2LF.GoodsShipmentForT2LT2LF.GoodsItemsForT2LT2LF;
int nextItemNo = list.Any() ? list.Max(x => x.GoodsItemNumber) + 1 : 1;
bool anyAdded = false;
bool countrySeen = false;
foreach (var raw in lines)
{
var line = raw; // do not Trim() entirely; keep leading tab as empty first cell
var cells = line.Split('\t'); // keeps empty entries
// Expected:
// - 4 cells: [ESP or ""], [HS], [Pkgs], [Gross]
// - 3 cells: [HS], [Pkgs], [Gross]
string hs = null, pkgs = null, gross = null;
if (cells.Length >= 4)
{
string c0 = cells[0]?.Trim();
// Optionally capture the first token like "ESP" (country tag),
// only once and only if alphabetic (won't throw if numeric)
if (!countrySeen && !string.IsNullOrWhiteSpace(c0) && c0.All(ch => char.IsLetter(ch)))
{
// If you decide later this should set a field, uncomment:
// if (string.IsNullOrWhiteSpace(_vm.Country)) _vm.Country = c0;
countrySeen = true;
}
hs = (cells.Length > 1 ? cells[1] : null);
pkgs = (cells.Length > 2 ? cells[2] : null);
gross = (cells.Length > 3 ? cells[3] : null);
}
else if (cells.Length == 3)
{
hs = cells[0];
pkgs = cells[1];
gross = cells[2];
}
else
{
// Not enough data for this format; skip the row
continue;
}
if (string.IsNullOrWhiteSpace(hs)) continue;
var item = new GoodsItemForT2LT2LF
{
GoodsItemNumber = nextItemNo++,
DescriptionOfGoods = "" // per spec
};
item.Commodity.HarmonizedSystemSubHeadingCode = hs.Trim();
if (TryParseIntFlexible(pkgs, out var pk))
item.Packaging.NumberOfPackages = pk;
if (TryParseDecimalFlexible(gross, out var g))
{
item.GoodsMeasure.GrossMass = g;
var net = g; // - 1m; // now net mass equals gross mass (no deduction)
if (net < 0m) net = 0m;
item.GoodsMeasure.NetMass = net;
}
item.DescriptionOfGoods = "Brand New Vehicles"; // per spec
item.Packaging.TypeOfPackages = "UN"; // per spec
item.Packaging.ShippingMarks = "-"; // per spec
list.Add(item);
anyAdded = true;
}
return anyAdded;
}
#endregion
#region static utils
// this will go somewhere else later
// Try parse decimal with current culture, invariant, and comma/dot flip
private static bool TryParseDecimalFlexible(string s, out decimal value)
{
s = (s ?? "").Trim();
// 1) current culture
if (decimal.TryParse(s, NumberStyles.Number, CultureInfo.CurrentCulture, out value)) return true;
// 2) invariant
if (decimal.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out value)) return true;
// 3) flip comma/dot and retry (helps when clipboard mixes locales)
string flipped = s.Contains(",") ? s.Replace(",", ".") : s.Replace(".", ",");
if (decimal.TryParse(flipped, NumberStyles.Number, CultureInfo.CurrentCulture, out value)) return true;
if (decimal.TryParse(flipped, NumberStyles.Number, CultureInfo.InvariantCulture, out value)) return true;
value = 0m;
return false;
}
private static bool TryParseIntFlexible(string s, out int value)
{
s = (s ?? "").Trim();
// Extract leading integer if something like "12 pcs"
var digits = new string(s.TakeWhile(ch => char.IsDigit(ch) || ch == '-' || ch == '+').ToArray());
if (string.IsNullOrEmpty(digits)) digits = s;
return int.TryParse(digits, NumberStyles.Integer, CultureInfo.CurrentCulture, out value)
|| int.TryParse(digits, NumberStyles.Integer, CultureInfo.InvariantCulture, out value);
}
#endregion
}
}

View File

@ -70,7 +70,7 @@ namespace ENI2
/// <summary>
/// Damit kann ein Listenelement eine Validierung der gesamten Anmeldung auslösen (inkl. Highlighting) (auf Knopfdruck)
/// </summary>
public event Action<bool> RequestValidate;
public event Action RequestValidate;
/// <summary>
/// Alle Meldeklassen die auf "zu versenden" stehen werden validiert und falls die Validierung scheitert auf "SUSPEND" gestellt
@ -160,9 +160,9 @@ namespace ENI2
this.RequestReload?.Invoke(coreId);
}
protected virtual void OnRequestValidate(bool showDialog)
protected virtual void OnRequestValidate()
{
this.RequestValidate?.Invoke(showDialog);
this.RequestValidate?.Invoke();
}
protected virtual void OnRequestSendValidation()

View File

@ -15,7 +15,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220" x:Name="leftColumnDefinition"/>
<ColumnDefinition Width="220" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

View File

@ -189,7 +189,6 @@ namespace ENI2
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text11DangerousCargoDeparture, MessageGroupControlType = typeof(DangerousCargoControl), ImagePath = "Resources/sign_warning_radiation.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text12ATAATD, MessageGroupControlType = typeof(ATAControl), ImagePath = "Resources/clock.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text13WasteReceipts, MessageGroupControlType = typeof(WasteReceiptsControl), ImagePath = "Resources/garbage.png" });
this.leftColumnDefinition.Width = new GridLength(260);
}
this.listBoxMessages.ItemsSource = this._listBoxList;
@ -226,7 +225,6 @@ namespace ENI2
public void CoreChanged(MessageCore newCore)
{
this.Core = newCore;
this.ReloadCore();
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
if(controlCache.ContainsKey(Properties.Resources.textOverview))
@ -528,14 +526,9 @@ namespace ENI2
{
if ((message.Status == Message.MessageStatus.ACCEPTED) &&
((message.InternalStatus == Message.BSMDStatus.CONFIRMED) || (message.InternalStatus == Message.BSMDStatus.VIOLATION)))
{
message.InternalStatus = Message.BSMDStatus.UPDATED;
message.Status = null; // reset send status
}
else
{
message.InternalStatus = Message.BSMDStatus.SAVED;
}
string userName = "?";
if(App.UserId.HasValue && DBManager.Instance.GetReportingPartyDict().ContainsKey(App.UserId.Value))
@ -664,7 +657,7 @@ namespace ENI2
private void ShortCutValidate(object sender, ExecutedRoutedEventArgs e)
{
this.DetailControl_RequestValidate(true);
this.DetailControl_RequestValidate();
}
private void DetailControl_RequestReload(Guid id)
@ -777,9 +770,9 @@ namespace ENI2
}
}
private void DetailControl_RequestValidate(bool showDialog)
private void DetailControl_RequestValidate()
{
this.Validate(showDialog, out _, out _);
this.Validate(true, out _, out _);
}
private void Validate(bool showMessages, out List<MessageViolation> vViolations, out List<MessageError> vErrors)
@ -800,21 +793,6 @@ namespace ENI2
List<MessageViolation> violations = new List<MessageViolation>();
ruleEngine.ValidateMessage(aMessage, out errors, out violations);
if (errors.Count > 0)
aMessage.ErrorCount = errors.Count;
else
aMessage.ErrorCount = null;
if (violations.Count > 0)
{
aMessage.ViolationCount = violations.Count;
aMessage.PositionViolationCount = violations.Count(v => !v.Identifier.IsNullOrEmpty());
}
else
{
aMessage.ViolationCount = null;
aMessage.PositionViolationCount = null;
}
string messageGroup = this.MessageGroupForMessage(aMessage);
if (messageGroup != null)
@ -1300,7 +1278,7 @@ namespace ENI2
private void _errorListDialog_RefreshClicked()
{
DetailControl_RequestValidate(true);
DetailControl_RequestValidate();
}
private void _errorListDialog_ErrorSelected(DatabaseEntity obj)

View File

@ -11,7 +11,7 @@
xmlns:data="clr-namespace:bsmd.database;assembly=bsmd.database"
xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1024">
d:DesignHeight="300" d:DesignWidth="800">
<xctk:BusyIndicator Name="busyIndicator">
<xctk:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
@ -26,85 +26,75 @@
</StackPanel>
</xctk:BusyIndicator.BusyContent>
<GroupBox Name="visitTransitGroupBox" Header="{x:Static p:Resources.textOverview}">
<GroupBox Name="visitTransitGroupBox" Header="{x:Static p:Resources.textVisitTransit}">
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="4" />
<RowDefinition Height="36" />
<RowDefinition Height="32" />
<RowDefinition Height="32" />
<RowDefinition Height="4" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="4" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" Margin="0,0,10,0"/>
<enictrl:LocodeControl Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" IsEnabled="False" />
<!--Grid Grid.Column="1" Grid.Row="0" Width="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<xctk:WatermarkComboBox Grid.Column="0" x:Name="comboBoxPoC" Margin="2" IsEditable="True" Watermark="Type for Locode.." TextBoxBase.TextChanged="ComboBox_TextChanged" ItemsSource="{Binding LocodePoCList, Mode=TwoWay}" SelectedItem="{Binding PoC, Mode=TwoWay}" />
<Image Name="imagePoCState" Grid.Column="1" Source="../Resources/bullet_ball_grey.png" />
</-->
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textVisitTransitId}" Margin="0,0,10,0" />
<TextBox Name="textBoxDisplayId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" IsReadOnly="True" Margin="2" VerticalContentAlignment="Center" />
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" Margin="0,0,10,0" />
<TextBox Name="textBoxIMO" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="1" Text="{Binding IMO, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textENI}" Margin="0,0,10,0" />
<TextBox Name="textBoxENI" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Text="{Binding ENI, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textETAPortOfCall}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="3" Content="{x:Static p:Resources.textETDPortOfCall}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textATAPortOfCall}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textATDPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" />
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<Label HorizontalAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
<Label Name="labelCreated" Grid.Column="4" Grid.Row="4" Margin="2, 0, 0, 0" />
<Button Name="buttonFormblattNeu" Grid.Column="4" Grid.Row="7" Margin="2" Click="buttonFormblattNeu_Click" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="Formblatt neu"></TextBlock>
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
</StackPanel>
</Button>
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textVisitTransitId}" Margin="0,0,10,0" />
<TextBox Name="textBoxDisplayId" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" IsReadOnly="True" Margin="2" VerticalContentAlignment="Center" />
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" Margin="0,0,10,0"/>
<enictrl:LocodeControl Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" IsEnabled="False" />
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" Margin="0,0,10,0" />
<TextBox Name="textBoxIMO" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1" Text="{Binding IMO, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textENI}" Margin="0,0,10,0" />
<TextBox Name="textBoxENI" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding ENI, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textETAPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="4" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" />
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textETDPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="5" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textATAPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="6" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textATDPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
<Label HorizontalAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textRemarks}" Margin="0,0,10,0" />
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
<Label Name="labelCreated" Grid.Column="1" Grid.Row="9" Margin="2, 0, 0, 0" />
<Label Grid.Column="2" Grid.Row="9" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" />
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="11">
<Label Grid.Column="0" Grid.Row="6" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" />
<Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="6" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}" Background="Red"/>
<Button IsEnabled="True" Name="buttonCopy" Grid.Column="2" Grid.Row="6" Margin="2" Click="buttonCopy_Click" Content="{x:Static p:Resources.textCopyData}"/>
<Button IsEnabled="True" Name="buttonSendPDF" Grid.Column="3" Grid.Row="6" Margin="2" Click="buttonSendPDF_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static p:Resources.textCreatePDF}"></TextBlock>
<Image Source="../Resources/document_pdf.png" Margin="10,0,5,0" Height="16"/>
</StackPanel>
</Button>
<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"/>
@ -124,45 +114,15 @@
</Button>
-->
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="11" Visibility="Hidden" Name="stackPanelLock">
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
</StackPanel>
<Label Grid.Column="0" Grid.Row="13" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelHIS" VerticalContentAlignment="Center" Content="{x:Static p:Resources.textSendToHIS}" />
<ComboBox Grid.Column="1" Grid.Row="13" Margin="2" Name="comboBoxInitialHis" VerticalContentAlignment="Center" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding Path=InitialHIS}" />
<Button IsEnabled="True" Name="buttonSendAll" Grid.Column="1" Grid.Row="14" Content="{x:Static p:Resources.textSendAll}" Margin="2" Click="buttonSendAll_Click" />
<Button Grid.Column="1" Grid.Row="16" Margin="2" Name="buttonExcelImport" Click="buttonExcelImport_Click">
<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" Click="buttonExcelImport_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static p:Resources.textExcelImport}"></TextBlock>
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
</StackPanel>
</Button>
<Button IsEnabled="True" Name="buttonSendPDF" Grid.Column="1" Grid.Row="17" Margin="2" Click="buttonSendPDF_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static p:Resources.textCreatePDF}"></TextBlock>
<Image Source="../Resources/document_pdf.png" Margin="10,0,5,0" Height="16"/>
</StackPanel>
</Button>
<Button Name="buttonQueryHIS" Grid.Column="1" Grid.Row="18" Margin="2" Click="buttonQueryHIS_Click" Content="{x:Static p:Resources.textQueryHIS}"/>
<Button IsEnabled="True" Name="buttonCopy" Grid.Column="1" Grid.Row="19" Margin="2" Click="buttonCopy_Click" Content="{x:Static p:Resources.textCopyData}"/>
<Button Name="buttonFormblattNeu" Grid.Column="1" Grid.Row="20" Margin="2" Click="buttonFormblattNeu_Click" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="Formblatt neu"></TextBlock>
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
</StackPanel>
</Button>
<Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="22" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}" Background="Red"/>
<Label Grid.Column="2" Grid.Row="21" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelCancelled" VerticalContentAlignment="Center" FontWeight="Bold" />
<!--
<Button Grid.Column="4" Grid.Row="7" Margin="2" Name="buttonExcelExport" Click="buttonExcelExport_Click">
<StackPanel Orientation="Horizontal">
@ -171,64 +131,14 @@
</StackPanel>
</Button>
-->
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="4" Visibility="Hidden" Name="stackPanelLock">
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
</StackPanel>
</Grid>
<!-- Data Grid -->
<DataGrid Grid.Row="0" Grid.ColumnSpan="1" Grid.Column="1" Margin="2" x:Name="dataGridMessages" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" CanUserAddRows="False"
SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_MouseDoubleClick" PreviewKeyDown="dataGrid_PreviewKeyDown">
<DataGrid.Resources>
<Style TargetType="{x:Type DataGridColumnHeadersPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeadersPresenter}">
<Grid Background="Transparent" Grid.IsSharedSizeScope="True">
<!-- 3 header rows: 0 = main title, 1 = group headers, 2 = real column headers -->
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- One ColumnDefinition per DataGridTextColumn (or sharedsize groups) -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Columns[0].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[1].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[2].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[3].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[4].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[5].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[6].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[7].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[8].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[9].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[10].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[11].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[12].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[13].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[14].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="{Binding Columns[15].ActualWidth, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<!-- …add as many as you need… -->
</Grid.ColumnDefinitions>
<!-- Row0: A single big header across all columns -->
<!--TextBlock Grid.Row="0" Grid.ColumnSpan="4" Text="Main Application" HorizontalAlignment="Center" FontWeight="Bold"/ -->
<!-- Row1: your “banded” group headers -->
<TextBlock Grid.Row="0" Grid.Column="5" Grid.ColumnSpan="2" Text="{x:Static p:Resources.textENIStatus}" HorizontalAlignment="Stretch" TextAlignment="Center" Padding="0,2,0,4" Background="AntiqueWhite" />
<TextBlock Grid.Row="0" Grid.Column="7" Grid.ColumnSpan="9" Text="{x:Static p:Resources.textNSWStatus}" HorizontalAlignment="Stretch" TextAlignment="Center" Padding="0,2,0,4" Background="AliceBlue"/>
<!-- Row2: the real column headers -->
<!-- This invisible filler ensures the layout lines up -->
<DataGridColumnHeader x:Name="PART_FillerColumnHeader" Grid.Row="1" Grid.ColumnSpan="14" IsHitTestVisible="False"/>
<!-- And here the ItemsPresenter will place each DataGridColumnHeader -->
<ItemsPresenter Grid.Row="1" Grid.ColumnSpan="16"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid Grid.Row="9" Grid.ColumnSpan="6" Margin="0,8,0,0" x:Name="dataGridMessages" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" CanUserAddRows="False"
SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_MouseDoubleClick" PreviewKeyDown="dataGrid_PreviewKeyDown">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
@ -252,40 +162,22 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="Yellow" />
</MultiDataTrigger>
<DataTrigger Binding="{Binding SendSuccess}" Value="True">
<Setter Property="Background" Value="#92F592"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding InternalStatus}" Value="UPDATED">
<Setter Property="Background" Value="#DFFDDF"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding InternalStatus}" Value="TOSEND">
<Setter Property="Background" Value="#BFFDBF"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding InternalStatus}" Value="SENT">
<Setter Property="Background" Value="#BFFDBF"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding HasSystemErrors}" Value="True">
<Setter Property="Background" Value="MistyRose"></Setter>
</DataTrigger>
<!--DataTrigger Binding="{Binding HasErrors}" Value="True">
<Setter Property="Background" Value="PaleVioletRed"></Setter>
</DataTrigger-->
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header=" " Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<!--Image Source="{Binding src:Util.ImageDict[ENINotificationDetailGroup]}" /-->
<!--Image Source="{Binding Source={x:Static src:Util.ImageDict}, Path=[ENINotificationDetailGroup]}"></-->
<Image Source="{Binding ENINotificationIconString, Converter={util:NullImageConverter}}" Height="24" />
<Image Source="{Binding ENINotificationIconString, Converter={util:NullImageConverter}}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}" IsReadOnly="True" Width="0.1*" FontWeight="Bold">
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}"
IsReadOnly="True" Width="0.075*" FontWeight="Bold">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
@ -293,75 +185,6 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding BSMDStatusOverviewDisplay}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.2*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textErrors}" IsReadOnly="True" Width="0.06*" Binding="{Binding ErrorCount}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontWeight" Value="DemiBold" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textViolations}" IsReadOnly="True" Width="0.06*" Binding="{Binding ViolationCount}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontWeight" Value="DemiBold" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="HIS" Binding="{Binding HISOverviewDisplay}" IsReadOnly="True" Width="0.06*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textReceivedAt}" Binding="{Binding ReceivedAt}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textSentBy}" Binding="{Binding SentBy}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -434,7 +257,6 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -447,7 +269,41 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textReceivedAt}" Binding="{Binding ReceivedAt}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding InternalStatus}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="HIS" Binding="{Binding HIS}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textSentBy}" Binding="{Binding SentBy}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatusInfo}" Binding="{Binding StatusInfo}" IsReadOnly="True" Width="0.2*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
@ -455,7 +311,13 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.2*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>

View File

@ -22,7 +22,6 @@ using System.Diagnostics;
using System.ComponentModel;
using static bsmd.database.Message;
using PdfSharp.Fonts;
using System.Linq;
namespace ENI2.DetailViewControls
{
@ -31,9 +30,6 @@ namespace ENI2.DetailViewControls
/// </summary>
public partial class OverViewDetailControl : DetailBaseControl
{
#region Fields
private Message _message = null;
private Message _ataMessage;
private Message _atdMessage;
@ -43,20 +39,12 @@ namespace ENI2.DetailViewControls
private readonly object _collectionLock = new object();
// private MessageSendStatusDialog mssd = null;
#endregion
#region Construction
public OverViewDetailControl()
{
InitializeComponent();
this.Loaded += OverViewDetailControl_Loaded;
}
#endregion
#region Initialize
private void OverViewDetailControl_Loaded(object sender, RoutedEventArgs e)
{
// die Controls nach Änderungen monitoren
@ -73,6 +61,18 @@ namespace ENI2.DetailViewControls
this.RegisterDateTimePickerChange(this.dateTimePickerETD, Message.NotificationClass.NOA_NOD);
}
private void CoreLocode_LocodeChanged(object sender, PropertyChangedEventArgs e)
{
this.OnNotificationClassChanged(null);
}
private void CoreTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
this.OnNotificationClassChanged(null);
}
#region Initialize
public override void Initialize()
{
bool iAmAdmin = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsAdmin;
@ -318,8 +318,6 @@ namespace ENI2.DetailViewControls
BindingOperations.EnableCollectionSynchronization(this.Messages, _collectionLock);
this.dataGridMessages.ItemsSource = this.Messages;
this.OnRequestValidate(false);
base.Initialize(); // wenn Meldeklassen erst bei der Init. erzeugt werden, fehlen die Handler, die hier erneut festgelegt werden
this._initialized = true;
}
@ -357,9 +355,6 @@ namespace ENI2.DetailViewControls
this.buttonExcelImport.IsEnabled = !this.Core.DisplayId.IsNullOrEmpty();
this.dataGridMessages.ItemsSource = null;
this.dataGridMessages.ItemsSource = this.Messages;
//MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
//ShowIdDialog sid = new ShowIdDialog(this.Core)
//{
@ -436,28 +431,21 @@ namespace ENI2.DetailViewControls
{
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmSend, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
this.SendMessages(this.dataGridMessages.SelectedItems.Cast<Message>());
}
}
private void SendMessages(IEnumerable<Message> messages)
{
bool somethingsNotSaved = false;
foreach (Message selectedMessage in messages)
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
if (selectedMessage.IsDirty) somethingsNotSaved = true;
}
if (somethingsNotSaved)
if(somethingsNotSaved)
{
if (MessageBox.Show(Properties.Resources.textUnsavedChangesSendAnyWay, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
return;
}
List<Message> watchList = new List<Message>();
foreach (Message selectedMessage in messages)
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
if (selectedMessage.Reset) selectedMessage.Reset = false; // "nochmal" Versenden ist möglich
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
@ -480,6 +468,7 @@ namespace ENI2.DetailViewControls
this.OnRequestSendValidation();
this.dataGridMessages.Items.Refresh();
/*
if (this.mssd == null)
{
@ -501,6 +490,7 @@ namespace ENI2.DetailViewControls
this.mssd.AddMessages(watchList);
*/
}
}
private void contextResetMessage(object sender, RoutedEventArgs e)
{
@ -633,16 +623,6 @@ namespace ENI2.DetailViewControls
#region event handler
private void CoreLocode_LocodeChanged(object sender, PropertyChangedEventArgs e)
{
this.OnNotificationClassChanged(null);
}
private void CoreTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
this.OnNotificationClassChanged(null);
}
private void _checkStatusTimer_Elapsed(object sender, ElapsedEventArgs e)
{
bool? statusFlag = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreQueryStatusFlag(this.Core.Id.Value);
@ -751,7 +731,7 @@ namespace ENI2.DetailViewControls
private void buttonValidate_Click(object sender, RoutedEventArgs e)
{
this.OnRequestValidate(true);
this.OnRequestValidate();
}
/// <summary>
@ -781,7 +761,7 @@ namespace ENI2.DetailViewControls
this.OnRequestReload(this.Core.Id.Value);
// validate all selected import classes (Finger with "selection")
this.OnRequestValidate(true);
this.OnRequestValidate();
}
else
@ -835,73 +815,6 @@ namespace ENI2.DetailViewControls
}
}
private void buttonSendAll_Click(object sender, RoutedEventArgs e)
{
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
List<Message.NotificationClass> readyToSendMessages = new List<Message.NotificationClass>();
// Evaluate a number of criteria for messages that should not be preselected for sending
bool addToSend;
foreach (Message message in this.Messages)
{
addToSend = true;
// if ((message.ErrorCount ?? 0) > 0) continue; // skip selection if there are any errors left
switch(message.MessageNotificationClass)
{
case NotificationClass.HAZA:
addToSend = XtraSendLogic.ShouldSendMessage(message); break;
case NotificationClass.HAZD:
addToSend = XtraSendLogic.ShouldSendMessage(message); break;
case NotificationClass.BPOL:
if (message.Elements.Count > 0)
{
if (message.Elements[0] is BPOL bpol)
{
if (bpol.PortOfItineraries.Count == 0) addToSend = false;
}
}
break;
case NotificationClass.WAS_RCPT:
addToSend = false;
break;
case NotificationClass.INFO:
if (Core.PoC == "DEHAM") addToSend = false;
break;
default:
if(Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) addToSend = false;
break;
}
if(addToSend)
readyToSendMessages.Add(message.MessageNotificationClass);
}
sicd.Messages = this.Messages;
sicd.PreselectedClasses.AddRange(readyToSendMessages);
sicd.IsTransit = this.Core.IsTransit;
sicd.IsImportMode = false;
if ((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
{
// now send all selected messages
List<Message> toSendMessages = new List<Message>();
foreach(NotificationClass notificationClass in sicd.SelectedClasses)
{
Message selectedMessage = this.Messages.Find(x => x.MessageNotificationClass == notificationClass);
if (selectedMessage != null)
{
toSendMessages.Add(selectedMessage);
}
}
if (toSendMessages.Count > 0)
{
this.SendMessages(toSendMessages);
}
}
}
#endregion
}

View File

@ -12,7 +12,7 @@
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}">
<ScrollViewer>
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="300" />
@ -92,9 +92,8 @@
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" Name="label_AgentPhone" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" Name="label_AgentEMail" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCity}" Name="label_AgentCity" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textFirstName}" Name="label_AgentFirstName" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textFax}" Name="label_AgentFax" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textWasteDisposalServiceProvider}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textFirstName}" Name="label_AgentFirstName" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textFax}" Name="label_AgentFax" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textCountry}" Name="label_AgentCountry" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textAgentTemplate}" Name="labelAgentTemplate" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textTitle}" Name="labelAgentTemplateTitle" Margin="0,0,10,0" Visibility="Hidden" />
@ -105,11 +104,10 @@
<TextBox Grid.Row="3" Grid.Column="3" Name="textBox_AgentCity" MaxLength="99" Margin="2" Text="{Binding AgentCity, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="3" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="99" Margin="2" Text="{Binding AgentCountry, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
<TextBox Grid.Row="5" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="5" Grid.Column="3" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="6" Grid.Column="3" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="6" Grid.Column="1" Name="textBox_AgentPhone" MaxLength="99" Margin="2" Text="{Binding AgentPhone, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="6" Grid.Column="3" Name="textBox_AgentFax" MaxLength="99" Margin="2" Text="{Binding AgentFax, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="7" Grid.Column="3" Name="textBox_AgentFax" MaxLength="99" Margin="2" Text="{Binding AgentFax, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="7" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="7" Grid.Column="3" Name="textBox_WasteDisposalServiceProvider" MaxLength="99" Margin="2" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<ComboBox Grid.Row="0" Grid.Column="3" Name="comboBox_AgentTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="AgentTitle" SelectionChanged="comboBox_AgentTemplate_SelectionChanged" />
<Grid Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right">

View File

@ -25,7 +25,6 @@ namespace ENI2.DetailViewControls
private NOA_NOD _noa_nod;
private AGNT _agnt;
private WAS _was;
private static List<AGNT_Template> _agntTemplates = null;
private AGNT_Template _currentTemplate;
private AGNT_Template _undoTemplate;
@ -69,9 +68,6 @@ namespace ENI2.DetailViewControls
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentCountry, Message.NotificationClass.AGNT);
// WAS
this.RegisterTextboxChange(this.textBox_WasteDisposalServiceProvider, Message.NotificationClass.WAS);
this.buttonSaveTemplate.IsEnabled = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor;
this.buttonDeleteTemplate.IsEnabled = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor;
}
@ -99,16 +95,6 @@ namespace ENI2.DetailViewControls
_agnt = new AGNT();
this.ControlMessages.Add(aMessage);
}
if(aMessage.MessageNotificationClass == Message.NotificationClass.WAS)
{
if (aMessage.Elements.Count > 0)
_was = aMessage.Elements[0] as WAS;
else
_was = new WAS();
this.ControlMessages.Add(aMessage);
}
}
this.dateTimePicker_ETAToKielCanal.IsEnabled = this.Core.IsTransit;
@ -137,8 +123,6 @@ namespace ENI2.DetailViewControls
this.dateTimePicker_ETDFromLastPort.DataContext = _noa_nod;
this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
this.textBox_WasteDisposalServiceProvider.DataContext = _was;
this.checkBox_IsAnchored.IsEnabled = this.Core.IsDK;
if(_agntTemplates == null)
@ -353,8 +337,6 @@ namespace ENI2.DetailViewControls
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentStreetAndNumber.Text = this._undoTemplate.AgentStreetAndNumber;
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_WasteDisposalServiceProvider.Text = this._undoTemplate.WasteDisposalServiceProviderName;
this.textBox_WasteDisposalServiceProvider.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.buttonUndoTemplate.IsEnabled = false; // can't undo after undo
}
@ -363,13 +345,6 @@ namespace ENI2.DetailViewControls
{
if (this._currentTemplate == null) return;
// confirm overwrite of waste disposal service provider
if (this.textBox_WasteDisposalServiceProvider.Text.Length > 0)
{
string message = string.Format(Properties.Resources.textConfirmWSDPOverwrite, this.textBox_WasteDisposalServiceProvider.Text, this._currentTemplate.WasteDisposalServiceProviderName);
if (MessageBox.Show(message, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No) { return; }
}
this._undoTemplate = createFromCurrentText(null, null);
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;
@ -381,7 +356,7 @@ namespace ENI2.DetailViewControls
this.textBox_AgentEMail.Text = this._currentTemplate.AgentEMail;
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentFax.Text = this._currentTemplate.AgentFax;
this.textBox_AgentFax.GetBindingExpression (TextBox.TextProperty).UpdateSource();
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentFirstName.Text = this._currentTemplate.AgentFirstName;
this.textBox_AgentFirstName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentLastName.Text = this._currentTemplate.AgentLastName;
@ -392,11 +367,6 @@ namespace ENI2.DetailViewControls
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentStreetAndNumber.Text = this._currentTemplate.AgentStreetAndNumber;
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
if ((this._currentTemplate.WasteDisposalServiceProviderName ?? "").Trim() != (this.textBox_WasteDisposalServiceProvider.Text ?? "").Trim())
{
this.textBox_WasteDisposalServiceProvider.Text = this._currentTemplate.WasteDisposalServiceProviderName;
this.textBox_WasteDisposalServiceProvider.GetBindingExpression(TextBox.TextProperty).UpdateSource();
}
this.buttonUndoTemplate.IsEnabled = true;
this.buttonSetTemplate.IsEnabled = false;
@ -422,7 +392,6 @@ namespace ENI2.DetailViewControls
at.AgentPhone = this.textBox_AgentPhone.Text;
at.AgentPostalCode = this.textBox_AgentPostalCode.Text;
at.AgentStreetAndNumber = textBox_AgentStreetAndNumber.Text;
at.WasteDisposalServiceProviderName = textBox_WasteDisposalServiceProvider.Text;
return at;
}

View File

@ -24,7 +24,7 @@
</col:ArrayList>
</UserControl.Resources>
<GroupBox Name="portNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}">
<ScrollViewer>
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />

View File

@ -12,7 +12,7 @@
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.textShipData}" >
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="260" />
@ -104,6 +104,6 @@
</Grid>
</GroupBox>
</Grid>
</ScrollViewer>
</GroupBox>
</src:DetailBaseControl>

View File

@ -35,6 +35,7 @@
<RowDefinition Height="28" />
<RowDefinition Height="*" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_AccurateDetailsGiven" Margin="0,0,10,0"/>
<!--TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_ETAToPortOfCall" Margin="0,0,10,0" TextWrapping="Wrap" FontSize="10"/-->
@ -55,9 +56,38 @@
<enictrl:LocodeControl Grid.Row="2" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlNextWastePort" LocodeValue="{Binding NextWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" Margin="2" />
<Button Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
<Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
<Label Grid.Row="6" Grid.Column="0" HorizontalContentAlignment="Right" Content="{x:Static p:Resources.textAgentTemplate}" Margin="0,0,10,0" />
<ComboBox Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" Name="comboBox_WSDPTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="Remark" SelectionChanged="comboBox_WSDPTemplate_SelectionChanged" />
<Grid Grid.Row="6" Grid.Column="3" Grid.ColumnSpan="1" Name="gridTemplateControls" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<!-- Name -->
<ColumnDefinition Width="26"/>
<!-- Save button -->
<ColumnDefinition Width="26"/>
<!-- Delete button -->
<ColumnDefinition Width="52"/>
<!-- Undo button -->
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="2" Name="textBoxTemplateTitle" VerticalContentAlignment="Center"/>
<Button Name="buttonSaveTemplate" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSaveTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/floppy_disk_blue.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonDeleteTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonDeleteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonUndoTemplate" Grid.Column="3" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
</Grid>
<Button Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
<Button Grid.Row="7" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
</Grid>
<enictrl:ENIDataGrid x:Name="dataGridWaste" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1" CanUserAddRows="False">

View File

@ -13,6 +13,8 @@ using ExcelDataReader;
using System.IO;
using System;
using Microsoft.Win32;
using System.Diagnostics;
using System.Threading.Tasks;
namespace ENI2.DetailViewControls
{
@ -22,14 +24,14 @@ namespace ENI2.DetailViewControls
public partial class WasteDetailControl : DetailBaseControl
{
#region Fields
private Message _wasMessage;
private WAS _was;
private Message _wasRcptMessage;
private WAS_RCPT _selectedWAS_RCPT;
#endregion
private static List<WasteDisposalServiceProvider_Template> _wsdpTemplates = null;
private WasteDisposalServiceProvider_Template _currentTemplate;
private string _undoTemplate;
public WasteDetailControl()
{
@ -94,7 +96,7 @@ namespace ENI2.DetailViewControls
}
}
public override void Initialize()
public async override void Initialize()
{
base.Initialize();
@ -175,6 +177,14 @@ namespace ENI2.DetailViewControls
#endregion
#region init WSDP provider
await InitTemplates();
this.comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;
#endregion
}
public override int SelectedTabIndex
@ -185,7 +195,7 @@ namespace ENI2.DetailViewControls
#region Waste receipt grid event handler
private void DataGridWasteReceipt_CreateRequested()
private async void DataGridWasteReceipt_CreateRequested()
{
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
epd.WAS_RCPT = new WAS_RCPT();
@ -217,7 +227,7 @@ namespace ENI2.DetailViewControls
dataGridWasteReceipt_SelectionChanged(this, null);
}
await InitTemplates(); // templates might have changed in the dialog
}
private void DataGridWasteReceipt_DeleteRequested(DatabaseEntity obj)
@ -236,7 +246,7 @@ namespace ENI2.DetailViewControls
}
}
private void DataGridWasteReceipt_EditRequested(DatabaseEntity obj)
private async void DataGridWasteReceipt_EditRequested(DatabaseEntity obj)
{
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
epd.WAS_RCPT = obj as WAS_RCPT;
@ -263,7 +273,7 @@ namespace ENI2.DetailViewControls
this.dataGridWasteReceipt.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
dataGridWasteReceipt_SelectionChanged(this, null);
await InitTemplates(); // templates might have changed in the dialog
}
private void DataGridWasteReceipt_AddingNewItem(object sender, AddingNewItemEventArgs e)
@ -581,6 +591,101 @@ namespace ENI2.DetailViewControls
}
#endregion
#region Waste disposal Service Provider templates event handler
private async Task InitTemplates()
{
_wsdpTemplates = await DBManagerAsync.GetWastDisposalServiceProviderTemplatesAsync();
_wsdpTemplates.Sort();
this.comboBox_WSDPTemplate.ItemsSource = null;
this.comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;
Trace.WriteLine($"{_wsdpTemplates.Count} WSDP templates loaded");
}
private void comboBox_WSDPTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Trace.WriteLine("WSDP combo selection changed");
if(this.comboBox_WSDPTemplate.SelectedItem is WasteDisposalServiceProvider_Template wdsp_t)
{
this.textBoxTemplateTitle.Text = wdsp_t.Remark;
this.buttonDeleteTemplate.IsEnabled = true;
this._currentTemplate = wdsp_t;
this._undoTemplate = this.textBoxWasteDisposalServiceProviders.Text.Trim();
this.buttonUndoTemplate.IsEnabled = this._undoTemplate.Length > 0;
this.textBoxWasteDisposalServiceProviders.Text = wdsp_t.WasteDisposalServiceProviderName;
}
}
private async void buttonSaveTemplate_Click(object sender, RoutedEventArgs e)
{
string currentWSDPProviderName = this.textBoxWasteDisposalServiceProviders.Text.Trim();
string currentRemark = this.textBoxTemplateTitle.Text.Trim();
if ((currentWSDPProviderName.Length == 0) || (currentRemark.Length == 0)) return;
WasteDisposalServiceProvider_Template existingTemplate = null;
foreach(WasteDisposalServiceProvider_Template wdsp_template in _wsdpTemplates)
{
// bei gefundenem Match wird ggf. der Remark überschrieben
if (wdsp_template.Remark.Equals(currentRemark))
{
existingTemplate = wdsp_template;
break;
}
}
if(existingTemplate != null)
{
if (MessageBox.Show("A template with this name already exists, overwrite?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
return;
existingTemplate.WasteDisposalServiceProviderName = currentWSDPProviderName;
await DBManagerAsync.SaveAsync(existingTemplate);
return;
}
WasteDisposalServiceProvider_Template newTemplate = new WasteDisposalServiceProvider_Template();
newTemplate.WasteDisposalServiceProviderName = currentWSDPProviderName;
newTemplate.Remark = currentRemark;
await DBManagerAsync.SaveAsync(newTemplate);
comboBox_WSDPTemplate.ItemsSource = null;
_wsdpTemplates.Add(newTemplate);
_wsdpTemplates.Sort();
comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;
MessageBox.Show("Template saved", "OK", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void buttonDeleteTemplate_Click(object sender, RoutedEventArgs e)
{
if(_currentTemplate != null)
{
if (MessageBox.Show("Delete this template?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
this.comboBox_WSDPTemplate.SelectedItem = null;
this.comboBox_WSDPTemplate.ItemsSource = null;
DBManager.Instance.Delete(_currentTemplate);
_wsdpTemplates.Remove(_currentTemplate);
this.textBoxTemplateTitle.Text = null;
this.buttonDeleteTemplate.IsEnabled = false;
this.comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;
}
}
}
private void buttonUndoTemplate_Click(object sender, RoutedEventArgs e)
{
if(this._undoTemplate != null)
{
this.textBoxWasteDisposalServiceProviders.Text = this._undoTemplate;
this.buttonUndoTemplate.IsEnabled = false;
this._undoTemplate = null;
this.comboBox_WSDPTemplate.SelectedItem = null;
}
}
#endregion
#region Copy WAS to WAS_RCPT handler

View File

@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ENI2</RootNamespace>
<AssemblyName>ENI2Test</AssemblyName>
<AssemblyName>ENI2</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@ -18,7 +18,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<PublishUrl>eni_test\</PublishUrl>
<PublishUrl>ENI2.publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
@ -28,16 +28,16 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>http://192.168.2.24/eni_test/</InstallUrl>
<InstallUrl>http://192.168.2.24/eni2.publish/</InstallUrl>
<SupportUrl>http://www.textbausteine.net/</SupportUrl>
<ProductName>ENI Testversion</ProductName>
<ProductName>ENI</ProductName>
<PublisherName>Informatikbüro Daniel Schick</PublisherName>
<SuiteName>NSW</SuiteName>
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>7</ApplicationRevision>
<ApplicationVersion>7.2.12.7</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.2.9.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -134,75 +134,75 @@
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="ExcelDataReader, Version=3.8.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.8.0\lib\net462\ExcelDataReader.dll</HintPath>
<Reference Include="ExcelDataReader, Version=3.7.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.7.0\lib\net462\ExcelDataReader.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.9\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.6\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.Cryptography.9.0.9\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
<Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.Cryptography.9.0.6\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.9.0.9\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.9.0.6\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.9\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.6\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.9.0.9\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
<Reference Include="Microsoft.Extensions.Logging, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.9.0.6\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.9.0.9\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.9.0.6\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Options.9.0.9\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
<Reference Include="Microsoft.Extensions.Options, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Options.9.0.6\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.9, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Primitives.9.0.9\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
<Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Primitives.9.0.6\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="MigraDoc.DocumentObjectModel, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.2\lib\netstandard2.0\MigraDoc.DocumentObjectModel.dll</HintPath>
<Reference Include="MigraDoc.DocumentObjectModel, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.DocumentObjectModel.dll</HintPath>
</Reference>
<Reference Include="MigraDoc.Rendering, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.2\lib\netstandard2.0\MigraDoc.Rendering.dll</HintPath>
<Reference Include="MigraDoc.Rendering, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.Rendering.dll</HintPath>
</Reference>
<Reference Include="MigraDoc.RtfRendering, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.2\lib\netstandard2.0\MigraDoc.RtfRendering.dll</HintPath>
<Reference Include="MigraDoc.RtfRendering, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.RtfRendering.dll</HintPath>
</Reference>
<Reference Include="PdfSharp, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.dll</HintPath>
<Reference Include="PdfSharp, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.BarCodes, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.BarCodes.dll</HintPath>
<Reference Include="PdfSharp.BarCodes, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.BarCodes.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Charting, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.Charting.dll</HintPath>
<Reference Include="PdfSharp.Charting, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Charting.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Cryptography, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.Cryptography.dll</HintPath>
<Reference Include="PdfSharp.Cryptography, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Cryptography.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Quality, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.Quality.dll</HintPath>
<Reference Include="PdfSharp.Quality, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Quality.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Shared, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.Shared.dll</HintPath>
<Reference Include="PdfSharp.Shared, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Shared.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Snippets, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.Snippets.dll</HintPath>
<Reference Include="PdfSharp.Snippets, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Snippets.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.System, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.System.dll</HintPath>
<Reference Include="PdfSharp.System, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.System.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.WPFonts, Version=6.2.2.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.2\lib\netstandard2.0\PdfSharp.WPFonts.dll</HintPath>
<Reference Include="PdfSharp.WPFonts, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.WPFonts.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@ -214,12 +214,12 @@
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.9\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.6\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Formats.Asn1, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Formats.Asn1.9.0.9\lib\net462\System.Formats.Asn1.dll</HintPath>
<Reference Include="System.Formats.Asn1, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Formats.Asn1.9.0.6\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@ -234,8 +234,8 @@
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.9, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Security.Cryptography.Pkcs.9.0.9\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.6, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Security.Cryptography.Pkcs.9.0.6\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
@ -257,20 +257,20 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.7.25104.5739\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.7.25104.5739\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.7.25104.5739\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.7.25104.5739\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.4.7.25104.5739\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -297,9 +297,6 @@
<Compile Include="Controls\ConditionGroupControl.xaml.cs">
<DependentUpon>ConditionGroupControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\EasyPeasyControl.xaml.cs">
<DependentUpon>EasyPeasyControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\EditWindowBase.cs" />
<Compile Include="Controls\ENIDataGrid.cs" />
<Compile Include="Controls\IHighlightControlContainer.cs" />
@ -561,7 +558,6 @@
<Compile Include="Util\ByteConverter.cs" />
<Compile Include="Util\CutoffConverter.cs" />
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
<Compile Include="Util\EasyPeasyState.cs" />
<Compile Include="Util\EnumHelper.cs" />
<Compile Include="Util\EnumToBooleanConverter.cs" />
<Compile Include="Util\EnumToCollectionConverter.cs" />
@ -591,10 +587,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\EasyPeasyControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\LocodeControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textCompareExcel}" Height="260" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_grey.ico">
Title="{x:Static p:Resources.textCompareExcel}" Height="260" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32" />

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textCopyDeclaration}" Height="326" Width="440" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_cards.ico">
Title="{x:Static p:Resources.textCopyDeclaration}" Height="326" Width="440" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_cards.ico">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="28" />
@ -78,4 +78,3 @@
</StackPanel>
</Grid>
</enictrl:EditWindowBase>

View File

@ -8,7 +8,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textCoreStatus}" Height="436" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_grey.ico" >
Title="{x:Static p:Resources.textCoreStatus}" Height="436" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*"/>

View File

@ -9,7 +9,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textEditRules}" Height="402" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2Test;component/Resources/mail_forward.png">
Title="{x:Static p:Resources.textEditRules}" Height="402" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2;component/Resources/mail_forward.png">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32" />

View File

@ -45,7 +45,7 @@ namespace ENI2.EditControls
OKClicked += EditWasteReceiptDialog_OKClicked;
this.AddVisible = true;
_wsdpTemplates = await DBManagerAsync.GetWasteDisposalServiceProviderTemplatesAsync();
_wsdpTemplates = await DBManagerAsync.GetWastDisposalServiceProviderTemplatesAsync();
_wsdpTemplates.Sort();
Trace.WriteLine($"{_wsdpTemplates.Count} WSDP templates loaded");

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_red.ico" Topmost="False">
Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_red.ico" Topmost="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />

View File

@ -7,7 +7,7 @@
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textMessageHistory}" Height="450" Width="800" Background="AliceBlue" Icon="/ENI2Test;component/Resources/clock_history.ico">
Title="{x:Static p:Resources.textMessageHistory}" Height="450" Width="800" Background="AliceBlue" Icon="/ENI2;component/Resources/clock_history.ico">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />

View File

@ -9,7 +9,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textNewDGItem}" Height="350" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize"
Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Loaded="EditWindowBase_Loaded">
Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="EditWindowBase_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textNewWithId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_card_add.ico">
Title="{x:Static p:Resources.textNewWithId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_card_add.ico">
<Grid Margin="4">
<Grid.RowDefinitions>

View File

@ -8,7 +8,7 @@
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="660" Width="250" Background="AliceBlue">
Title="{x:Static p:Resources.textSelectImportClasses}" Height="600" Width="250" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />

View File

@ -1,13 +1,14 @@
// Copyright (c) 2017-today schick Informatik
// Description: Select classes for import via Excel or for sending them once completed
// Description: Select classes for import
// Returns: Array of selected classes as property
using bsmd.database;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using bsmd.database;
namespace ENI2.EditControls
{
/// <summary>
@ -16,8 +17,7 @@ namespace ENI2.EditControls
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
{
private readonly List<SelectClass> _selectClasses = new List<SelectClass>();
private readonly List<Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
private readonly List<Message.NotificationClass> _preselectedClasses = new List<Message.NotificationClass>();
private readonly List<bsmd.database.Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
public SelectImportClassesDialog()
{
@ -25,61 +25,33 @@ namespace ENI2.EditControls
this.Loaded += SelectImportClassesDialog_Loaded;
}
/// <summary>
/// List of all message classes that are available for selection
/// </summary>
public List<Message.NotificationClass> SelectedClasses
{
get { return _selectedClasses; }
}
/// <summary>
/// Classes that should be checked already when the dialog is opened (relevant for send mode)
/// </summary>
public List<Message.NotificationClass > PreselectedClasses
{
get { return _preselectedClasses; }
}
/// <summary>
/// These messages are needed to derive message classes from, already sorted in the right manner
/// </summary>
public List<Message> Messages { get; set; }
/// <summary>
/// Flag to reduce selection amount in case of transit
/// </summary>
public bool IsTransit { get; set; }
/// <summary>
/// Flag if dialog is used in import mode (default true). Set false for send all mode.
/// </summary>
public bool IsImportMode { get; set; } = true;
private void SelectImportClassesDialog_Loaded(object sender, RoutedEventArgs e)
{
foreach (Message aMessage in this.Messages)
foreach(Message aMessage in this.Messages)
{
// these are of no interest
if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.STO))
continue;
// these are neither imported nor sent by the Send all function
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD))
continue;
// filter out messages not relevant for transit
if (IsTransit && (
(aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.STO)
) continue;
if (IsTransit &&
((aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
@ -93,13 +65,12 @@ namespace ENI2.EditControls
)) continue;
SelectClass sc = new SelectClass();
sc.Name = Enum.GetName(typeof(Message.NotificationClass), aMessage.MessageNotificationClass);
sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), aMessage.MessageNotificationClass);
sc.Class = aMessage.MessageNotificationClass;
sc.IsSelected = this._preselectedClasses.Contains(sc.Class);
sc.IsSelected = false;
_selectClasses.Add(sc);
}
this.checkListBoxClasses.ItemsSource = _selectClasses;
this.OKClicked += SelectImportClassesDialog_OKClicked;
}

View File

@ -8,7 +8,7 @@
xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="Search port area" Height="400" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Loaded="Window_Loaded">
Title="Search port area" Height="400" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="Window_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Topmost="False">
Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Topmost="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textNewVisitTransitId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_card_new.ico">
Title="{x:Static p:Resources.textNewVisitTransitId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_card_new.ico">
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition Height="28" />

View File

@ -128,7 +128,7 @@ namespace ENI2.Excel
if (portName.IsNullOrEmpty())
{
_log.WarnFormat("unknown Locode {0}", val);
val = null;
val = "";
}
}
return val;

View File

@ -15,7 +15,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ENI2.Excel
@ -1008,8 +1007,6 @@ namespace ENI2.Excel
STAT stat = statMessage.Elements[0] as STAT;
ScanMessage(stat, reader);
if (!messageCore.IsTransit) // let's not do this for transit messages
{
foreach (Message preMessage in messages)
{
if (preMessage.MessageNotificationClass == Message.NotificationClass.PRE72H)
@ -1022,7 +1019,6 @@ namespace ENI2.Excel
}
}
}
}
if (!stat.Flag.IsNullOrEmpty()) stat.Flag = stat.Flag.ToUpper();
if (!stat.PortOfRegistry.IsNullOrEmpty()) stat.PortOfRegistry = stat.PortOfRegistry.ToUpper();
@ -1244,7 +1240,6 @@ namespace ENI2.Excel
if ((reader.Mode == ExcelReader.CountryMode.DE) && waste.IsDashWasteCode)
{
waste.WasteDescription = "-";
// NOP
}
else if (reader.Mode == ExcelReader.CountryMode.DK)
{
@ -1284,19 +1279,18 @@ namespace ENI2.Excel
if (waste.WasteType == 2309) waste.WasteType = 507;
if (waste.WasteType == 3000) waste.WasteType = 401;
waste.WasteDisposalAmount_MTQ = reader.ReadNumber(wasteAmount);
if (!waste.WasteDisposalAmount_MTQ.HasValue && reader.ReadText(wasteAmount).IsNullOrEmpty()) waste.WasteDisposalAmount_MTQ = 0;
waste.WasteCapacity_MTQ = reader.ReadNumber(wasteCapacity);
if (!waste.WasteCapacity_MTQ.HasValue && reader.ReadText(wasteCapacity).IsNullOrEmpty()) waste.WasteCapacity_MTQ = 0;
waste.WasteAmountRetained_MTQ = reader.ReadNumber(wasteRetained);
if (!waste.WasteAmountRetained_MTQ.HasValue && reader.ReadText(wasteRetained).IsNullOrEmpty()) waste.WasteAmountRetained_MTQ = 0;
waste.WasteDisposalAmount_MTQ = reader.ReadNumberDefaultZero(wasteAmount);
waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity);
waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained);
waste.WasteDisposalPort = reader.ReadSSNLocode(wastePort); // aka RemainingWasteDisposalPort
if ((waste.WasteDisposalPort == null) && reader.ReadText(wastePort).IsNullOrEmpty()) waste.WasteDisposalPort = "ZZUKN";
if (waste.WasteDisposalPort.IsNullOrEmpty())
{
waste.WasteDisposalPort = "ZZUKN";
}
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumber(amountGen);
if (!waste.WasteAmountGeneratedTillNextPort_MTQ.HasValue && reader.ReadText(amountGen).IsNullOrEmpty()) waste.WasteAmountGeneratedTillNextPort_MTQ = 0;
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen);
if (!waste.WasteType.HasValue || (waste.WasteType > 999))
{
@ -1304,8 +1298,7 @@ namespace ENI2.Excel
}
}
was.AddMissingWaste(false);
was.AddMissingWaste();
return true;
}
@ -1375,7 +1368,7 @@ namespace ENI2.Excel
wr.WasteCode.Equals("204") || wr.WasteCode.Equals("510") || wr.WasteCode.Equals("511"))
wr.WasteDescription = "-";
}
wr.AmountWasteReceived_MTQ = reader.ReadNumber(wAmount); // ?? (double?)0; // Default ist 0, nicht nix ;-) // Update: wir wollen doch einen Fehler
wr.AmountWasteReceived_MTQ = reader.ReadNumber(wAmount) ?? (double?)0; // Default ist 0, nicht nix ;-)
}
// only add message when an identification number was given
@ -1425,10 +1418,10 @@ namespace ENI2.Excel
int i = 1;
foreach (LastTenPortFacilitiesCalled ltpfc in sec.LastTenPortFacilitesCalled)
{
if (!(mdh.GetSublistElementWithIdentifier((i).ToString()) is PortOfCallLast30Days poc30d))
if (!(mdh.GetSublistElementWithIdentifier((i + 1).ToString()) is PortOfCallLast30Days poc30d))
{
poc30d = new PortOfCallLast30Days();
poc30d.Identifier = (i).ToString();
poc30d.Identifier = (i + 1).ToString();
poc30d.MDH = mdh;
mdh.PortOfCallLast30Days.Add(poc30d);
}
@ -1442,15 +1435,15 @@ namespace ENI2.Excel
}
else // "normal mode", aus den Zellen lesen
{
string sheetTitle = "1. VOYAGE";
// 4.8.25: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names)
if (reader.HasWorksheetNamed(sheetTitle))
{
// POC last 30 days
for (int i = 0; i < mdh.NumberOfExcelRows; i++)
{
string portName = string.Format("MDH.PortOfCallLast30DaysPort_{0}", i + 1);
string portCountry = string.Format("MDH.PortOfCallLast30DaysCountry_{0}", i + 1);
string locode = string.Format("MDH.PortOfCallLast30DaysLocode_{0}", i + 1);
string crewJoined = string.Format("MDH.PortOfCallLast30DaysCrewMembersJoined_{0}", i + 1);
string crewName = string.Format("MDH.PortOfCallLast30DaysCrewJoinedShipName_{0}", i + 1);
string depDate = string.Format("MDH.PortOfCallLast30DaysDateOfDeparture_{0}", i + 1);
if (!(mdh.GetSublistElementWithIdentifier((i + 1).ToString()) is PortOfCallLast30Days poc30d))
{
@ -1460,18 +1453,17 @@ namespace ENI2.Excel
mdh.PortOfCallLast30Days.Add(poc30d);
}
string pName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", 82 + i));
string pCountry = reader.ReadCellAsText(sheetTitle, string.Format("E{0}", 82 + i));
string pName = reader.ReadText(portName);
string pCountry = reader.ReadText(portCountry);
poc30d.PortOfCallLast30DaysDateOfDeparture = reader.ReadCellAsDateTime(sheetTitle, string.Format("G{0}", 82 + i));
poc30d.PortOfCallLast30DaysLocode = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", 82 + i));
if (LocodeDB.PortNameFromLocode(poc30d.PortOfCallLast30DaysLocode).IsNullOrEmpty()) poc30d.PortOfCallLast30DaysLocode = "";
poc30d.PortOfCallLast30DaysDateOfDeparture = reader.ReadDate(depDate);
poc30d.PortOfCallLast30DaysLocode = reader.ReadLoCode(locode);
// Verbesserungsvorschlag Jul/21: CrewMembersJoined Häkchen abhängig von den Namen in der Spalte
bool? PortOfCallLast30DaysCrewMembersJoinedFlag = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", 82 + i));
bool? PortOfCallLast30DaysCrewMembersJoinedFlag = reader.ReadBoolean(crewJoined);
string crewNameString = reader.ReadCellAsText(sheetTitle, string.Format("I{0}", 82 + i));
poc30d.PortOfCallLast30DaysCrewMembersJoined = !crewNameString.IsNullOrEmpty() && (crewNameString.Length > 1);
string crewNameString = reader.ReadText(crewName);
poc30d.PortOfCallLast30DaysCrewMembersJoined = !crewNameString.IsNullOrEmpty();
// if crew members joined is set explicitly to true and the name is empty, still set the field to true
if (!(poc30d.PortOfCallLast30DaysCrewMembersJoined ?? false) && (PortOfCallLast30DaysCrewMembersJoinedFlag ?? false))
@ -1499,11 +1491,10 @@ namespace ENI2.Excel
}
// Leer/def. Zeilen entfernen
if (!poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && (poc30d.PortOfCallLast30DaysLocode.IsNullOrEmpty()))
if (!poc30d.PortOfCallLast30DaysDateOfDeparture.HasValue && (poc30d.PortOfCallLast30DaysLocode == null))
mdh.PortOfCallLast30Days.Remove(poc30d);
}
}
}
#endregion PoC last 30 days
@ -1614,9 +1605,6 @@ namespace ENI2.Excel
}
SEC sec = secMessage.Elements[0] as SEC;
((ISublistContainer)sec).DeleteElements();
ScanMessage(sec, reader);
reader.ReadBoolean("SEC.AreMatterToReport"); // das berücksichtigen wir derzeit nicht in der DB (implizit)
@ -1667,32 +1655,33 @@ namespace ENI2.Excel
if (!sec.KielCanalPassagePlannedIncomming.HasValue && !sec.KielCanalPassagePlannedOutgoing.HasValue)
sec.KielCanalPassagePlanned = false;
string sheetTitle = "1. VOYAGE";
// 4.8.25: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names)
if (reader.HasWorksheetNamed(sheetTitle))
{
// Last10PortFacilitesCalled
for (int i = 0; i < 10; i++)
for (int i = 1; i <= 10; i++)
{
string portName = string.Format("SEC.PortFacilityPortName_{0}", i);
string portCountry = string.Format("SEC.PortFacilityPortCountry_{0}", i);
string portLocode = string.Format("SEC.PortFacilityPortLoCode_{0}", i);
string portDateOfArrival = string.Format("SEC.PortFacilityDateOfArrival_{0}", i);
string portDateOfDeparture = string.Format("SEC.PortFacilityDateOfDeparture_{0}", i);
string portShipSecLevel = string.Format("SEC.PortFacilityShipSecurityLevel_{0}", i);
string portGISISCode = string.Format("SEC.PortFacilityGISISCode_{0}", i);
string portSecMatters = string.Format("SEC.PortFacilitySecurityMattersToReport_{0}", i);
if (!(sec.GetPortFacilityWithIdentifier((i + 1).ToString()) is LastTenPortFacilitiesCalled l10fc))
if (!(sec.GetPortFacilityWithIdentifier(i.ToString()) is LastTenPortFacilitiesCalled l10fc))
{
l10fc = new LastTenPortFacilitiesCalled();
l10fc.Identifier = (i + 1).ToString();
l10fc.Identifier = i.ToString();
l10fc.SEC = sec;
sec.LastTenPortFacilitesCalled.Add(l10fc);
}
l10fc.PortFacilityPortName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", 54 + i), 99);
l10fc.PortFacilityPortCountry = reader.ReadCellAsText(sheetTitle, string.Format("E{0}", 54 + i), 99);
l10fc.PortFacilityPortLoCode = reader.ReadCellAsText(sheetTitle, string.Format("F{0}", 54 + i), 5);
if (LocodeDB.PortNameFromLocode(l10fc.PortFacilityPortLoCode).IsNullOrEmpty()) l10fc.PortFacilityPortLoCode = "";
l10fc.PortFacilityDateOfArrival = reader.ReadCellAsDateTime(sheetTitle, string.Format("G{0}", 54 + i));
l10fc.PortFacilityDateOfDeparture = reader.ReadCellAsDateTime(sheetTitle, string.Format("H{0}", 54 + i));
l10fc.PortFacilityPortName = reader.ReadText(portName);
l10fc.PortFacilityPortCountry = reader.ReadText(portCountry);
l10fc.PortFacilityPortLoCode = reader.ReadLoCode(portLocode);
l10fc.PortFacilityDateOfArrival = reader.ReadDate(portDateOfArrival);
l10fc.PortFacilityDateOfDeparture = reader.ReadDate(portDateOfDeparture);
string sLevel = reader.ReadCellAsText(sheetTitle, string.Format("I{0}", 54 + i));
string sLevel = reader.ReadText(portShipSecLevel);
if (!sLevel.IsNullOrEmpty())
{
if (sLevel.Contains('1')) l10fc.PortFacilityShipSecurityLevel = 1;
@ -1700,11 +1689,16 @@ namespace ENI2.Excel
if (sLevel.Contains('3')) l10fc.PortFacilityShipSecurityLevel = 3;
}
string s = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", 54 + i));
// All invalid codes become "0000", Oct/25
l10fc.PortFacilityGISISCode = (s != null) && Regex.IsMatch(s.Trim(), @"^\d{4}$") ? s.Trim() : "0000";
l10fc.PortFacilityGISISCode = reader.ReadTextNoWhitespace(portGISISCode);
l10fc.PortFacilitySecurityMattersToReport = reader.ReadCellAsText(sheetTitle, string.Format("K{0}", 54 + i), 255);
if (l10fc.PortFacilityGISISCode.IsNullOrEmpty() || l10fc.PortFacilityGISISCode == "0")
l10fc.PortFacilityGISISCode = "0000";
if (l10fc.PortFacilityGISISCode?.Length < 4)
{
while (l10fc.PortFacilityGISISCode.Length < 4) l10fc.PortFacilityGISISCode = "0" + l10fc.PortFacilityGISISCode;
}
l10fc.PortFacilitySecurityMattersToReport = reader.ReadText(portSecMatters);
// keinen "leeren" Hafen anlegen, wenn der Eintrag leer war (trifft anscheinend bei Neubauten zu, siehe E-Mail Christin vom 20./22.6.17
if (l10fc.PortFacilityPortName.IsNullOrEmpty() && l10fc.PortFacilityPortLoCode.IsNullOrEmpty() && l10fc.PortFacilityPortCountry.IsNullOrEmpty())
@ -1712,39 +1706,46 @@ namespace ENI2.Excel
}
// Ship2ShipActivities
for (int i = 0; i < 10; i++)
for (int i = 1; i <= 10; i++)
{
string s2sName = string.Format("SEC.ShipToShipActivityLocationName_{0}", i);
string s2sLocode = string.Format("SEC.ShipToShipActivityLocationLoCode_{0}", i);
string s2sLatitude = string.Format("SEC.ShipToShipActivityLocationCoordinatesLatitude_{0}", i);
string s2sLongitude = string.Format("SEC.ShipToShipActivityLocationCoordinatesLongitude_{0}", i);
string s2sFromDate = string.Format("SEC.ShipToShipActivityDateFrom_{0}", i);
string s2sToDate = string.Format("SEC.ShipToShipActivityDateTo_{0}", i);
string s2sSec = string.Format("SEC.ShipToShipActivitySecurityMattersToReport_{0}", i);
string s2sActivityString = string.Format("SEC.ShipToShipActivityType_{0}", i);
if (!(sec.GetShipToShipWithIdentifier((i + 1).ToString()) is ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2sActivity))
if (!(sec.GetShipToShipWithIdentifier(i.ToString()) is ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2sActivity))
{
s2sActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
s2sActivity.Identifier = (i + 1).ToString();
s2sActivity.Identifier = i.ToString();
s2sActivity.SEC = sec;
sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(s2sActivity);
}
s2sActivity.ShipToShipActivityLocationName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", 68 + i), 255);
s2sActivity.ShipToShipActivityLocationName = reader.ReadText(s2sName);
if (s2sActivity.ShipToShipActivityLocationName.IsNullOrEmpty())
{
sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Remove(s2sActivity);
continue;
}
s2sActivity.ShipToShipActivityLocationLoCode = reader.ReadCellAsText(sheetTitle, string.Format("E{0}", 68 + i), 5);
if (LocodeDB.PortNameFromLocode(s2sActivity.ShipToShipActivityLocationLoCode).IsNullOrEmpty()) s2sActivity.ShipToShipActivityLocationLoCode = "";
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = (int?) reader.ReadCellAsDecimal(sheetTitle, string.Format("F{0}", 68 + i));
s2sActivity.ShipToShipActivityLocationLoCode = reader.ReadLoCode(s2sLocode);
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = (int?)reader.ReadNumber(s2sLatitude);
// keine "0" (d.h. fehlerhafte Koordinaten) ins ANSW übergeben falls im Sheet nichts ist aber der Reader das aus irgendeinem Grund liest
if (s2sActivity.ShipToShipActivityLocationCoordinatesLatitude == 0)
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = null;
s2sActivity.ShipToShipActivityLocationCoordinatesLongitude = (int?)reader.ReadCellAsDecimal(sheetTitle, string.Format("G{0}", 68 + i));
s2sActivity.ShipToShipActivityLocationCoordinatesLongitude = (int?)reader.ReadNumber(s2sLongitude);
if (s2sActivity.ShipToShipActivityLocationCoordinatesLongitude == 0)
s2sActivity.ShipToShipActivityLocationCoordinatesLongitude = null;
s2sActivity.ShipToShipActivityDateFrom = reader.ReadCellAsDateTime(sheetTitle, string.Format("H{0}", 68 + i));
s2sActivity.ShipToShipActivityDateTo = reader.ReadCellAsDateTime(sheetTitle, string.Format("I{0}", 68 + i));
s2sActivity.ShipToShipActivityTypeCode = (int?)reader.ReadCellAsDecimal(sheetTitle, string.Format("J{0}", 68 + i));
s2sActivity.ShipToShipActivitySecurityMattersToReport = reader.ReadCellAsText(sheetTitle, string.Format("K{0}", 68 + i), 255);
}
s2sActivity.ShipToShipActivityDateFrom = reader.ReadDate(s2sFromDate);
s2sActivity.ShipToShipActivityDateTo = reader.ReadDate(s2sToDate);
s2sActivity.ShipToShipActivityTypeCode = (int?)reader.ReadNumber(s2sActivityString);
reader.ReadShip2ShipActivityType(s2sActivityString); // 24.8.21 nicht Code dem Klartext zuordnen, nur das Feld kolorieren
s2sActivity.ShipToShipActivitySecurityMattersToReport = reader.ReadText(s2sSec);
}
return true;

View File

@ -10,7 +10,7 @@
xmlns:util="clr-namespace:ENI2.Util"
xmlns:local="clr-namespace:ENI2"
mc:Ignorable="d"
Title="ENI 2 Testversion"
Title="ENI 2"
Height="{util:SettingBinding Height}" Width="{util:SettingBinding Width}"
Icon="Resources/logo_schwarz.ico" Loaded="Window_Loaded" Closing="Window_Closing"
SourceInitialized="Window_SourceInitialized">
@ -95,7 +95,6 @@
<MenuItem x:Name="menuItemUserAdministration" Header="{x:Static p:Resources.textUserAdministration}" Click="radioButton_Click" Visibility="Hidden"/>
<MenuItem x:Name="menuItemMaersk" Header="{x:Static p:Resources.textPOLists}" Click="radioButton_Click" Visibility="Hidden" />
<MenuItem x:Name="menuItemValueMappings" Header="{x:Static p:Resources.textExcelValueMappings}" Click="radioButton_Click" Visibility="Hidden" />
<MenuItem x:Name="menuItemEasyPeasy" Header="{x:Static p:Resources.textEasyPeasy}" Click="radioButton_Click" Visibility="Hidden" />
<MenuItem x:Name="labelStatusId" />
<MenuItem Header="Help" HorizontalAlignment="Right">
<MenuItem Header="Change Password" Click="buttonChangePassword_Click">

View File

@ -39,7 +39,6 @@ namespace ENI2
private ServerStatusControl statusControl;
private readonly SucheControl sucheControl;
private CompareExcelDialog compareExcelDialog;
private EasyPeasyControl easyPeasyControl;
private bool dbConnected;
private readonly ScaleTransform _transform = new ScaleTransform(1.0, 1.0);
@ -325,14 +324,6 @@ namespace ENI2
}
this.rootContainer.Children.Add(this.vmControl);
}
else if(sender == this.menuItemEasyPeasy)
{
if(this.easyPeasyControl == null)
{
this.easyPeasyControl = new EasyPeasyControl();
}
this.rootContainer.Children.Add(this.easyPeasyControl);
}
}
private void buttonCompareSheets_Click(object sender, RoutedEventArgs ev)
@ -386,8 +377,6 @@ namespace ENI2
Properties.Settings.Default.MainWindowPlacement = this.GetPlacement();
Properties.Settings.Default.Save();
Microsoft.Win32.SystemEvents.SessionEnded -= SystemEvents_SessionEnded;
if (easyPeasyControl != null)
easyPeasyControl.SaveState();
}
private void Window_SourceInitialized(object sender, EventArgs e)
@ -701,7 +690,6 @@ namespace ENI2
ReportingParty.CurrentReportingParty = this.userEntity;
this.menuItemMaersk.Visibility = Visibility.Visible;
this.menuItemValueMappings.Visibility = Visibility.Visible;
this.menuItemEasyPeasy.Visibility = Visibility.Visible;
if (this.userEntity.IsAdmin)
{
this.menuItemUserAdministration.Visibility = Visibility.Visible;
@ -765,6 +753,5 @@ namespace ENI2
#endregion
}
}

View File

@ -2173,20 +2173,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to The existing value for the waste disposal service provider will be overwritten.
///
///Current entry: {0}
///New entry: {1}
///
///Proceed?.
/// </summary>
public static string textConfirmWSDPOverwrite {
get {
return ResourceManager.GetString("textConfirmWSDPOverwrite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Construction characteristics.
/// </summary>
@ -2871,15 +2857,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Easy Peasy 🍋.
/// </summary>
public static string textEasyPeasy {
get {
return ResourceManager.GetString("textEasyPeasy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Edit.
/// </summary>
@ -2970,15 +2947,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to ENI-Status.
/// </summary>
public static string textENIStatus {
get {
return ResourceManager.GetString("textENIStatus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to entries.
/// </summary>
@ -4356,15 +4324,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to NSW-Status.
/// </summary>
public static string textNSWStatus {
get {
return ResourceManager.GetString("textNSWStatus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number of deaths.
/// </summary>
@ -5329,7 +5288,7 @@ namespace ENI2.Properties {
}
/// <summary>
/// Looks up a localized string similar to Select message classes.
/// Looks up a localized string similar to Select classes to import.
/// </summary>
public static string textSelectImportClasses {
get {
@ -5346,15 +5305,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Send all.
/// </summary>
public static string textSendAll {
get {
return ResourceManager.GetString("textSendAll", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Send date.
/// </summary>
@ -6390,15 +6340,6 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Waste disposal service provider.
/// </summary>
public static string textWasteDisposalServiceProvider {
get {
return ResourceManager.GetString("textWasteDisposalServiceProvider", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Waste disposal service providers.
/// </summary>

View File

@ -1757,7 +1757,7 @@
<value>Select all</value>
</data>
<data name="textSelectImportClasses" xml:space="preserve">
<value>Select message classes</value>
<value>Select classes to import</value>
</data>
<data name="textSelectNone" xml:space="preserve">
<value>Select none</value>
@ -2245,27 +2245,4 @@
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="textWasteDisposalServiceProvider" xml:space="preserve">
<value>Waste disposal service provider</value>
</data>
<data name="textSendAll" xml:space="preserve">
<value>Send all</value>
</data>
<data name="textENIStatus" xml:space="preserve">
<value>ENI-Status</value>
</data>
<data name="textNSWStatus" xml:space="preserve">
<value>NSW-Status</value>
</data>
<data name="textConfirmWSDPOverwrite" xml:space="preserve">
<value>The existing value for the waste disposal service provider will be overwritten.
Current entry: {0}
New entry: {1}
Proceed?</value>
</data>
<data name="textEasyPeasy" xml:space="preserve">
<value>Easy Peasy 🍋</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -88,14 +88,13 @@
<TabItem Header="{x:Static p:Resources.textTab22}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="190"/>
<ColumnDefinition Width="120"/>
<ColumnDefinition Width=".3*" />
<ColumnDefinition Width=".3*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="36" />
<RowDefinition Height="28" />
<RowDefinition Height="1" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
@ -126,18 +125,20 @@
<Label HorizontalContentAlignment="Right" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" Name="label_AgentEMail" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="11" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" Name="label_AgentLastName" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" Name="label_AgentFirstName" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="13" Grid.Column="0" Content="{x:Static p:Resources.textWasteDisposalServiceProvider}" Name="label_WasteDisposalServiceProvider" Margin="0,0,10,0"/>
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBox_AgentTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="AgentTitle" SelectionChanged="comboBox_AgentTemplate_SelectionChanged" />
<Grid Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26" />
</Grid.ColumnDefinitions>
<Button Name="buttonSetTemplate" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Apply template" HorizontalContentAlignment="Right" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
</Grid>
<Grid Grid.Row="1" Grid.Column="2" Name="gridTemplateControls" Visibility="Visible">
<Grid Grid.Row="2" Grid.Column="1" Name="gridTemplateControls" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26" />
<ColumnDefinition Width="*"/>
<!-- Name -->
<ColumnDefinition Width="26"/>
@ -147,23 +148,18 @@
<ColumnDefinition Width="52"/>
<!-- Undo button -->
</Grid.ColumnDefinitions>
<Button Name="buttonSetTemplate" Grid.Column="0" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Apply template" HorizontalContentAlignment="Right" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<TextBox Grid.Column="1" Margin="2" Name="textBoxTemplateTitle" VerticalContentAlignment="Center"/>
<Button Name="buttonSaveTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonSaveTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
<TextBox Grid.Column="0" Margin="2" Name="textBoxTemplateTitle" VerticalContentAlignment="Center"/>
<Button Name="buttonSaveTemplate" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSaveTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/floppy_disk_blue.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonDeleteTemplate" Grid.Column="3" Grid.Row="0" Margin="2" Click="buttonDeleteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<Button Name="buttonDeleteTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonDeleteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonUndoTemplate" Grid.Column="4" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
<Button Name="buttonUndoTemplate" Grid.Column="3" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
@ -180,12 +176,11 @@
<TextBox Grid.Row="10" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="11" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="12" Grid.Column="1" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="13" Grid.Column="1" Name="textBox_WasteDisposalServiceProvider" MaxLength="99" Margin="2" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text24Invoice}" Grid.Column="0" Grid.Row="14" Grid.ColumnSpan="3"/>
<Label HorizontalContentAlignment="Right" Grid.Row="15" Grid.Column="0" Content="{x:Static p:Resources.textSERVTemplate}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="15" Grid.Column="1" x:Name="comboBoxGroup" DisplayMemberPath="ServiceName" Margin="2" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
<Grid Grid.Row="15" Grid.Column="2">
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text24Invoice}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>
<Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textSERVTemplate}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="14" Grid.Column="1" x:Name="comboBoxGroup" DisplayMemberPath="ServiceName" Margin="2" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
<Grid Grid.Row="14" Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
@ -217,7 +212,7 @@
</Button>
</Grid>
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="3">
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="3">
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
@ -317,7 +312,7 @@
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="56" />
<RowDefinition Height="28" />
<RowDefinition Height="56" />
<RowDefinition Height="530" />
<RowDefinition Height="28" />
@ -343,7 +338,7 @@
</DatePicker.BlackoutDates>
</DatePicker>
<TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="1" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" Margin="2" />
<!-- Label Grid.Row="6" Grid.Column="0" HorizontalContentAlignment="Right" Content="{x:Static p:Resources.textAgentTemplate}" Margin="0,0,10,0" / -->
<Label Grid.Row="6" Grid.Column="0" HorizontalContentAlignment="Right" Content="{x:Static p:Resources.textAgentTemplate}" Margin="0,0,10,0" />
<Grid Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" x:Name="gridWasteControls">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".25*" />
@ -352,13 +347,39 @@
<ColumnDefinition Width=".25*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!-- RowDefinition Height="28" / -->
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<ComboBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="comboBox_WSDPTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="Remark" SelectionChanged="comboBox_WSDPTemplate_SelectionChanged" />
<Grid Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Name="gridWasteTemplateControls" Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<!-- Name -->
<ColumnDefinition Width="26"/>
<!-- Save button -->
<ColumnDefinition Width="26"/>
<!-- Delete button -->
<ColumnDefinition Width="52"/>
<!-- Undo button -->
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Margin="2" Name="textBoxWasteTemplateTitle" VerticalContentAlignment="Center"/>
<Button Name="buttonSaveWasteTemplate" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSaveWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/floppy_disk_blue.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonDeleteWasteTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonDeleteWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonUndoWasteTemplate" Grid.Column="3" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
</Grid>
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
<Button Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
</Grid>

View File

@ -7,6 +7,7 @@ using ENI2.EditControls;
using ExcelDataReader;
using Microsoft.Win32;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -33,6 +34,7 @@ namespace ENI2.SheetDisplayControls
private SEC _sec;
private WAS _was;
private Message _stoMessage;
// private Message _crewMessage;
private Dictionary<string, string> portAreas = null;
@ -126,7 +128,6 @@ namespace ENI2.SheetDisplayControls
this.textBox_AgentPhone.DataContext = this._agnt;
this.textBox_AgentPostalCode.DataContext = this._agnt;
this.textBox_AgentStreetAndNumber.DataContext = this._agnt;
this.textBox_WasteDisposalServiceProvider.DataContext = this._was;
if (_agntTemplates == null)
{
_agntTemplates = await DBManagerAsync.GetAGNTTemplatesAsync(); // inital full load
@ -264,7 +265,6 @@ namespace ENI2.SheetDisplayControls
this.RegisterTextboxChange(this.textBox_AgentPostalCode, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentCountry, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_WasteDisposalServiceProvider, Message.NotificationClass.WAS);
this.buttonSaveTemplate.IsEnabled = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor;
this.buttonDeleteTemplate.IsEnabled = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor;
@ -338,14 +338,6 @@ namespace ENI2.SheetDisplayControls
{
if (this._currentTemplate == null) return;
// confirm overwrite of waste disposal service provider
if (this.textBox_WasteDisposalServiceProvider.Text.Length > 0)
{
string message = string.Format(Properties.Resources.textConfirmWSDPOverwrite, this.textBox_WasteDisposalServiceProvider.Text, this._currentTemplate.WasteDisposalServiceProviderName);
if (MessageBox.Show(message, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No)
== MessageBoxResult.No) { return; }
}
this._undoTemplate = createFromCurrentText(null, null);
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;
@ -357,7 +349,7 @@ namespace ENI2.SheetDisplayControls
this.textBox_AgentEMail.Text = this._currentTemplate.AgentEMail;
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentFax.Text = this._currentTemplate.AgentFax;
this.textBox_AgentFax.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentFirstName.Text = this._currentTemplate.AgentFirstName;
this.textBox_AgentFirstName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentLastName.Text = this._currentTemplate.AgentLastName;
@ -368,11 +360,6 @@ namespace ENI2.SheetDisplayControls
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentStreetAndNumber.Text = this._currentTemplate.AgentStreetAndNumber;
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
if ((this._currentTemplate.WasteDisposalServiceProviderName ?? "").Trim() != (this.textBox_WasteDisposalServiceProvider.Text ?? "").Trim())
{
this.textBox_WasteDisposalServiceProvider.Text = this._currentTemplate.WasteDisposalServiceProviderName;
this.textBox_WasteDisposalServiceProvider.GetBindingExpression(TextBox.TextProperty).UpdateSource();
}
this.buttonUndoTemplate.IsEnabled = true;
this.buttonSetTemplate.IsEnabled = false;
@ -460,8 +447,6 @@ namespace ENI2.SheetDisplayControls
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_AgentStreetAndNumber.Text = this._undoTemplate.AgentStreetAndNumber;
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.textBox_WasteDisposalServiceProvider.Text = this._undoTemplate.WasteDisposalServiceProviderName;
this.textBox_WasteDisposalServiceProvider.GetBindingExpression(TextBox.TextProperty).UpdateSource();
this.buttonUndoTemplate.IsEnabled = false; // can't undo after undo
}
@ -483,7 +468,6 @@ namespace ENI2.SheetDisplayControls
at.AgentPhone = this.textBox_AgentPhone.Text;
at.AgentPostalCode = this.textBox_AgentPostalCode.Text;
at.AgentStreetAndNumber = textBox_AgentStreetAndNumber.Text;
at.WasteDisposalServiceProviderName = textBox_WasteDisposalServiceProvider.Text;
return at;
}
@ -739,7 +723,7 @@ namespace ENI2.SheetDisplayControls
private async Task InitTemplates()
{
_wsdpTemplates = await DBManagerAsync.GetWasteDisposalServiceProviderTemplatesAsync();
_wsdpTemplates = await DBManagerAsync.GetWastDisposalServiceProviderTemplatesAsync();
_wsdpTemplates.Sort();
this.comboBox_WSDPTemplate.ItemsSource = null;
this.comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;

View File

@ -102,7 +102,6 @@ namespace ENI2
private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore;
if(selectedCore != null)
cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed;
}

View File

@ -66,7 +66,7 @@
</Setter>
</Style>
<Style TargetType="{x:Type enictrl:ClosableTabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
<Style TargetType="{x:Type enictrl:ClosableTabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type enictrl:ClosableTabItem}">

View File

@ -1,63 +0,0 @@
// Copyright (c) 2017- schick Informatik
// Description: Helper class for customs data serialization
//
using bsmd.database.EasyPeasy;
using System;
using System.IO;
using System.Xml.Serialization;
namespace ENI2.Util
{
public static class EasyPeasyState
{
private static readonly string Root = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"EasyPeasy");
private static readonly string StatePath = Path.Combine(Root, "state.xml");
public static ProofRequest LoadOrCreate()
{
try
{
if (File.Exists(StatePath))
{
using (var fs = File.OpenRead(StatePath))
{
var ser = new XmlSerializer(typeof(ProofRequest));
return (ProofRequest)ser.Deserialize(fs);
}
}
}
catch { /* swallow & create new */ }
return CreateDefault();
}
public static void Save(ProofRequest data)
{
Directory.CreateDirectory(Root);
using (var fs = File.Create(StatePath))
{
var ser = new XmlSerializer(typeof(ProofRequest));
ser.Serialize(fs, data);
}
}
public static ProofRequest CreateDefault()
{
return new ProofRequest
{
ProofInformationT2LT2LF = new ProofInformationT2LT2LF
{
RequestedValidityOfTheProof = new RequestedValidityOfTheProof(),
GoodsShipmentForT2LT2LF = new GoodsShipmentForT2LT2LF
{
LocationOfGoods = new LocationOfGoods(),
TransportDocuments = new TransportDocuments()
}
}
};
}
}
}

View File

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ExcelDataReader" version="3.8.0" targetFramework="net48" />
<package id="Extended.Wpf.Toolkit" version="5.0.0" targetFramework="net48" />
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Bcl.Cryptography" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.Options" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="9.0.9" targetFramework="net48" />
<package id="ExcelDataReader" version="3.7.0" targetFramework="net48" />
<package id="Extended.Wpf.Toolkit" version="4.7.25104.5739" targetFramework="net48" />
<package id="log4net" version="3.1.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Bcl.Cryptography" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Options" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net48" />
<package id="PDFsharp" version="6.2.2" targetFramework="net48" />
<package id="PDFsharp-MigraDoc" version="6.2.2" targetFramework="net48" />
<package id="PDFsharp" version="6.2.0" targetFramework="net48" />
<package id="PDFsharp-MigraDoc" version="6.2.0" targetFramework="net48" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.119.0" targetFramework="net48" />
<package id="System.Buffers" version="4.6.1" targetFramework="net48" />
<package id="System.Data.SQLite.Core" version="1.0.119.0" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="9.0.9" targetFramework="net48" />
<package id="System.Formats.Asn1" version="9.0.9" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="9.0.6" targetFramework="net48" />
<package id="System.Formats.Asn1" version="9.0.6" targetFramework="net48" />
<package id="System.Memory" version="4.6.3" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
<package id="System.Security.Cryptography.Pkcs" version="9.0.9" targetFramework="net48" />
<package id="System.Security.Cryptography.Pkcs" version="9.0.6" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
<package id="System.ValueTuple" version="4.6.1" targetFramework="net48" />
</packages>

View File

@ -23,7 +23,9 @@ namespace SendNSWMessageService
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
InitializeComponent();
System.Net.ServicePointManager.ServerCertificateValidationCallback += (_, ____, __, ___) =>
System.Net.ServicePointManager.ServerCertificateValidationCallback += (object _, System.Security.Cryptography.X509Certificates.X509Certificate ____,
System.Security.Cryptography.X509Certificates.X509Chain __,
System.Net.Security.SslPolicyErrors ___) =>
{
return true; // **** Immer OK weil wir nur mit einem dedizierten Endpoint reden..
};

View File

@ -40,8 +40,8 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="log4net" version="3.0.3" targetFramework="net48" />
</packages>

View File

@ -46,8 +46,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<StartPageUrl>
</StartPageUrl>
<StartAction>CurrentPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<SilverlightDebugging>False</SilverlightDebugging>
<NativeDebugging>False</NativeDebugging>
<SQLDebugging>False</SQLDebugging>
<ExternalProgram>
</ExternalProgram>
<StartExternalURL>
</StartExternalURL>
<StartCmdLineArguments>
</StartCmdLineArguments>
<StartWorkingDirectory>
</StartWorkingDirectory>
<EnableENC>True</EnableENC>
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="log4net" version="3.1.0" targetFramework="net48" />
</packages>

View File

@ -40,8 +40,8 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@ -52,8 +52,8 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WinSCPnet, Version=1.16.0.16364, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf, processorArchitecture=MSIL">
<HintPath>..\packages\WinSCP.6.5.3\lib\net40\WinSCPnet.dll</HintPath>
<Reference Include="WinSCPnet, Version=1.15.0.15073, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf, processorArchitecture=MSIL">
<HintPath>..\packages\WinSCP.6.3.6\lib\net40\WinSCPnet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -93,12 +93,12 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\WinSCP.6.5.3\build\WinSCP.targets" Condition="Exists('..\packages\WinSCP.6.5.3\build\WinSCP.targets')" />
<Import Project="..\packages\WinSCP.6.3.6\build\WinSCP.targets" Condition="Exists('..\packages\WinSCP.6.3.6\build\WinSCP.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WinSCP.6.5.3\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinSCP.6.5.3\build\WinSCP.targets'))" />
<Error Condition="!Exists('..\packages\WinSCP.6.3.6\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinSCP.6.3.6\build\WinSCP.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="WinSCP" version="6.5.3" targetFramework="net48" />
<package id="log4net" version="3.0.3" targetFramework="net48" />
<package id="WinSCP" version="6.3.6" targetFramework="net48" />
</packages>

View File

@ -5,6 +5,8 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Runtime.Serialization;
namespace bsmd.database
{
@ -54,9 +56,6 @@ namespace bsmd.database
[MaxLength(99)]
public string AgentEMail { get; set; }
[MaxLength(99)]
public string WasteDisposalServiceProviderName { get; set; }
#endregion
#region DatabaseEntity implementation
@ -87,8 +86,6 @@ namespace bsmd.database
else scmd.Parameters.AddWithValue("@P10", DBNull.Value);
if (this.AgentEMail != null) scmd.Parameters.AddWithValue("@P11", this.AgentEMail);
else scmd.Parameters.AddWithValue("@P11", DBNull.Value);
if (this.WasteDisposalServiceProviderName != null) scmd.Parameters.AddWithValue("@P12", this.WasteDisposalServiceProviderName);
else scmd.Parameters.AddWithValue("@P12", DBNull.Value);
if (this.IsNew)
{
@ -96,13 +93,13 @@ namespace bsmd.database
scmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("INSERT INTO {0} (Id, Title, AgentCompanyName, AgentStreetAndNumber, " +
"AgentPostalCode, AgentCity, AgentCountry, AgentLastName, AgentFirstName, AgentPhone, AgentFax, " +
"AgentEMail, WasteDisposalServiceProviderName) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12)", this.Tablename);
"AgentEMail) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename);
}
else
{
cmd.CommandText = string.Format("UPDATE {0} SET Title = @P1, AgentCompanyName = @P2, AgentStreetAndNumber = @P3, AgentPostalCode = @P4, AgentCity = @P5, " +
"AgentCountry = @P6, AgentLastName = @P7, AgentFirstName = @P8, AgentPhone = @P9, AgentFax = @P10, " +
"AgentEMail = @P11, WasteDisposalServiceProviderName = @P12 WHERE Id = @ID", this.Tablename);
"AgentEMail = @P11 WHERE Id = @ID", this.Tablename);
scmd.Parameters.AddWithValue("@ID", this.Id);
}
}
@ -110,7 +107,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
string query = string.Format("SELECT Id, Title, AgentCompanyName, AgentStreetAndNumber, AgentPostalCode, AgentCity, AgentCountry, " +
"AgentLastName, AgentFirstName, AgentPhone, AgentFax, AgentEMail, WasteDisposalServiceProviderName FROM {0} ", this.Tablename);
"AgentLastName, AgentFirstName, AgentPhone, AgentFax, AgentEMail FROM {0} ", this.Tablename);
switch (filter)
{
@ -141,7 +138,6 @@ namespace bsmd.database
if (!reader.IsDBNull(9)) agnt_t.AgentPhone = reader.GetString(9);
if (!reader.IsDBNull(10)) agnt_t.AgentFax = reader.GetString(10);
if (!reader.IsDBNull(11)) agnt_t.AgentEMail = reader.GetString(11);
if (!reader.IsDBNull(12)) agnt_t.WasteDisposalServiceProviderName = reader.GetString(12);
result.Add(agnt_t);
}
@ -176,7 +172,6 @@ namespace bsmd.database
if (!reader.IsDBNull(9)) agnt_t.AgentPhone = reader.GetString(9);
if (!reader.IsDBNull(10)) agnt_t.AgentFax = reader.GetString(10);
if (!reader.IsDBNull(11)) agnt_t.AgentEMail = reader.GetString(11);
if (!reader.IsDBNull(12)) agnt_t.WasteDisposalServiceProviderName = reader.GetString(12);
}
return agnt_t;
}

View File

@ -122,7 +122,7 @@ namespace bsmd.database
}
public static async Task<List<WasteDisposalServiceProvider_Template>> GetWasteDisposalServiceProviderTemplatesAsync()
public static async Task<List<WasteDisposalServiceProvider_Template>> GetWastDisposalServiceProviderTemplatesAsync()
{
SqlCommand cmd = new SqlCommand();
WasteDisposalServiceProvider_Template wdsp_t = new WasteDisposalServiceProvider_Template();

View File

@ -1,92 +0,0 @@
// Copyright (c) 2024-present schick Informatik
// Description: Collection of classes for the customs XML upload app
using System;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
namespace bsmd.database.EasyPeasy
{
// Root: <proofRequest>
[XmlRoot("proofRequest")]
public class ProofRequest
{
public string DelegateIdentificationType { get; set; }
public string TraderIdentificationType { get; set; }
public string LRN { get; set; }
public string TraderIdentificationNumber { get; set; }
public string Country { get; set; }
public ProofInformationT2LT2LF ProofInformationT2LT2LF { get; set; }
public string DelegateIdentificationNumber { get; set; }
}
public class ProofInformationT2LT2LF
{
public string CompetentCustomsOffice { get; set; }
public string DeclarationType { get; set; }
public DateTime DeclarationDate { get; set; }
public decimal TotalGrossMassKg { get; set; }
public RequestedValidityOfTheProof RequestedValidityOfTheProof { get; set; }
public GoodsShipmentForT2LT2LF GoodsShipmentForT2LT2LF { get; set; }
public string RequestType { get; set; }
}
public class RequestedValidityOfTheProof
{
public int NumberOfDays { get; set; }
}
public class GoodsShipmentForT2LT2LF
{
public bool ContainerIndication { get; set; }
public LocationOfGoods LocationOfGoods { get; set; }
[XmlElement("GoodsItemsForT2LT2LF")]
public ObservableCollection<GoodsItemForT2LT2LF> GoodsItemsForT2LT2LF { get; set; } = new ObservableCollection<GoodsItemForT2LT2LF>();
public TransportDocuments TransportDocuments { get; set; }
}
public class LocationOfGoods
{
public string TypeOfLocation { get; set; }
public string QualifierOfIdentification { get; set; }
public string UNLocode { get; set; }
}
public class GoodsItemForT2LT2LF
{
public Commodity Commodity { get; set; } = new Commodity();
public int GoodsItemNumber { get; set; }
public string DescriptionOfGoods { get; set; }
public GoodsMeasure GoodsMeasure { get; set; } = new GoodsMeasure();
public Packaging Packaging { get; set; } = new Packaging();
}
public class Commodity
{
public string HarmonizedSystemSubHeadingCode { get; set; }
}
public class GoodsMeasure
{
public decimal GrossMass { get; set; }
public decimal NetMass { get; set; }
}
public class Packaging
{
public string ShippingMarks { get; set; }
public int NumberOfPackages { get; set; }
public string TypeOfPackages { get; set; }
}
public class TransportDocuments
{
public string Type { get; set; }
public string ReferenceNumber { get; set; }
}
}

View File

@ -68,10 +68,7 @@ namespace bsmd.database
while(reader.Read())
{
string type = "";
if (!reader.IsDBNull(4))
type = reader.GetString(4);
if (reader.IsDBNull(4)) continue; // this row has no type -> ignore
HAZPosTemplate hpt = new HAZPosTemplate();
hpt.Description = reader.GetString(0);
if (!reader.IsDBNull(1))
@ -85,6 +82,7 @@ namespace bsmd.database
if (specRefString.Equals("NEIN", StringComparison.OrdinalIgnoreCase) || specRefString.Equals("No", StringComparison.OrdinalIgnoreCase)) hpt.SpecRef15_19 = false;
}
string type = reader.GetString(4);
switch(type)
{
case "IBC": hpt.TemplateType = SublistType.IBC; break;
@ -92,7 +90,7 @@ namespace bsmd.database
case "IMSBC": hpt.TemplateType = SublistType.IMSBC ; break;
case "MARPOL": hpt.TemplateType = SublistType.MARPOL; break;
default:
break;
continue; // ignore this thing
}
if(!reader.IsDBNull(5))

View File

@ -217,6 +217,7 @@ namespace bsmd.database
}
else
{
if(this.MessageCore.PoC != "DEHAM")
errors.Add(RuleEngine.CreateError(ValidationCode.PORTAREA, "PortArea", this.PortArea ?? "", "INFO", "", this.Tablename));
}

View File

@ -6,6 +6,9 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bsmd.database
{

View File

@ -269,15 +269,6 @@ namespace bsmd.database
/// </summary>
public BSMDStatus InternalStatus { get; set; }
/// <summary>
/// Display helper property for overview status
/// </summary>
public string BSMDStatusOverviewDisplay {
get {
return (InternalStatus != BSMDStatus.UNDEFINED) ? InternalStatus.ToString() : "";
}
}
/// <summary>
/// Vorheriger Status (z.B. für nach der Report-Generierung), wird nicht immer gesetzt
/// </summary>
@ -293,17 +284,6 @@ namespace bsmd.database
/// </summary>
public NSWProvider HIS { get; set; }
/// <summary>
/// Display helper property for overview HIS
/// </summary>
public string HISOverviewDisplay
{
get
{
return (HIS != NSWProvider.UNDEFINED) ? HIS.ToString() : string.Empty;
}
}
/// <summary>
/// Fehlerliste (Rückgabe vom NSW)
/// </summary>
@ -426,22 +406,6 @@ namespace bsmd.database
/// </summary>
public int? FileSequenceNumber { get; set; }
/// <summary>
/// Number of violations during last validation
/// </summary>
public int? ViolationCount { get; set; }
/// <summary>
/// Number of violations during last validation that have the "identifier" set and are thus detected violations
/// from underlying list elements
/// </summary>
public int? PositionViolationCount { get; set; }
/// <summary>
/// Number of errors during last validation
/// </summary>
public int? ErrorCount { get; set; }
#endregion
#region IDatabaseEntity implementation

View File

@ -34,64 +34,37 @@ namespace bsmd.database
public static void Enqueue(Message.NSWProvider provider, Message message)
{
// Validate inputs
if (message == null)
{
_log.ErrorFormat("Enqueue called with null message for provider {0}", provider);
return;
}
if (!message.Id.HasValue)
{
_log.ErrorFormat("Enqueue called with message that has no Id assigned for provider {0}", provider);
return;
}
if (!_telemetry.ContainsKey(provider))
_telemetry.Add(provider, new Dictionary<Guid, MessageTelemetry>());
Guid messageId = message.Id.Value;
if (_telemetry[provider].ContainsKey(messageId))
if (_telemetry[provider].ContainsKey(message.Id.Value))
{
_telemetry[provider][messageId].NumTries++;
_telemetry[provider][message.Id.Value].NumTries++;
}
else
{
MessageTelemetry mt = new MessageTelemetry();
mt.SendDate = DateTime.Now;
mt.NumTries = 1;
_telemetry[provider][messageId] = mt;
_telemetry[provider][message.Id.Value] = mt;
}
}
public static void Dequeue(Message.NSWProvider provider, Message message)
{
if (message == null)
{
_log.ErrorFormat("Dequeue called with null message for provider {0}", provider);
return;
}
if (!message.Id.HasValue)
{
_log.ErrorFormat("Dequeue called with message that has no Id assigned for provider {0}", provider);
return;
}
if (_telemetry.ContainsKey(provider))
{
Guid messageId = message.Id.Value;
if (_telemetry[provider].ContainsKey(messageId))
if (_telemetry[provider].ContainsKey(message.Id.Value))
{
MessageTelemetry mt = _telemetry[provider][messageId];
_log.InfoFormat("[{0,10}][{1,8}][{2:00000}][{3:00}] ", provider, message.MessageNotificationClassDisplay, (DateTime.Now - mt.SendDate).TotalSeconds, mt.NumTries);
_telemetry[provider].Remove(messageId);
MessageTelemetry mt = _telemetry[provider][message.Id.Value];
_log.InfoFormat("[{0,10}][{1,8}][{2:00000}][{3:00}] ",provider, message.MessageNotificationClassDisplay, (DateTime.Now - mt.SendDate).TotalSeconds, mt.NumTries);
_telemetry[provider].Remove(message.Id.Value);
}
else
{
// this can happen if the service gets re-started and not all sent messages have yet been received
_log.WarnFormat("trying to deque a message from telemetry that we don't know about. Provider: {0} MessageId: {1}",
provider.ToString(), messageId);
provider.ToString(), message.Id.Value);
}
}
}

View File

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

View File

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

View File

@ -502,7 +502,7 @@ namespace bsmd.database
/// Convenience Methode, die fehlende Waste Einträge ergänzt. Verbesserte Version, aus ENI-2 herüberkopiert, damit es auch im
/// Excel_Reader nutzbar wird
/// </summary>
public void AddMissingWaste(bool fixExisting = true)
public void AddMissingWaste()
{
foreach (string wasteCodeString in WAS.WasteCodes)
@ -537,8 +537,6 @@ namespace bsmd.database
this.Waste.Add(newWaste);
}
else
{
if (fixExisting)
{
if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0;
@ -549,7 +547,6 @@ namespace bsmd.database
}
}
}
}
#endregion

View File

@ -146,13 +146,6 @@ namespace bsmd.database
};
this.WasteReceived.Add(foundWasteReceived);
}
else
{
if (!foundWasteReceived.AmountWasteReceived_MTQ.HasValue)
{
foundWasteReceived.AmountWasteReceived_MTQ = 0;
}
}
if (foundWasteReceived.WasteDescription.IsNullOrEmpty())
{

View File

@ -98,7 +98,7 @@ namespace bsmd.database
public int CompareTo(object obj)
{
if (obj is WasteDisposalServiceProvider_Template template)
return this.Remark?.CompareTo(template.Remark ?? "") ?? 0;
this.Remark?.CompareTo(template.Remark ?? "");
return 0;
}

View File

@ -89,11 +89,11 @@
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@ -119,7 +119,6 @@
<Compile Include="Customer.cs" />
<Compile Include="DatabaseEntityAsync.cs" />
<Compile Include="DBManagerAsync.cs" />
<Compile Include="EasyPeasy.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="HAZ.cs" />
<Compile Include="HAZPosTemplate.cs" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
<package id="log4net" version="3.1.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
</packages>

View File

@ -38,8 +38,8 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="log4net" version="3.0.3" targetFramework="net48" />
</packages>

View File

@ -85,18 +85,6 @@ namespace bsmd.hisnord
bool? retval;
try
{
if (core == null)
{
_log.ErrorFormat("CreateSendFile called with null core");
return false;
}
if (!core.Id.HasValue)
{
_log.ErrorFormat("CreateSendFile called with core that has no Id assigned");
return false;
}
nsw _nsw = new nsw();
_nsw.conveyance = new conveyance();
@ -133,9 +121,8 @@ namespace bsmd.hisnord
_nsw.conveyance.owner_sender.contact.phone = rp.Phone;
_nsw.conveyance.owner_sender.contact.fax = rp.Fax;
Guid coreId = core.Id.Value;
_nsw.document_reference = coreId.ToString();
_nsw.conveyance.code = coreId.ToString();
_nsw.document_reference = core.Id.Value.ToString();
_nsw.conveyance.code = core.Id.ToString();
if (!core.VisitId.IsNullOrEmpty())
{

View File

@ -38,8 +38,8 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="log4net" version="3.0.3" targetFramework="net48" />
</packages>

View File

@ -38,8 +38,8 @@
<AssemblyOriginatorKeyFile>..\bsmdKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
<Reference Include="log4net, Version=3.0.3.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.0.3\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="3.2.0" targetFramework="net48" />
<package id="log4net" version="3.0.3" targetFramework="net48" />
</packages>

View File

@ -7,7 +7,6 @@ Acrylonitrile (ACN) ;S/P;2;<60°C;2;Ja;IBC;;;;;;;;x (Y);1;;;;
Alcoholic beverages, n.o.s. (Wine);;;;; ;IBC;;;;;;;;x (Z);2;;;;
Alkanes (C6-C9);S/P;2;<60°C;2;Nein;IBC;;;;;;;;x (X);0;;;;
n-Alkanens (C10+) ;;;>60°C;1;Ja;IBC;;;;;;;;x (Y);1;;;;
Alumina (( = Aluminiumoxid) => ist nicht anzumelden als DG));;;;;;;;;;;;;;;;;;;
Alkylate;;;<60°C;2; ;MARPOL;;;;;;;;;;x;;6;
Alumina hydrate / Aluminiumhydroxid;;;;;;IMSBC;x;y;;A/B;;;;;;;;;
alpha-Methylstyrene ;S/P;2;<60°C;2;Nein;IBC;;;;;;;;x (Y);1;;;;
@ -76,7 +75,7 @@ Dolomitic quicklime;;;;; ;IMSBC;x;y;;B;1;;;;;;;;
Eisen II Sulphat;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
Eisensilikat granulat / Iron Silicate Granules;;;;;;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
Energy Rich Fuel / Neste Renewable Diesel / NExBTL / HVO / Hydrotreated Vegetable Oils;;;>60°C;1;;;;;;;;;;;;;;;siehe Bemerkung NExBTL - Renewable Diesel
Ethyl acetate ;S/P;2;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
Ethyl acetate ;P;0;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
Ethanol / Ethyl alcohol / Grain alcohol / Drinking alcohol;;;<60°C;2;Nein;IBC;;;;;;;;x (Z);2;;;;
Ethylene glycol / (Mono-)Ethylenglycol / MEG / Glycol;S/P;2;>60°C;1;Nein;IBC;;;;;;;;x (Z);2;;;;
Ethyl tert-butyl ether / ETBE ;S/P;2;<60°C;2;Nein;IBC;;;;;;;;x (Y);1;;;;
@ -92,7 +91,7 @@ Ferrochrom;;;;;;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
Ferrosilicochrom 40 / Ferrosilicon;;;;; ;IMSBC;x;;;B;1;1408;4.3;;;;;;
FERROUS METAL / BORINGS / SHAVINGS / TURNINGS / CUTTINGS;;;;; ;IMSBC;x;;;B;1;2793;4.2;;;;;;
FERTILIZER POTASH (PINK GRANULATED MURIATE OF POTASH);;;;;;IMSBC;x;;;;;;;;;;;;
Fish Meal - self-heating ;;;;; ;IMSBC;x;n;;B;1; ; ;;;;;;Dieses Gefahrgut wird OHNE MHB und OHNE IMO/UN Nummer abgesendet. Wenn Ladehafen Bremen dann Gruppe C und nicht anzumelden. (Stand 29.10.2025)
Fish Meal treated with Antioxidant;;;;; ;IMSBC;x;;;B;1;2216;9;;;;;;wenn Ladehafen Bremen dann Gruppe C und nicht anzumelden
Fishoil;S/P;2;>60°C;1;Nein;IBC;;;;;;;;x (Y) ;;;;;
Fish Silage Protein Concentrate (containing 4% or less formic acid);P;0;NF;0;Nein;IBC;;;;;;;;x (Y) ;;;;;
Fish protein concentrate (containing 4% or less formic acid);P;0;NF;0;Nein;IBC;;;;;;;;x (Z);2;;;;
@ -111,7 +110,6 @@ Ground Colemanite;;;;; ;;;;;;;;;;;;;;Keine Anmeldung
Gypsum / Gips;;;;; ;;;;;;;;;;;;;;Keine Anmeldung, IMSBC Gruppe C
HCGO / Heavy Cycle Gas Oil;;;;; ;MARPOL;;;;;;;;;;x;;;
HFO ;;;;;;MARPOL;;;;;;;;;;x;;;
Hot roiled coils (HRC);;;;;;;;;;;;;;;;;;;Keine Anmeldung
Holzstämme / Wooden Poles;;;;; ;IMSBC;x;y;;B;1;;;;;;;;Nur wenn unter Deck, nur wenn in Loser Schüttung!
Hydrochloric Acid;S/P;2;NF;0;Nein;IBC;;;;;;;;x (Z);2;;;NF;
Hydrocarbon Wax / PROWAX 312;S/P;2;>60°C;1;Ja;IBC;;;;;;;;x (X);0;;;;
@ -297,4 +295,5 @@ Wooden poles / Holzstämme;;;;; ;IMSBC;x;y;;B;1;;;;;;;;NUR UNTER DECK (in Luken)
Xylenes / Ortho-Xylene / Para Xylene;P;0;<60°C;2;Nein;IBC;;;;;;;;x (Y);1; ;;;
Zellulose / Cellulose / Wood pulp;;;;; ;;;;;;;;;;;;;;"Keine Anmeldung,
Nur falls Bulk-Ladung"
Zinc Concentrates / MRM BULK CONCENTRATES / Mineral Concentrates / METAL SULPHIDE CONCENTRATES;;;;; ;IMSBC;x;;;A;0;;;;;;;;Dieses Gefahrgut wird OHNE MHB und OHNE IMO/UN Nummer abgesendet. Eine gelbe Violation-Meldung aus dem NSW ist zu ignorieren
Zinc Concentrates / MRM BULK CONCENTRATES / Mineral Concentrates;;;;; ;IMSBC;x;;;A;0;3077;9;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""
Zinc Concentrates / MRM BULK CONCENTRATES / METAL SULPHIDE CONCENTRATES;;;;; ;IMSBC;x;y;;A/B;2;;;;;;;;"Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) (""Shippers declaration for solid bulk cargos"" anfordern oder auch ""Cargo information for solid bulk cargos"""

1 Beschreibung Gefahr HAZARD_ENUM FP FP_ENUM 15.19? Typ IMSBC MHB IMSBC_MHB Group IMSBC_HAZ UN-Nr. IMO-Cl. IBC POLLUTION_CATEGORY_ENUM MARPOL IGC FP_IBC Bemerkung
7 Alcoholic beverages, n.o.s. (Wine) IBC x (Z) 2
8 Alkanes (C6-C9) S/P 2 <60°C 2 Nein IBC x (X) 0
9 n-Alkanens (C10+) >60°C 1 Ja IBC x (Y) 1
Alumina (( = Aluminiumoxid) => ist nicht anzumelden als DG))
10 Alkylate <60°C 2 MARPOL x 6
11 Alumina hydrate / Aluminiumhydroxid IMSBC x y A/B
12 alpha-Methylstyrene S/P 2 <60°C 2 Nein IBC x (Y) 1
75 Eisensilikat granulat / Iron Silicate Granules Keine Anmeldung, IMSBC Gruppe C
76 Energy Rich Fuel / Neste Renewable Diesel / NExBTL / HVO / Hydrotreated Vegetable Oils >60°C 1 siehe Bemerkung NExBTL - Renewable Diesel
77 Ethyl acetate S/P P 2 0 <60°C 2 Nein IBC x (Z) 2
78 Ethanol / Ethyl alcohol / Grain alcohol / Drinking alcohol <60°C 2 Nein IBC x (Z) 2
79 Ethylene glycol / (Mono-)Ethylenglycol / MEG / Glycol S/P 2 >60°C 1 Nein IBC x (Z) 2
80 Ethyl tert-butyl ether / ETBE S/P 2 <60°C 2 Nein IBC x (Y) 1
81 Ethylene IGC 1038 2.1 X
91 FERROUS METAL / BORINGS / SHAVINGS / TURNINGS / CUTTINGS IMSBC x B 1 2793 4.2
92 FERTILIZER POTASH (PINK GRANULATED MURIATE OF POTASH) IMSBC x
93 Fish Meal - self-heating Fish Meal treated with Antioxidant IMSBC x n B 1 2216 9 Dieses Gefahrgut wird OHNE MHB und OHNE IMO/UN Nummer abgesendet. Wenn Ladehafen Bremen dann Gruppe C und nicht anzumelden. (Stand 29.10.2025) wenn Ladehafen Bremen dann Gruppe C und nicht anzumelden
94 Fishoil S/P 2 >60°C 1 Nein IBC x (Y)
95 Fish Silage Protein Concentrate (containing 4% or less formic acid) P 0 NF 0 Nein IBC x (Y)
96 Fish protein concentrate (containing 4% or less formic acid) P 0 NF 0 Nein IBC x (Z) 2
97 FLUORSPAR / Flussspat IMSBC x y B 1
110 HCGO / Heavy Cycle Gas Oil MARPOL x
111 HFO MARPOL x
112 Hot roiled coils (HRC) Holzstämme / Wooden Poles IMSBC x y B 1 Keine Anmeldung Nur wenn unter Deck, nur wenn in Loser Schüttung!
Holzstämme / Wooden Poles IMSBC x y B 1 Nur wenn unter Deck, nur wenn in Loser Schüttung!
113 Hydrochloric Acid S/P 2 NF 0 Nein IBC x (Z) 2 NF
114 Hydrocarbon Wax / PROWAX 312 S/P 2 >60°C 1 Ja IBC x (X) 0
115 Hydro Cracker Bottoms MARPOL x
295 Zinc Concentrates / MRM BULK CONCENTRATES / METAL SULPHIDE CONCENTRATES IMSBC x y A/B 2 Nachfragen ob als Mineral Concentrates (3077/9) oder METAL SULPHIDE CONCENTRATES (MHB) ("Shippers declaration for solid bulk cargos" anfordern oder auch "Cargo information for solid bulk cargos"
296
297
298
299

Binary file not shown.

Binary file not shown.