Compare commits
No commits in common. "develop" and "feature/dakosy_excel" have entirely different histories.
develop
...
feature/da
@ -6,7 +6,7 @@
|
|||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
<CoreDeleteTool.Properties.Settings>
|
<CoreDeleteTool.Properties.Settings>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CoreDeleteTool</RootNamespace>
|
<RootNamespace>CoreDeleteTool</RootNamespace>
|
||||||
<AssemblyName>CoreDeleteTool</AssemblyName>
|
<AssemblyName>CoreDeleteTool</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
@ -80,7 +80,6 @@
|
|||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
</Compile>
|
</Compile>
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
|||||||
@ -8,8 +8,7 @@ namespace CoreDeleteTool
|
|||||||
{
|
{
|
||||||
public partial class Main : Form
|
public partial class Main : Form
|
||||||
{
|
{
|
||||||
|
SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
|
||||||
private readonly SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
|
|
||||||
|
|
||||||
public Main()
|
public Main()
|
||||||
{
|
{
|
||||||
@ -50,7 +49,8 @@ namespace CoreDeleteTool
|
|||||||
|
|
||||||
for (int i = 0; i < this.dataGridView.SelectedRows.Count; i++)
|
for (int i = 0; i < this.dataGridView.SelectedRows.Count; i++)
|
||||||
{
|
{
|
||||||
if (this.dataGridView.SelectedRows[i].DataBoundItem is MessageCore selectedCore)
|
MessageCore selectedCore = this.dataGridView.SelectedRows[i].DataBoundItem as MessageCore;
|
||||||
|
if (selectedCore != null)
|
||||||
{
|
{
|
||||||
DBManager.Instance.DeleteCore(selectedCore);
|
DBManager.Instance.DeleteCore(selectedCore);
|
||||||
this.messageCores.Remove(selectedCore);
|
this.messageCores.Remove(selectedCore);
|
||||||
|
|||||||
2
CoreDeleteTool/Properties/Resources.Designer.cs
generated
2
CoreDeleteTool/Properties/Resources.Designer.cs
generated
@ -19,7 +19,7 @@ namespace CoreDeleteTool.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|||||||
2
CoreDeleteTool/Properties/Settings.Designer.cs
generated
2
CoreDeleteTool/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace CoreDeleteTool.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 95 KiB |
@ -1,8 +1,20 @@
|
|||||||
// Copyright (c) 2017 Informatibüro Daniel Schick
|
// Copyright (c) 2017 Informatibüro Daniel Schick
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace ENI2
|
namespace ENI2
|
||||||
{
|
{
|
||||||
@ -32,6 +44,7 @@ namespace ENI2
|
|||||||
DataGrid grid = sender as DataGrid;
|
DataGrid grid = sender as DataGrid;
|
||||||
if(grid?.SelectedItems?.Count == 1)
|
if(grid?.SelectedItems?.Count == 1)
|
||||||
{
|
{
|
||||||
|
DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
|
||||||
MessageCore selectedCore = grid.SelectedItem as MessageCore;
|
MessageCore selectedCore = grid.SelectedItem as MessageCore;
|
||||||
this.DisplayCore(selectedCore);
|
this.DisplayCore(selectedCore);
|
||||||
}
|
}
|
||||||
@ -50,7 +63,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
if((this.MessageCoreSelected != null) && (aMessageCore != null))
|
if((this.MessageCoreSelected != null) && (aMessageCore != null))
|
||||||
{
|
{
|
||||||
this.MessageCoreSelected(aMessageCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
this.MessageCoreSelected(aMessageCore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
105
ENI2/App.config
105
ENI2/App.config
@ -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
|
(c) 2017-present Informatikbüro Daniel Schick
|
||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<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>
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<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>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
</startup>
|
</startup>
|
||||||
<applicationSettings>
|
<applicationSettings>
|
||||||
<ENI2.Properties.Settings>
|
<ENI2.Properties.Settings>
|
||||||
@ -28,9 +28,6 @@
|
|||||||
<setting name="LockingServerAddress" serializeAs="String">
|
<setting name="LockingServerAddress" serializeAs="String">
|
||||||
<value>http://192.168.2.24/LockingService/LockingService.svc</value>
|
<value>http://192.168.2.24/LockingService/LockingService.svc</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="ReportAuthor" serializeAs="String">
|
|
||||||
<value>BSMD ReportGenerator</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="ConnectionString" serializeAs="String">
|
<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=nswtest;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
|
||||||
</setting>
|
</setting>
|
||||||
@ -39,106 +36,18 @@
|
|||||||
<userSettings>
|
<userSettings>
|
||||||
<ENI2.Properties.Settings>
|
<ENI2.Properties.Settings>
|
||||||
<setting name="MainWindowPlacement" serializeAs="String">
|
<setting name="MainWindowPlacement" serializeAs="String">
|
||||||
<value />
|
<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>
|
|
||||||
</setting>
|
</setting>
|
||||||
</ENI2.Properties.Settings>
|
</ENI2.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<system.serviceModel>
|
<system.serviceModel>
|
||||||
<bindings>
|
<bindings>
|
||||||
<basicHttpBinding>
|
<basicHttpBinding>
|
||||||
<binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647" />
|
<binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647"/>
|
||||||
</basicHttpBinding>
|
</basicHttpBinding>
|
||||||
</bindings>
|
</bindings>
|
||||||
<client>
|
<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>
|
</client>
|
||||||
</system.serviceModel>
|
</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-10.0.0.0" newVersion="10.0.0.0" />
|
|
||||||
</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-10.0.0.0" newVersion="10.0.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="DocumentFormat.OpenXml.Framework" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.3.0.0" newVersion="3.3.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.3.0.0" newVersion="3.3.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Microsoft.Bcl.HashCode" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@ -6,22 +6,20 @@ using System.Windows;
|
|||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using log4net;
|
|
||||||
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Net;
|
||||||
using ENI2.LockingServiceReference;
|
using ENI2.LockingServiceReference;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ENI2
|
namespace ENI2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for App.xaml
|
/// Interaction logic for App.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : System.Windows.Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
// "global" statics, da gibt es sicher noch einen eleganteren Weg..
|
// "global" statics, da gibt es sicher noch einen eleganteren Weg..
|
||||||
private static ServiceClient _lockingServiceClient = null;
|
private static ServiceClient _lockingServiceClient = null;
|
||||||
@ -32,8 +30,6 @@ namespace ENI2
|
|||||||
private ManualResetEvent ResetSplashCreated;
|
private ManualResetEvent ResetSplashCreated;
|
||||||
private Thread _splashThread;
|
private Thread _splashThread;
|
||||||
|
|
||||||
private readonly ILog _log = LogManager.GetLogger(typeof(App).Name);
|
|
||||||
|
|
||||||
public App() : base()
|
public App() : base()
|
||||||
{
|
{
|
||||||
this.Dispatcher.UnhandledException += Dispatcher_UnhandledException;
|
this.Dispatcher.UnhandledException += Dispatcher_UnhandledException;
|
||||||
@ -66,16 +62,14 @@ namespace ENI2
|
|||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
// set connectnion string to async loader
|
|
||||||
DBManagerAsync.ConnectionString = ENI2.Properties.Settings.Default.ConnectionString;
|
|
||||||
|
|
||||||
// initialize static / localized lookups from sqlite database
|
// initialize static / localized lookups from sqlite database
|
||||||
|
|
||||||
string langKey = CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
|
string langKey = CultureInfo.CurrentCulture.TwoLetterISOLanguageName;
|
||||||
|
|
||||||
Dictionary<int, string> cargoHandlingDict = LocalizedLookup.getLADGCargoHandlingStrings(langKey);
|
Dictionary<int, string> cargoHandlingDict = LocalizedLookup.getLADGCargoHandlingStrings(langKey);
|
||||||
foreach (int key in cargoHandlingDict.Keys)
|
foreach (int key in cargoHandlingDict.Keys)
|
||||||
LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]);
|
LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]);
|
||||||
LADG.MVSHLocodes.AddRange(LocalizedLookup.getMVSHLocodes());
|
|
||||||
EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown));
|
EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown));
|
||||||
CREW.NationalityDict = LocalizedLookup.getNationalities();
|
CREW.NationalityDict = LocalizedLookup.getNationalities();
|
||||||
STAT.VesselTypeDict = LocalizedLookup.getVesselTypes();
|
STAT.VesselTypeDict = LocalizedLookup.getVesselTypes();
|
||||||
@ -85,9 +79,6 @@ namespace ENI2
|
|||||||
LADG.CargoCodesNST = LocalizedLookup.getCargoCodesNST();
|
LADG.CargoCodesNST = LocalizedLookup.getCargoCodesNST();
|
||||||
LADG.CargoCodesNST3 = LocalizedLookup.getCargoCodesNST3();
|
LADG.CargoCodesNST3 = LocalizedLookup.getCargoCodesNST3();
|
||||||
|
|
||||||
// Load import value mappings
|
|
||||||
Task.Run(async () => await ValueMapping.LoadDicts());
|
|
||||||
|
|
||||||
// Preload validation fields
|
// Preload validation fields
|
||||||
List<ValidationField> vFields = bsmd.database.ValidationRule.ValidationFields;
|
List<ValidationField> vFields = bsmd.database.ValidationRule.ValidationFields;
|
||||||
RuleEngine.RegisterLocodeChecker(Util.GlobalStructures.IsValidLocode);
|
RuleEngine.RegisterLocodeChecker(Util.GlobalStructures.IsValidLocode);
|
||||||
@ -156,9 +147,9 @@ namespace ENI2
|
|||||||
private void Dispatcher_UnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
private void Dispatcher_UnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
string errorMessage = string.Format("An unhandled exception occurred: {0}\r\n{1}", e.Exception.Message, e.Exception.StackTrace);
|
string errorMessage = string.Format("An unhandled exception occurred: {0}\r\n{1}", e.Exception.Message, e.Exception.StackTrace);
|
||||||
Xceed.Wpf.Toolkit.MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
// TODO: Dieser Fehler muss irgendwohin gesendet / gespeichert werden
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
_log.Error(errorMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DatePicker_PreviewKeyDown(object sender, KeyEventArgs e)
|
private void DatePicker_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||||
|
|||||||
@ -56,33 +56,6 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Validation Error Template for a DataGrid Row -->
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
|
||||||
<Setter Property="ValidationErrorTemplate">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate>
|
|
||||||
<Grid Margin="0,-2,0,-2"
|
|
||||||
ToolTip="{Binding RelativeSource={RelativeSource
|
|
||||||
FindAncestor, AncestorType={x:Type DataGridRow}},
|
|
||||||
Path=(Validation.Errors)[0].ErrorContent}">
|
|
||||||
<Ellipse StrokeThickness="0" Fill="Red"
|
|
||||||
Width="{TemplateBinding FontSize}"
|
|
||||||
Height="{TemplateBinding FontSize}" />
|
|
||||||
<TextBlock Text="!" FontSize="{TemplateBinding FontSize}"
|
|
||||||
FontWeight="Bold" Foreground="White"
|
|
||||||
HorizontalAlignment="Center" />
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type ToolTip}" >
|
<Style TargetType="{x:Type ToolTip}" >
|
||||||
|
|
||||||
<Setter Property="OverridesDefaultStyle" Value="true" />
|
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
// Copyright (c) 2023- schick Informatik
|
|
||||||
//
|
|
||||||
// Description: Idea to have a simple control that shows if the application is busy or not using a simple icon
|
|
||||||
// that will be set according to a state
|
|
||||||
//
|
|
||||||
|
|
||||||
using ENI2.Util;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for BusyControl.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class BusyControl : UserControl
|
|
||||||
{
|
|
||||||
UIHelper.BusyStateEnum _busyState = UIHelper.BusyStateEnum.NEUTRAL;
|
|
||||||
|
|
||||||
public BusyControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UIHelper.BusyStateEnum BusyState
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_busyState = value;
|
|
||||||
//Dispatcher.Invoke(() =>
|
|
||||||
//{
|
|
||||||
switch (_busyState)
|
|
||||||
{
|
|
||||||
case UIHelper.BusyStateEnum.NEUTRAL: imageBall.Source = Properties.Resources.bullet_ball_grey.CreateBitmapSource(); break;
|
|
||||||
case UIHelper.BusyStateEnum.BUSY: imageBall.Source = Properties.Resources.bullet_ball_yellow.CreateBitmapSource(); break;
|
|
||||||
case UIHelper.BusyStateEnum.FAIL: imageBall.Source = Properties.Resources.bullet_ball_red.CreateBitmapSource(); break;
|
|
||||||
case UIHelper.BusyStateEnum.SUCCESS: imageBall.Source = Properties.Resources.bullet_ball_green.CreateBitmapSource(); break;
|
|
||||||
}
|
|
||||||
//});
|
|
||||||
}
|
|
||||||
|
|
||||||
get => _busyState;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -8,7 +8,6 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
namespace ENI2.Controls
|
||||||
{
|
{
|
||||||
@ -162,9 +161,8 @@ namespace ENI2.Controls
|
|||||||
}
|
}
|
||||||
if (!abort)
|
if (!abort)
|
||||||
{
|
{
|
||||||
var tabControl = Parent as TabControl;
|
var tabControl = Parent as ItemsControl;
|
||||||
tabControl.SelectedItem = null;
|
tabControl.Items.Remove(this);
|
||||||
_ = Dispatcher.BeginInvoke(new Action(() => tabControl.Items.Remove(this)), DispatcherPriority.Background);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
dockPanel.Children.Add(closeButton);
|
dockPanel.Children.Add(closeButton);
|
||||||
|
|||||||
@ -56,7 +56,6 @@ namespace ENI2.Controls
|
|||||||
// das hier bildet 1:1 das Kontext-Menü des ANSW ab
|
// das hier bildet 1:1 das Kontext-Menü des ANSW ab
|
||||||
|
|
||||||
public event Action<DatabaseEntity> EditRequested;
|
public event Action<DatabaseEntity> EditRequested;
|
||||||
public event Action<List<DatabaseEntity>> MultiEditRequested;
|
|
||||||
public event Action<DatabaseEntity> DeleteRequested;
|
public event Action<DatabaseEntity> DeleteRequested;
|
||||||
public event Action CreateRequested;
|
public event Action CreateRequested;
|
||||||
public event Action RefreshGrid;
|
public event Action RefreshGrid;
|
||||||
@ -207,14 +206,6 @@ namespace ENI2.Controls
|
|||||||
if (this.SelectedItems[0] is DatabaseEntity selectedEntity)
|
if (this.SelectedItems[0] is DatabaseEntity selectedEntity)
|
||||||
this.EditRequested?.Invoke(selectedEntity);
|
this.EditRequested?.Invoke(selectedEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((this.SelectedItems != null) && (this.SelectedItems.Count > 1) && !this.IsReadOnly)
|
|
||||||
{
|
|
||||||
List<DatabaseEntity> databaseEntities = new List<DatabaseEntity>();
|
|
||||||
foreach(DatabaseEntity databaseEntity in this.SelectedItems)
|
|
||||||
databaseEntities.Add(databaseEntity);
|
|
||||||
this.MultiEditRequested?.Invoke(databaseEntities);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void printItem(object sender, RoutedEventArgs e)
|
protected void printItem(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@ -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>
|
|
||||||
@ -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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -12,8 +12,6 @@ using Xceed.Wpf.Toolkit;
|
|||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
namespace ENI2.Controls
|
||||||
{
|
{
|
||||||
@ -49,38 +47,13 @@ namespace ENI2.Controls
|
|||||||
cancelButton.Click += (s, e) => { if (this.IsModal()) DialogResult = false; CancelClicked?.Invoke(); this.Close(); };
|
cancelButton.Click += (s, e) => { if (this.IsModal()) DialogResult = false; CancelClicked?.Invoke(); this.Close(); };
|
||||||
addButton.Click += (s, e) => AddClicked?.Invoke();
|
addButton.Click += (s, e) => AddClicked?.Invoke();
|
||||||
this.Closing += Window_Closing;
|
this.Closing += Window_Closing;
|
||||||
|
|
||||||
SettingBindingExtension stBinding = new SettingBindingExtension("W1Top");
|
|
||||||
BindingOperations.SetBinding(this, Window.TopProperty, stBinding);
|
|
||||||
|
|
||||||
SettingBindingExtension slBinding = new SettingBindingExtension("W1Left");
|
|
||||||
BindingOperations.SetBinding(this, Window.LeftProperty, slBinding);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AddVisible
|
public bool AddVisible
|
||||||
{
|
{
|
||||||
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; }
|
||||||
set
|
set { var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
|
||||||
{
|
|
||||||
var addButton = (Button)Template.FindName("buttonAdd", this);
|
|
||||||
if (addButton != null)
|
|
||||||
{
|
|
||||||
addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
}
|
|
||||||
var okButton = (Button)Template.FindName("buttonOK", this);
|
|
||||||
if (okButton != null)
|
|
||||||
{
|
|
||||||
if (okButton.Visibility == Visibility.Hidden)
|
|
||||||
okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool OkVisible
|
|
||||||
{
|
|
||||||
get { var okButton = (Button)Template.FindName("buttonOK", this); return okButton.Visibility == Visibility.Visible; }
|
|
||||||
set { var okButton = (Button)Template.FindName("buttonOK", this); okButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object sender, CancelEventArgs e)
|
private void Window_Closing(object sender, CancelEventArgs e)
|
||||||
@ -124,7 +97,6 @@ namespace ENI2.Controls
|
|||||||
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
||||||
}
|
}
|
||||||
catch (FormatException) { }
|
catch (FormatException) { }
|
||||||
catch (ArgumentOutOfRangeException) { thePicker.Value = null; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +113,6 @@ namespace ENI2.Controls
|
|||||||
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
||||||
}
|
}
|
||||||
catch (FormatException) { }
|
catch (FormatException) { }
|
||||||
catch (ArgumentOutOfRangeException) { thePicker.SelectedDate = null; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,26 +19,15 @@ namespace ENI2.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class LocodeControl : UserControl, INotifyPropertyChanged
|
public partial class LocodeControl : UserControl, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
|
||||||
#region fields
|
|
||||||
|
|
||||||
private List<string> _locodeList = new List<string>();
|
private List<string> _locodeList = new List<string>();
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
private bool _comboSelect;
|
private bool _comboSelect;
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public LocodeControl()
|
public LocodeControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Enums
|
|
||||||
|
|
||||||
protected enum LocodeState
|
protected enum LocodeState
|
||||||
{
|
{
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
@ -47,15 +36,6 @@ namespace ENI2.Controls
|
|||||||
AMBIGUOUS
|
AMBIGUOUS
|
||||||
};
|
};
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public void SetFocus()
|
|
||||||
{
|
|
||||||
this.comboBoxLocode.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used internally to load up drop down
|
/// used internally to load up drop down
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -79,11 +59,6 @@ namespace ENI2.Controls
|
|||||||
portName = LocodeDB.PortNameFromLocode(value); break;
|
portName = LocodeDB.PortNameFromLocode(value); break;
|
||||||
case RuleEngine.LocodeMode.SSN:
|
case RuleEngine.LocodeMode.SSN:
|
||||||
portName = LocodeDB.SSNPortNameFromLocode(value); break;
|
portName = LocodeDB.SSNPortNameFromLocode(value); break;
|
||||||
case RuleEngine.LocodeMode.OLD:
|
|
||||||
portName = LocodeDB.PortNameFromLocode(value);
|
|
||||||
if ((portName == null) && value.Equals("DEWHV"))
|
|
||||||
portName = "Stadthafen Wilhelmshaven";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
LocodeState locodeState = portName.IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
|
LocodeState locodeState = portName.IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK;
|
||||||
this.SetLocodeStateImage(this.imageLocodeState, locodeState);
|
this.SetLocodeStateImage(this.imageLocodeState, locodeState);
|
||||||
@ -114,9 +89,9 @@ namespace ENI2.Controls
|
|||||||
// MessageBox.Show(string.Format("CoerceValue is fired : Value {0}", Value));
|
// MessageBox.Show(string.Format("CoerceValue is fired : Value {0}", Value));
|
||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
public RuleEngine.LocodeMode LocodeSource { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
public RuleEngine.LocodeMode LocodeSource { get; set; }
|
||||||
|
|
||||||
#region static methods
|
#region static methods
|
||||||
|
|
||||||
@ -169,18 +144,6 @@ namespace ENI2.Controls
|
|||||||
portname = LocodeDB.PortNameFromLocode(directLocode); break;
|
portname = LocodeDB.PortNameFromLocode(directLocode); break;
|
||||||
case RuleEngine.LocodeMode.SSN:
|
case RuleEngine.LocodeMode.SSN:
|
||||||
portname = LocodeDB.SSNPortNameFromLocode(directLocode); break;
|
portname = LocodeDB.SSNPortNameFromLocode(directLocode); break;
|
||||||
case RuleEngine.LocodeMode.OLD:
|
|
||||||
{
|
|
||||||
if (directLocode.Equals("DEWHV"))
|
|
||||||
{
|
|
||||||
portname = "Stadthafen Wilhelmshaven";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
portname = LocodeDB.PortNameFromLocode(directLocode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLocode = !portname.IsNullOrEmpty();
|
bool isLocode = !portname.IsNullOrEmpty();
|
||||||
@ -208,8 +171,6 @@ namespace ENI2.Controls
|
|||||||
locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries(lookupString); break;
|
locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries(lookupString); break;
|
||||||
case RuleEngine.LocodeMode.SSN:
|
case RuleEngine.LocodeMode.SSN:
|
||||||
locodeEntries = LocalizedLookup.SSNAllLocodesForCityNameAsEntries(lookupString); break;
|
locodeEntries = LocalizedLookup.SSNAllLocodesForCityNameAsEntries(lookupString); break;
|
||||||
case RuleEngine.LocodeMode.OLD:
|
|
||||||
locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries(lookupString); break;
|
|
||||||
}
|
}
|
||||||
locodeEntries.Sort();
|
locodeEntries.Sort();
|
||||||
|
|
||||||
@ -259,15 +220,6 @@ namespace ENI2.Controls
|
|||||||
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList"));
|
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if ((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen)
|
|
||||||
{
|
|
||||||
this.comboBoxLocode.IsDropDownOpen = true;
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region private/protected methods
|
#region private/protected methods
|
||||||
@ -294,5 +246,13 @@ namespace ENI2.Controls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen)
|
||||||
|
{
|
||||||
|
this.comboBoxLocode.IsDropDownOpen = true;
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,118 +0,0 @@
|
|||||||
<UserControl x:Class="ENI2.Controls.MaerskListControl"
|
|
||||||
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:util="clr-namespace:ENI2.Util"
|
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
||||||
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
|
||||||
xmlns:local="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns:db="clr-namespace:bsmd.database;assembly=bsmd.database"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="450" d:DesignWidth="900">
|
|
||||||
<UserControl.Resources>
|
|
||||||
<col:ArrayList x:Key="arrList">
|
|
||||||
<col:DictionaryEntry Key="None" Value="0" />
|
|
||||||
<col:DictionaryEntry Key="Maersk BRV/WHV" Value="1" />
|
|
||||||
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
|
|
||||||
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
|
|
||||||
</col:ArrayList>
|
|
||||||
</UserControl.Resources>
|
|
||||||
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textPOLists}">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="40" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="40" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="50" />
|
|
||||||
<ColumnDefinition Width="30" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Label Content="From" Grid.Column="0" />
|
|
||||||
<DatePicker x:Name="dateTimePickerFrom" Margin="2" Grid.Column="1" SelectedDateChanged="dateTimePickerFrom_SelectedDateChanged"/>
|
|
||||||
<Label Content="To" Grid.Column="2" />
|
|
||||||
<DatePicker x:Name="dateTimePickerTo" Margin="2" Grid.Column="3" SelectedDateChanged="dateTimePickerFrom_SelectedDateChanged"/>
|
|
||||||
<Button x:Name="buttonLoad" Grid.Column="4" Content="Load" Margin="2" Click="buttonLoad_Click" />
|
|
||||||
<!--Button x:Name="buttonSave" Grid.Column="5" Content="Save" Margin="2" Click="buttonSave_Click" /-->
|
|
||||||
<Button x:Name="buttonRequestIds" Grid.Column="6" Content="Request marked Ids" Margin="2" Click="buttonRequestIds_Click" />
|
|
||||||
<Button x:Name="buttonRequestPlus3" Grid.Column="7" Content="Request +4" Margin="2" Click="buttonRequestIds_Click" />
|
|
||||||
<Button x:Name="buttonImport" Grid.Column="9" Margin="2" Content="Import" Click="buttonImport_Click" />
|
|
||||||
<Button x:Name="buttonExport" Grid.Column="10" Margin="2" Content="Export" Click="buttonExport_Click" />
|
|
||||||
<local:BusyControl x:Name="busyControl" Grid.Column="5" />
|
|
||||||
</Grid>
|
|
||||||
<local:ENIDataGrid Grid.Row="1" Margin="2,8,2,2" x:Name="dataGridPOCores" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
|
||||||
SelectionMode="Extended" AutoGenerateColumns="False" CellEditEnding="dataGridPOCores_CellEditEnding" CanUserAddRows="False"
|
|
||||||
MouseDoubleClick="dataGridPOCores_MouseDoubleClick">
|
|
||||||
<local:ENIDataGrid.RowStyle>
|
|
||||||
<Style TargetType="DataGridRow">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.ID}">
|
|
||||||
<Setter Property="Background" Value="LightGreen"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.NO_ID}">
|
|
||||||
<Setter Property="Background" Value="LightPink"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.UPDATED}">
|
|
||||||
<Setter Property="Background" Value="LightYellow"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.NO_ETA}">
|
|
||||||
<Setter Property="Background" Value="LightCoral"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.REQUESTING_ID}">
|
|
||||||
<Setter Property="Background" Value="Yellow"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.ID_ASSIGNED}">
|
|
||||||
<Setter Property="Background" Value="GreenYellow"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.NO_ID_AND_DUE}">
|
|
||||||
<Setter Property="Background" Value="Red"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
<DataTrigger Binding="{Binding Status}" Value="{x:Static db:MaerskData+MDStatus.CANCELLED}">
|
|
||||||
<Setter Property="Foreground" Value="DarkGray"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</local:ENIDataGrid.RowStyle>
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Header="Status" Binding="{Binding Status}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="ETA" Binding="{Binding ColA}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="ETD" Binding="{Binding ColB}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Rotation name" Binding="{Binding ColC}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Vessel code" Binding="{Binding ColD}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Vessel name" Binding="{Binding ColE}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="IMO" Binding="{Binding ColF}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Arr voy" Binding="{Binding ColG}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Dep voy" Binding="{Binding ColH}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Terminal name" Binding="{Binding ColI}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Operator code" Binding="{Binding ColJ}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Pro arr" Binding="{Binding ColK}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Pro dep" Binding="{Binding ColL}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Id" Binding="{Binding ColM}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Remark" Binding="{Binding Remark, Mode=TwoWay}" x:Name="gridColumnRemark" />
|
|
||||||
|
|
||||||
<!--DataGridTextColumn x:Name="gridColumnPONumber" Header="PO number" Binding="{Binding PONumber, Mode=TwoWay}" IsReadOnly="False" /-->
|
|
||||||
<!--DataGridComboBoxColumn x:Name="gridColumnGroup" Header="Group" IsReadOnly="False" SelectedValueBinding="{Binding Flags, Mode=TwoWay}"
|
|
||||||
ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value">
|
|
||||||
</DataGridComboBoxColumn-->
|
|
||||||
|
|
||||||
<!--DataGridTextColumn Header="ETA" Binding="{Binding ETA_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" /-->
|
|
||||||
|
|
||||||
<!--DataGridTextColumn x:Name="gridColumnATA" Header="ATA" Binding="{Binding POATA, StringFormat=\{0:dd.MM.yyyy\}, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="False" /-->
|
|
||||||
<!--DataGridTextColumn Header="ATD" Binding="{Binding ATD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" /-->
|
|
||||||
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</local:ENIDataGrid>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
</UserControl>
|
|
||||||
@ -1,623 +0,0 @@
|
|||||||
// Copyright (c) 2017 / 2023 schick Informatik
|
|
||||||
// Description: Request dbh ids for Maersk data lists
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ClosedXML.Excel;
|
|
||||||
using ENI2.Excel;
|
|
||||||
using ENI2.Locode;
|
|
||||||
using ENI2.Util;
|
|
||||||
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MaerskListControl.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class MaerskListControl : UserControl
|
|
||||||
{
|
|
||||||
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
private readonly ObservableCollection<MaerskData> maerskDataList = new ObservableCollection<MaerskData>();
|
|
||||||
private readonly DatabaseEntityWatchdog _dbWatchDog;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public MaerskListControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
Loaded += POList_Loaded;
|
|
||||||
this.dateTimePickerFrom.SelectedDate = DateTime.Today.AddDays(-14);
|
|
||||||
this.dateTimePickerTo.SelectedDate = DateTime.Today.AddDays(14);
|
|
||||||
this._dbWatchDog = new DatabaseEntityWatchdog();
|
|
||||||
this._dbWatchDog.DatabaseEntityChanged += _dbWatchDog_DatabaseEntityChanged;
|
|
||||||
this._dbWatchDog.VisitTransitIdUpdated += _dbWatchDog_VisitTransitIdUpdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Events
|
|
||||||
|
|
||||||
public delegate void DateChanged(DateTime date);
|
|
||||||
|
|
||||||
public event DateChanged FromDateChanged;
|
|
||||||
|
|
||||||
public event DateChanged ToDateChanged;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region DB Watchdog
|
|
||||||
|
|
||||||
private async void _dbWatchDog_VisitTransitIdUpdated(DatabaseEntity entity)
|
|
||||||
{
|
|
||||||
if (entity is MessageCore core)
|
|
||||||
{
|
|
||||||
foreach (MaerskData md in this.maerskDataList)
|
|
||||||
{
|
|
||||||
if ((md.MessageCore != null) && (md.MessageCore.Id == core.Id))
|
|
||||||
{
|
|
||||||
md.MessageCore = core;
|
|
||||||
md.Status = MaerskData.MDStatus.ID;
|
|
||||||
md.ColM = core.VisitId;
|
|
||||||
if (core.PoC.Equals("DEBRE") && md.ColJ.Equals("MSK"))
|
|
||||||
core.Flags = 1;
|
|
||||||
if (core.PoC.Equals("DEWVN") && md.ColJ.Equals("MSK"))
|
|
||||||
core.Flags = 1;
|
|
||||||
if (core.PoC.Equals("DEBRE") && md.ColJ.Equals("SGL"))
|
|
||||||
core.Flags = 2;
|
|
||||||
if (core.PoC.Equals("DEWVN") && md.ColJ.Equals("SGL"))
|
|
||||||
core.Flags = 3;
|
|
||||||
await DBManagerAsync.SaveAsync(core);
|
|
||||||
await DBManagerAsync.SaveAsync(md);
|
|
||||||
_dbWatchDog.UnRegister(core);
|
|
||||||
this.Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
this.dataGridPOCores.Items.Refresh();
|
|
||||||
if(_dbWatchDog.Idle)
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void _dbWatchDog_DatabaseEntityChanged(DatabaseEntity entity)
|
|
||||||
{
|
|
||||||
if (entity is MessageCore core)
|
|
||||||
System.Diagnostics.Trace.WriteLine($"Core state changed to {core.BSMDStatusInternal}");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Locode of the port that is concerned by this import list. Is to be set in the surrounding container:
|
|
||||||
/// </summary>
|
|
||||||
public string PortLocode { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// synchronize selection props
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? FromDate {
|
|
||||||
get { return this.dateTimePickerFrom.SelectedDate; }
|
|
||||||
set { this.dateTimePickerFrom.SelectedDate = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// synchronize selection props
|
|
||||||
/// </summary>
|
|
||||||
public DateTime? ToDate
|
|
||||||
{
|
|
||||||
get { return this.dateTimePickerTo.SelectedDate; }
|
|
||||||
set { this.dateTimePickerTo.SelectedDate = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region events
|
|
||||||
|
|
||||||
public event MessageCore.MessageCoreSelectedHandler MessageCoreSelected;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region control event handler
|
|
||||||
|
|
||||||
private void POList_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
dataGridPOCores.ItemsSource = maerskDataList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void dataGridPOCores_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (e.EditAction == DataGridEditAction.Commit)
|
|
||||||
{
|
|
||||||
if (e.Column == gridColumnRemark)
|
|
||||||
{
|
|
||||||
MaerskData maerskData = this.maerskDataList[e.Row.GetIndex()];
|
|
||||||
|
|
||||||
var el = e.EditingElement as System.Windows.Controls.TextBox;
|
|
||||||
if (el.Text.Length > 100)
|
|
||||||
{
|
|
||||||
el.Text = el.Text.Trim().Substring(0, 100);
|
|
||||||
}
|
|
||||||
maerskData.Remark = el.Text;
|
|
||||||
|
|
||||||
if (maerskData.MessageCore != null)
|
|
||||||
await DBManagerAsync.SaveAsync(maerskData);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
if(e.Column == gridColumnGroup)
|
|
||||||
{
|
|
||||||
var el = e.EditingElement as ComboBox;
|
|
||||||
DictionaryEntry selectedItem = (DictionaryEntry) el.SelectedItem;
|
|
||||||
MessageCore.CoreFlags coreFlag = (MessageCore.CoreFlags) Enum.Parse(typeof(MessageCore.CoreFlags), selectedItem.Value.ToString());
|
|
||||||
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
|
|
||||||
// clear all first
|
|
||||||
editedCore.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
|
|
||||||
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
|
|
||||||
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
|
|
||||||
editedCore.SetFlag(false, MessageCore.CoreFlags.HOEGH);
|
|
||||||
if (coreFlag != MessageCore.CoreFlags.NONE)
|
|
||||||
{
|
|
||||||
editedCore.SetFlag(true, coreFlag);
|
|
||||||
}
|
|
||||||
// buttonSaveChanges.IsEnabled = true;
|
|
||||||
editedCore.IsDirty = true;
|
|
||||||
}
|
|
||||||
if(e.Column == gridColumnATA)
|
|
||||||
{
|
|
||||||
var el = e.EditingElement as System.Windows.Controls.TextBox;
|
|
||||||
if(DateTime.TryParse(el.Text, out DateTime localATA))
|
|
||||||
{
|
|
||||||
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
|
|
||||||
editedCore.ATA = DateTime.SpecifyKind(localATA, DateTimeKind.Local).ToUniversalTime();
|
|
||||||
// buttonSaveChanges.IsEnabled = true;
|
|
||||||
editedCore.IsDirty = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
el.Text = string.Empty;
|
|
||||||
e.Cancel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region private methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// "Status" of a Maersk Data element is a momentary evaluation that is relevant for display purposes only
|
|
||||||
/// It is not saved
|
|
||||||
/// </summary>
|
|
||||||
private void UpdateStatus(MaerskData md)
|
|
||||||
{
|
|
||||||
// here we set the following: NO_ID, NO_ID_AND_DUE, ID, NO_ETA and DONE
|
|
||||||
// the other status are set during active processing
|
|
||||||
if(md.ETA.HasValue)
|
|
||||||
{
|
|
||||||
if((md.ETA.Value - DateTime.Now).TotalSeconds > 0) // future
|
|
||||||
{
|
|
||||||
if(!md.ColM.IsNullOrEmpty() || ((md.MessageCore != null) && (!md.MessageCore.VisitId.IsNullOrEmpty())))
|
|
||||||
{
|
|
||||||
md.Status = MaerskData.MDStatus.ID;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(md.ETA.Value.IsNextXDays(4))
|
|
||||||
{
|
|
||||||
md.Status = MaerskData.MDStatus.NO_ID_AND_DUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
md.Status = MaerskData.MDStatus.NO_ID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else // past
|
|
||||||
{
|
|
||||||
md.Status = MaerskData.MDStatus.DONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// no ETA means done
|
|
||||||
md.Status = MaerskData.MDStatus.NO_ETA;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there is an declaration and it has been cancelled.. override the state to CANCELLED
|
|
||||||
if (md.MessageCore != null && (md.MessageCore.Cancelled ?? false))
|
|
||||||
md.Status = MaerskData.MDStatus.CANCELLED;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private async void PerformSearch()
|
|
||||||
{
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.BUSY;
|
|
||||||
Dictionary<MessageCore.SearchFilterType, string> filterDict = new Dictionary<MessageCore.SearchFilterType, string>();
|
|
||||||
|
|
||||||
// Die Suche findet in dem eingestellten Intervall statt
|
|
||||||
uint from = this.dateTimePickerFrom.SelectedDate.Value.ToUniversalTime().ToUnixTimeStamp();
|
|
||||||
DateTime toDate = this.dateTimePickerTo.SelectedDate.Value.ToUniversalTime().Add(new TimeSpan(23, 59, 59));
|
|
||||||
uint to = toDate.ToUnixTimeStamp();
|
|
||||||
filterDict.Add(MessageCore.SearchFilterType.FILTER_ETA, string.Format("{0}:{1}", from.ToString() ?? "", to.ToString() ?? ""));
|
|
||||||
|
|
||||||
// suche auslösen
|
|
||||||
List<MessageCore> searchResult = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict);
|
|
||||||
|
|
||||||
// alle anderen Häfen weg
|
|
||||||
searchResult.RemoveAll(item => (item.PoC == null) || (!item.PoC.Equals(PortLocode)));
|
|
||||||
|
|
||||||
// alles entfernen was keine Maersk Xtra-Data hat (=noch nicht schon einmal importiert wurde)
|
|
||||||
foreach(MessageCore core in searchResult)
|
|
||||||
{
|
|
||||||
MaerskData md = await DBManagerAsync.LoadMaerskDataForCoreAsync(core.Id.Value);
|
|
||||||
if(md != null)
|
|
||||||
{
|
|
||||||
md.MessageCore = core;
|
|
||||||
md.MessageCoreId = core.Id.Value;
|
|
||||||
this.UpdateStatus(md);
|
|
||||||
if (!maerskDataList.Contains(md)) // DatabaseEntity implements IEquatable
|
|
||||||
{
|
|
||||||
this.maerskDataList.Add(md);
|
|
||||||
if(!core.VisitId.IsNullOrEmpty() && md.ColM.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
md.ColM = core.VisitId; // this can happen if client is closed before an Id has been returned, so we have to manually set it here
|
|
||||||
Task<int> saveResult = DBManagerAsync.SaveAsync(md); // actually we do not need to await this
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.TimeFilterItemSource();
|
|
||||||
|
|
||||||
this.dataGridPOCores.SelectedItem = null;
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TimeFilterItemSource()
|
|
||||||
{
|
|
||||||
List<MaerskData> removeList = new List<MaerskData>();
|
|
||||||
foreach (MaerskData md in this.maerskDataList)
|
|
||||||
{
|
|
||||||
if (md.ETA.HasValue)
|
|
||||||
{
|
|
||||||
if (this.dateTimePickerFrom.SelectedDate.HasValue && (md.ETA.Value < this.dateTimePickerFrom.SelectedDate.Value))
|
|
||||||
removeList.Add(md);
|
|
||||||
|
|
||||||
if (this.dateTimePickerTo.SelectedDate.HasValue) {
|
|
||||||
|
|
||||||
DateTime toDate = this.dateTimePickerTo.SelectedDate.Value.ToUniversalTime().Add(new TimeSpan(23, 59, 59));
|
|
||||||
if(md.ETA.Value > toDate)
|
|
||||||
removeList.Add(md);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (MaerskData md in removeList)
|
|
||||||
this.maerskDataList.Remove(md);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region button event handler
|
|
||||||
|
|
||||||
private void buttonLoad_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Util.UIHelper.SetBusyState();
|
|
||||||
this.PerformSearch();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void buttonImport_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
OpenFileDialog ofd = new OpenFileDialog
|
|
||||||
{
|
|
||||||
Filter = "Excel Files|*.xls;*.xlsx"
|
|
||||||
};
|
|
||||||
if (ofd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
|
||||||
using (var workbook = new XLWorkbook(stream))
|
|
||||||
{
|
|
||||||
var worksheet = workbook.Worksheet(1); // Get first worksheet
|
|
||||||
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row
|
|
||||||
|
|
||||||
List<MaerskData> importData = new List<MaerskData>();
|
|
||||||
|
|
||||||
int currentRow = 1; // Start at 1 since we skip header
|
|
||||||
bool imosAreOkay = true;
|
|
||||||
|
|
||||||
foreach (var row in rows)
|
|
||||||
{
|
|
||||||
currentRow++;
|
|
||||||
|
|
||||||
if (worksheet.RangeUsed().ColumnCount() < 13)
|
|
||||||
{
|
|
||||||
throw new InvalidDataException("Sheet must have 13 columns of data");
|
|
||||||
}
|
|
||||||
|
|
||||||
MaerskData md = new MaerskData();
|
|
||||||
|
|
||||||
if (!row.Cell(1).IsEmpty())
|
|
||||||
{
|
|
||||||
var cellValue = row.Cell(1).Value;
|
|
||||||
if (cellValue.IsDateTime)
|
|
||||||
{
|
|
||||||
var dateTime = cellValue.GetDateTime();
|
|
||||||
md.ETA = dateTime;
|
|
||||||
md.ColA = md.ETA.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
md.ColA = row.Cell(1).GetString();
|
|
||||||
if (DateTime.TryParse(md.ColA, out DateTime aDateTime))
|
|
||||||
md.ETA = aDateTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!row.Cell(2).IsEmpty()) md.ColB = row.Cell(2).GetString();
|
|
||||||
if (!row.Cell(3).IsEmpty()) md.ColC = row.Cell(3).GetString();
|
|
||||||
if (!row.Cell(4).IsEmpty()) md.ColD = row.Cell(4).GetString();
|
|
||||||
if (!row.Cell(5).IsEmpty()) md.ColE = row.Cell(5).GetString();
|
|
||||||
if (!row.Cell(6).IsEmpty()) md.ColF = row.Cell(6).GetString();
|
|
||||||
if (!row.Cell(7).IsEmpty()) md.ColG = row.Cell(7).GetString();
|
|
||||||
if (!row.Cell(8).IsEmpty()) md.ColH = row.Cell(8).GetString();
|
|
||||||
if (!row.Cell(9).IsEmpty()) md.ColI = row.Cell(9).GetString();
|
|
||||||
|
|
||||||
if (md.ColI != null)
|
|
||||||
{
|
|
||||||
if ((md.ColI.Contains("bremerhaven", StringComparison.OrdinalIgnoreCase) && this.PortLocode.Equals("DEWVN")) ||
|
|
||||||
(md.ColI.Contains("eurogate", StringComparison.OrdinalIgnoreCase) && this.PortLocode.Equals("DEBRV")))
|
|
||||||
throw new InvalidOperationException($"{md.ColI} found in import to {PortLocode}, this is probably an error. Aborting import");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!row.Cell(10).IsEmpty()) md.ColJ = row.Cell(10).GetString();
|
|
||||||
if (md.ColJ == null) continue;
|
|
||||||
if (!(md.ColJ.Equals("msk", StringComparison.OrdinalIgnoreCase) || md.ColJ.Equals("sgl", StringComparison.OrdinalIgnoreCase))) continue; // skip operator we are not interested in
|
|
||||||
|
|
||||||
if (!row.Cell(11).IsEmpty()) md.ColK = row.Cell(11).GetString();
|
|
||||||
if (!row.Cell(12).IsEmpty()) md.ColL = row.Cell(12).GetString();
|
|
||||||
if (!row.Cell(13).IsEmpty()) md.ColM = row.Cell(13).GetString();
|
|
||||||
if (!row.Cell(14).IsEmpty()) md.Remark = row.Cell(14).GetString();
|
|
||||||
|
|
||||||
if (!md.ColF.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
if (Int32.TryParse(md.ColF, out int imo))
|
|
||||||
{
|
|
||||||
if ((imo < 1000000) || (imo > 9999999))
|
|
||||||
{
|
|
||||||
imosAreOkay = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
imosAreOkay = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
imosAreOkay = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!imosAreOkay)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"Invalid IMO in row {currentRow}, aborting import", Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
importData.Add(md);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (imosAreOkay && importData.Count > 0)
|
|
||||||
{
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.BUSY;
|
|
||||||
|
|
||||||
foreach (MaerskData md in importData)
|
|
||||||
{
|
|
||||||
if (this.maerskDataList.Contains(md))
|
|
||||||
{
|
|
||||||
// update record with imported record
|
|
||||||
MaerskData foundData = this.maerskDataList.First((m) => (m.ColF != null) ? m.ColF.Equals(md.ColF) : (md.ColF == null) &&
|
|
||||||
(m.ColG != null) ? m.ColG.Equals(md.ColG) : (md.ColG == null) &&
|
|
||||||
(m.ColH != null) ? m.ColH.Equals(md.ColH) : (md.ColH == null));
|
|
||||||
|
|
||||||
if ((foundData.MessageCore == null) || !(foundData.MessageCore.Cancelled ?? false))
|
|
||||||
{
|
|
||||||
if (foundData.ETA.HasValue && ((foundData.ETA.Value - DateTime.Now).TotalSeconds > 0) && foundData.Update(md))
|
|
||||||
foundData.Status = MaerskData.MDStatus.UPDATED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!md.ColM.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
md.MessageCore = await DBManagerAsync.LoadCoreByVisitIdAsync(md.ColM);
|
|
||||||
if (md.MessageCore != null)
|
|
||||||
{
|
|
||||||
MaerskData existingMD = await DBManagerAsync.LoadMaerskDataForCoreAsync(md.MessageCore.Id.Value);
|
|
||||||
if (existingMD == null)
|
|
||||||
{
|
|
||||||
// we have a core but no MarskData for this import -> save it
|
|
||||||
md.MessageCoreId = (Guid)md.MessageCore.Id;
|
|
||||||
_ = DBManagerAsync.SaveAsync(md);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
existingMD.Update(md);
|
|
||||||
_ = DBManagerAsync.SaveAsync(existingMD);
|
|
||||||
this.UpdateStatus(existingMD);
|
|
||||||
maerskDataList.Add(existingMD);
|
|
||||||
continue; // add existing instead of new one
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.UpdateStatus(md);
|
|
||||||
maerskDataList.Add(md);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.TimeFilterItemSource();
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
|
||||||
|
|
||||||
this.dataGridPOCores.Items.Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonExport_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// Export of the current collection
|
|
||||||
string predefFilename = string.Format("{0}_{1}.xlsx", this.PortLocode, DateTime.Today.ToString("yyyyMMdd"));
|
|
||||||
SaveFileDialog sfd = new SaveFileDialog()
|
|
||||||
{
|
|
||||||
Filter = "Excel Files|*.xlsx;*.xls",
|
|
||||||
FileName = predefFilename
|
|
||||||
};
|
|
||||||
if(sfd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
Util.UIHelper.SetBusyState();
|
|
||||||
ExcelManager em = new ExcelManager();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
List<MaerskData> exportList = new List<MaerskData>(this.maerskDataList);
|
|
||||||
em.ExportMaersk(exportList, sfd.FileName);
|
|
||||||
Process.Start(sfd.FileName);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, "Export failed", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void buttonRequestIds_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// find all entries from now until 4 days into the future and track parallel requests
|
|
||||||
List<MaerskData> requestList = new List<MaerskData>();
|
|
||||||
if (sender == this.buttonRequestIds)
|
|
||||||
{
|
|
||||||
foreach (MaerskData md in this.dataGridPOCores.SelectedItems)
|
|
||||||
{
|
|
||||||
if (md.MessageCore?.VisitId.IsNullOrEmpty() == false) continue; // already requested
|
|
||||||
if (md.ColM?.IsNullOrEmpty() == false) continue; // already something there
|
|
||||||
requestList.Add(md);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(sender == this.buttonRequestPlus3)
|
|
||||||
{
|
|
||||||
foreach(MaerskData md in this.maerskDataList)
|
|
||||||
{
|
|
||||||
if(((md.MessageCore == null) && md.ColM.IsNullOrEmpty()) ||
|
|
||||||
((md.MessageCore != null) && md.MessageCore.VisitId.IsNullOrEmpty()))
|
|
||||||
{
|
|
||||||
if (md.ETA.HasValue && md.ETA.Value.IsNextXDays(4))
|
|
||||||
requestList.Add(md);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(requestList.Count == 0)
|
|
||||||
{
|
|
||||||
MessageBox.Show("No valid rows selected", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.BUSY;
|
|
||||||
|
|
||||||
foreach (MaerskData md in requestList)
|
|
||||||
{
|
|
||||||
md.Status = MaerskData.MDStatus.REQUESTING_ID;
|
|
||||||
|
|
||||||
// create MessageCore and message classes
|
|
||||||
md.MessageCore = new MessageCore();
|
|
||||||
md.MessageCore.InitialHIS = Message.NSWProvider.DBH_MAERSK;
|
|
||||||
md.MessageCore.IMO = md.ColF;
|
|
||||||
md.MessageCore.ETA = md.ETA;
|
|
||||||
md.MessageCore.IsTransit = false;
|
|
||||||
md.MessageCore.PoC = this.PortLocode;
|
|
||||||
md.MessageCore.Portname = LocodeDB.PortNameFromLocode(md.MessageCore.PoC);
|
|
||||||
md.MessageCore.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND;
|
|
||||||
md.MessageCore.Incoming = true;
|
|
||||||
md.MessageCore.DefaultReportingPartyId = App.UserId.Value;
|
|
||||||
await DBManagerAsync.SaveAsync(md.MessageCore);
|
|
||||||
md.MessageCoreId = md.MessageCore.Id.Value;
|
|
||||||
await DBManagerAsync.SaveAsync(md);
|
|
||||||
|
|
||||||
// Meldeklassen für neuen Anlauf erzeugen
|
|
||||||
// TODO: pre-set certain fields taken from Maersk data
|
|
||||||
await bsmd.database.Util.CreateMessagesForCoreAsync(md.MessageCore, null);
|
|
||||||
|
|
||||||
// watchdog registrieren
|
|
||||||
this._dbWatchDog.Register(md.MessageCore);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.dataGridPOCores.Items.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region grid event handler
|
|
||||||
|
|
||||||
private void dataGridPOCores_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender != null)
|
|
||||||
{
|
|
||||||
DataGrid grid = sender as DataGrid;
|
|
||||||
if (grid?.SelectedItems?.Count == 1)
|
|
||||||
{
|
|
||||||
MaerskData md = grid.SelectedItem as MaerskData;
|
|
||||||
if(md.MessageCore != null) {
|
|
||||||
Util.UIHelper.SetBusyState();
|
|
||||||
this.MessageCoreSelected?.Invoke(md.MessageCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region DateTime picker event handler
|
|
||||||
|
|
||||||
private void dateTimePickerFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (sender == dateTimePickerFrom)
|
|
||||||
this.FromDateChanged?.Invoke(dateTimePickerFrom.SelectedDate.Value);
|
|
||||||
|
|
||||||
if (sender == dateTimePickerTo)
|
|
||||||
this.ToDateChanged?.Invoke(dateTimePickerTo.SelectedDate.Value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<UserControl x:Class="ENI2.Controls.MaerskOverviewControl"
|
|
||||||
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="450" d:DesignWidth="800">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Label Grid.Row="0" Content="Maersk lists" />
|
|
||||||
<TabControl x:Name="tabControlMaersk" Grid.Row="1">
|
|
||||||
<TabItem Name="tabItemBRV" Header="DEBRV">
|
|
||||||
<local:MaerskListControl x:Name="brvListControl" />
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Name="tabItemWVN" Header="DEWVN">
|
|
||||||
<local:MaerskListControl x:Name="wvnListControl" />
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MaerskOverviewControl.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class MaerskOverviewControl : UserControl
|
|
||||||
{
|
|
||||||
public MaerskOverviewControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.brvListControl.PortLocode = "DEBRV";
|
|
||||||
this.wvnListControl.PortLocode = "DEWVN";
|
|
||||||
|
|
||||||
this.brvListControl.FromDateChanged += BrvListControl_FromDateChanged;
|
|
||||||
this.brvListControl.ToDateChanged += BrvListControl_ToDateChanged;
|
|
||||||
this.wvnListControl.FromDateChanged += WvnListControl_FromDateChanged;
|
|
||||||
this.wvnListControl.ToDateChanged += WvnListControl_ToDateChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WvnListControl_ToDateChanged(System.DateTime date)
|
|
||||||
{
|
|
||||||
this.brvListControl.ToDate = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void WvnListControl_FromDateChanged(System.DateTime date)
|
|
||||||
{
|
|
||||||
this.brvListControl.FromDate = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BrvListControl_ToDateChanged(System.DateTime date)
|
|
||||||
{
|
|
||||||
this.wvnListControl.ToDate = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BrvListControl_FromDateChanged(System.DateTime date)
|
|
||||||
{
|
|
||||||
this.wvnListControl.FromDate = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MaerskListControl> ListControls
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new List<MaerskListControl>() { this.brvListControl, this.wvnListControl };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
56
ENI2/Controls/POListControl.xaml
Normal file
56
ENI2/Controls/POListControl.xaml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<UserControl x:Class="ENI2.Controls.POListControl"
|
||||||
|
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:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
||||||
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:local="clr-namespace:ENI2.Controls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<col:ArrayList x:Key="arrList">
|
||||||
|
<col:DictionaryEntry Key="None" Value="0" />
|
||||||
|
<col:DictionaryEntry Key="Maersk BRV/WHV" Value="1" />
|
||||||
|
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
|
||||||
|
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
|
||||||
|
</col:ArrayList>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textPOLists}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Label Content="Calendar week" />
|
||||||
|
<xctk:DoubleUpDown x:Name="doubleUpDownCalendarWeek" VerticalContentAlignment="Center" VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Stretch" Margin="2" Value="01" ValueChanged="doubleUpDownCalendarWeek_ValueChanged"/>
|
||||||
|
<Label Content="Type" />
|
||||||
|
<ComboBox x:Name="comboBoxFilterType" Margin="2" SelectionChanged="comboBoxFilterType_SelectionChanged" Width="100" />
|
||||||
|
|
||||||
|
<Button x:Name="buttonExcelExport" Margin="2" Click="buttonExcelExport_Click" Content="Export Excel" Width="100" />
|
||||||
|
<Button x:Name="buttonSaveChanges" Margin="2" Click="buttonSaveChanges_Click" Content="Save changes" Width="100" IsEnabled="False" />
|
||||||
|
</StackPanel>
|
||||||
|
<local:ENIDataGrid Grid.Row="1" Margin="2,8,2,2" x:Name="dataGridPOCores" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
SelectionMode="Single" AutoGenerateColumns="False" CellEditEnding="dataGridPOCores_CellEditEnding" CanUserAddRows="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="IMO/ENI" Binding="{Binding IMOENIDisplay}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn x:Name="gridColumnPONumber" Header="PO number" Binding="{Binding PONumber, Mode=TwoWay}" IsReadOnly="False" />
|
||||||
|
<DataGridComboBoxColumn x:Name="gridColumnGroup" Header="Group" IsReadOnly="False" SelectedValueBinding="{Binding Flags, Mode=TwoWay}"
|
||||||
|
ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value">
|
||||||
|
</DataGridComboBoxColumn>
|
||||||
|
<DataGridTextColumn Header="Ship name" Binding="{Binding Shipname}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="ETA" Binding="{Binding ETA_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="ETD" Binding="{Binding ETD_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn x:Name="gridColumnATA" Header="ATA" Binding="{Binding POATA, StringFormat=\{0:dd.MM.yyyy\}, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="False" />
|
||||||
|
<DataGridTextColumn Header="ATD" Binding="{Binding ATD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="Hafen" Binding="{Binding PortnameDisplay}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="Id" Binding="{Binding DisplayId}" IsReadOnly="True" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</local:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
</UserControl>
|
||||||
278
ENI2/Controls/POListControl.xaml.cs
Normal file
278
ENI2/Controls/POListControl.xaml.cs
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
// Copyright (c) 2017 schick Informatik
|
||||||
|
// Description: PO Nummer Übersicht. Ergänzung Nummern. Excel Export
|
||||||
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
using Microsoft.Office.Interop.Excel;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
|
||||||
|
namespace ENI2.Controls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for POListControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class POListControl : UserControl
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private readonly string[] _comboBoxEntries =
|
||||||
|
{
|
||||||
|
"All",
|
||||||
|
"Maersk BRV/WHV",
|
||||||
|
"SeaGo BHV",
|
||||||
|
"SeaGo WHV"
|
||||||
|
};
|
||||||
|
|
||||||
|
private List<MessageCore> searchResult = new List<MessageCore>();
|
||||||
|
private readonly List<MessageCore> filteredResult = new List<MessageCore>();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public POListControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += POList_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region control event handler
|
||||||
|
|
||||||
|
private void POList_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.comboBoxFilterType.ItemsSource = this._comboBoxEntries;
|
||||||
|
this.doubleUpDownCalendarWeek.Value = bsmd.database.Util.GetIso8601WeekOfYear(DateTime.Now);
|
||||||
|
this.dataGridPOCores.ItemsSource = this.filteredResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonExcelExport_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.filteredResult.Count == 0) return;
|
||||||
|
|
||||||
|
OpenFileDialog ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Filter = "Excel Files|*.xls;*.xlsx"
|
||||||
|
};
|
||||||
|
if (ofd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
|
||||||
|
excelApp.DisplayAlerts = false;
|
||||||
|
Workbook workBook = excelApp.Workbooks.Open(ofd.FileName);
|
||||||
|
Worksheet workSheet = workBook.Worksheets[1];
|
||||||
|
|
||||||
|
int rowIndex = 3;
|
||||||
|
foreach(MessageCore core in this.filteredResult)
|
||||||
|
{
|
||||||
|
workSheet.Cells[rowIndex, 7].Value = core.Shipname;
|
||||||
|
workSheet.Cells[rowIndex, 10].Value = core.PoC.Substring(2);
|
||||||
|
if(core.POATA.HasValue)
|
||||||
|
workSheet.Cells[rowIndex, 11].Value = core.POATA.Value.ToShortDateString();
|
||||||
|
workSheet.Cells[rowIndex, 13].Value = core.PONumber;
|
||||||
|
rowIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
workBook.Save();
|
||||||
|
workBook.Close();
|
||||||
|
Marshal.ReleaseComObject(workBook);
|
||||||
|
excelApp.Quit();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonSaveChanges_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach(MessageCore messageCore in this.filteredResult)
|
||||||
|
{
|
||||||
|
if (messageCore.IsDirty)
|
||||||
|
{
|
||||||
|
DBManager.Instance.Save(messageCore);
|
||||||
|
messageCore.IsDirty = false;
|
||||||
|
// load ATA for this Core
|
||||||
|
/* DAS ATA WIRD JETZT NICHT MEHR IN DIE MELDEKLASSE GESPEICHERT
|
||||||
|
Message ataMessage = DBManager.Instance.GetMessage(messageCore, Message.NotificationClass.ATA);
|
||||||
|
if(ataMessage?.Elements.Count == 1)
|
||||||
|
{
|
||||||
|
if(messageCore.ATA != ((ATA)ataMessage.Elements[0]).ATAPortOfCall)
|
||||||
|
{
|
||||||
|
((ATA)ataMessage.Elements[0]).ATAPortOfCall = messageCore.ATA;
|
||||||
|
DBManager.Instance.Save(ataMessage.Elements[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.buttonSaveChanges.IsEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doubleUpDownCalendarWeek_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
{
|
||||||
|
if (!this.IsLoaded) return;
|
||||||
|
this.comboBoxFilterType.SelectedIndex = -1;
|
||||||
|
this.PerformSearch();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBoxFilterType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
this.dataGridPOCores.ItemsSource = null;
|
||||||
|
if (this.comboBoxFilterType.SelectedIndex == -1) return;
|
||||||
|
|
||||||
|
this.filteredResult.Clear();
|
||||||
|
foreach (MessageCore core in this.searchResult)
|
||||||
|
{
|
||||||
|
switch (this.comboBoxFilterType.SelectedIndex)
|
||||||
|
{
|
||||||
|
case 0: this.filteredResult.Add(core); break;
|
||||||
|
case 1: if (core.IsFlagSet(MessageCore.CoreFlags.MAERSK_BHV)) this.filteredResult.Add(core); break;
|
||||||
|
case 2: if (core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.filteredResult.Add(core); break;
|
||||||
|
case 3: if (core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.filteredResult.Add(core); break;
|
||||||
|
case 4: if (core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.filteredResult.Add(core); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.dataGridPOCores.ItemsSource = this.filteredResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridPOCores_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.EditAction == DataGridEditAction.Commit)
|
||||||
|
{
|
||||||
|
if (e.Column == gridColumnPONumber)
|
||||||
|
{
|
||||||
|
// validate for "true" number
|
||||||
|
var el = e.EditingElement as System.Windows.Controls.TextBox;
|
||||||
|
if (!el.Text.IsDigitsOnly())
|
||||||
|
{
|
||||||
|
el.Text = string.Empty;
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonSaveChanges.IsEnabled = true;
|
||||||
|
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
|
||||||
|
editedCore.IsDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(e.Column == gridColumnGroup)
|
||||||
|
{
|
||||||
|
var el = e.EditingElement as ComboBox;
|
||||||
|
DictionaryEntry selectedItem = (DictionaryEntry) el.SelectedItem;
|
||||||
|
MessageCore.CoreFlags coreFlag = (MessageCore.CoreFlags) Enum.Parse(typeof(MessageCore.CoreFlags), selectedItem.Value.ToString());
|
||||||
|
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
|
||||||
|
// clear all first
|
||||||
|
editedCore.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
|
||||||
|
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
|
||||||
|
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
|
||||||
|
editedCore.SetFlag(false, MessageCore.CoreFlags.HOEGH);
|
||||||
|
if (coreFlag != MessageCore.CoreFlags.NONE)
|
||||||
|
{
|
||||||
|
editedCore.SetFlag(true, coreFlag);
|
||||||
|
}
|
||||||
|
buttonSaveChanges.IsEnabled = true;
|
||||||
|
editedCore.IsDirty = true;
|
||||||
|
}
|
||||||
|
if(e.Column == gridColumnATA)
|
||||||
|
{
|
||||||
|
var el = e.EditingElement as System.Windows.Controls.TextBox;
|
||||||
|
if(DateTime.TryParse(el.Text, out DateTime localATA))
|
||||||
|
{
|
||||||
|
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
|
||||||
|
editedCore.ATA = DateTime.SpecifyKind(localATA, DateTimeKind.Local).ToUniversalTime();
|
||||||
|
buttonSaveChanges.IsEnabled = true;
|
||||||
|
editedCore.IsDirty = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
el.Text = string.Empty;
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private methods
|
||||||
|
|
||||||
|
private void PerformSearch()
|
||||||
|
{
|
||||||
|
this.dataGridPOCores.ItemsSource = null;
|
||||||
|
this.filteredResult.Clear();
|
||||||
|
|
||||||
|
if (!this.doubleUpDownCalendarWeek.Value.HasValue) return;
|
||||||
|
|
||||||
|
Dictionary<MessageCore.SearchFilterType, string> filterDict = new Dictionary<MessageCore.SearchFilterType, string>();
|
||||||
|
|
||||||
|
DateTime start = bsmd.database.Util.FirstDateOfWeekISO8601(DateTime.Now.Year, (int)this.doubleUpDownCalendarWeek.Value);
|
||||||
|
DateTime end = start.Add(new TimeSpan(6, 23, 59, 59));
|
||||||
|
|
||||||
|
// Die Suche findet in einem erweiterten Intervall statt, da später wenn möglich nach ATA gefiltert wird
|
||||||
|
uint from = start.Subtract(new TimeSpan(10, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
|
||||||
|
uint to = end.Add(new TimeSpan(5, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
|
||||||
|
filterDict.Add(MessageCore.SearchFilterType.FILTER_ETA, string.Format("{0}:{1}", from.ToString() ?? "", to.ToString() ?? ""));
|
||||||
|
|
||||||
|
Util.UIHelper.SetBusyState();
|
||||||
|
|
||||||
|
// suche auslösen
|
||||||
|
this.searchResult = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict);
|
||||||
|
// alle anderen Häfen weg
|
||||||
|
this.searchResult.RemoveAll(item => !item.PoC.Equals("DEBRV") && !item.PoC.Equals("DEWHV") && !item.PoC.Equals("DEWVN"));
|
||||||
|
|
||||||
|
// rückwärts iterieren um nach ETA und ATA zu filtern
|
||||||
|
if (this.searchResult.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = this.searchResult.Count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
MessageCore messageCore = this.searchResult[i];
|
||||||
|
if (messageCore.ATA.HasValue)
|
||||||
|
{
|
||||||
|
if ((messageCore.ATA.Value < start) || (messageCore.ATA.Value > end))
|
||||||
|
{
|
||||||
|
this.searchResult.RemoveAt(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!messageCore.POATA.HasValue)
|
||||||
|
{
|
||||||
|
messageCore.POATA = messageCore.ATA;
|
||||||
|
messageCore.IsDirty = true;
|
||||||
|
this.buttonSaveChanges.IsEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((messageCore.ETA.Value < start) || (messageCore.ETA.Value > end)) this.searchResult.RemoveAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
searchResult.Sort((x, y) => DateTime.Compare(x.ATA ?? DateTime.MaxValue, y.ATA ?? DateTime.MaxValue));
|
||||||
|
|
||||||
|
this.dataGridPOCores.SelectedItem = null;
|
||||||
|
this.filteredResult.AddRange(searchResult);
|
||||||
|
this.dataGridPOCores.ItemsSource = this.filteredResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,7 +20,6 @@
|
|||||||
<DataGridTextColumn Header="{x:Static p:Resources.textLogin}" Binding="{Binding Logon}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textLogin}" Binding="{Binding Logon}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding UserEMail}" IsReadOnly="True" Width="0.2*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding UserEMail}" IsReadOnly="True" Width="0.2*" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textAdministrator}" Binding="{Binding IsAdmin}" IsReadOnly="True" Width="0.1*" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textAdministrator}" Binding="{Binding IsAdmin}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textEditor}" Binding="{Binding IsEditor}" IsReadOnly="True" Width="0.1*" />
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCreated}" Binding="{Binding Created}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCreated}" Binding="{Binding Created}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.1*" />
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|||||||
@ -16,8 +16,12 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
|
<Label Content="Excel:" />
|
||||||
|
<Label Name="labelStatusExcel" Content="?" FontWeight="Bold" />
|
||||||
<Label Content="Transmitter:" />
|
<Label Content="Transmitter:" />
|
||||||
<Label Name="labelStatusTransmitter" Content="?" FontWeight="Bold" />
|
<Label Name="labelStatusTransmitter" Content="?" FontWeight="Bold" />
|
||||||
|
<Label Content="Report:" />
|
||||||
|
<Label Name="labelStatusReport" Content="?" FontWeight="Bold" />
|
||||||
<Button Name="refreshButton" Content="{x:Static p:Resources.textRefresh}" Margin="4" Background="Transparent" Click="refreshButton_Click"/>
|
<Button Name="refreshButton" Content="{x:Static p:Resources.textRefresh}" Margin="4" Background="Transparent" Click="refreshButton_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<local:ENIDataGrid Grid.Row="1"
|
<local:ENIDataGrid Grid.Row="1"
|
||||||
|
|||||||
@ -27,14 +27,13 @@ namespace ENI2.Controls
|
|||||||
private readonly static ILog _log = LogManager.GetLogger("ServerStatus");
|
private readonly static ILog _log = LogManager.GetLogger("ServerStatus");
|
||||||
private ProgressBar _updateProgressBar;
|
private ProgressBar _updateProgressBar;
|
||||||
private TextBlock _updateTextBlock;
|
private TextBlock _updateTextBlock;
|
||||||
private bool _isUpdating = false;
|
|
||||||
private readonly static Dictionary<Guid, string> coreIdVisitIdMap = new Dictionary<Guid, string>();
|
|
||||||
|
|
||||||
public ServerStatusControl()
|
public ServerStatusControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.dataGridStatus.ItemsSource = this.entries;
|
this.dataGridStatus.ItemsSource = this.entries;
|
||||||
this.Loaded += ServerStatusControl_Loaded;
|
this.Loaded += ServerStatusControl_Loaded;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ServerStatusControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
private void ServerStatusControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
||||||
@ -44,8 +43,6 @@ namespace ENI2.Controls
|
|||||||
|
|
||||||
internal void Update(LockingServiceReference.ServerStatus serverStatus)
|
internal void Update(LockingServiceReference.ServerStatus serverStatus)
|
||||||
{
|
{
|
||||||
if (this._isUpdating) return;
|
|
||||||
_isUpdating = true;
|
|
||||||
int totalNum = serverStatus.IMPFiles.Length + serverStatus.READYFiles.Length + serverStatus.CORRUPTFiles.Length;
|
int totalNum = serverStatus.IMPFiles.Length + serverStatus.READYFiles.Length + serverStatus.CORRUPTFiles.Length;
|
||||||
entries.Clear();
|
entries.Clear();
|
||||||
BackgroundWorker bgWorker = new BackgroundWorker();
|
BackgroundWorker bgWorker = new BackgroundWorker();
|
||||||
@ -106,12 +103,16 @@ namespace ENI2.Controls
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Enumeration parsen und text ausgeben
|
// Enumeration parsen und text ausgeben
|
||||||
|
ServiceControllerStatus excel = (ServiceControllerStatus)serverStatus.Excel;
|
||||||
|
this.labelStatusExcel.Content = excel.ToString();
|
||||||
|
|
||||||
|
ServiceControllerStatus report = (ServiceControllerStatus)serverStatus.Report;
|
||||||
|
this.labelStatusReport.Content = report.ToString();
|
||||||
|
|
||||||
ServiceControllerStatus transmitter = (ServiceControllerStatus)serverStatus.Transmitter;
|
ServiceControllerStatus transmitter = (ServiceControllerStatus)serverStatus.Transmitter;
|
||||||
this.labelStatusTransmitter.Content = transmitter.ToString();
|
this.labelStatusTransmitter.Content = transmitter.ToString();
|
||||||
|
|
||||||
this.busyIndicator.IsBusy = false;
|
this.busyIndicator.IsBusy = false;
|
||||||
|
|
||||||
_isUpdating = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.busyIndicator.IsBusy = true;
|
this.busyIndicator.IsBusy = true;
|
||||||
@ -146,25 +147,17 @@ namespace ENI2.Controls
|
|||||||
|
|
||||||
string guidString = m.Groups[2].Value;
|
string guidString = m.Groups[2].Value;
|
||||||
|
|
||||||
string idString = "";
|
|
||||||
if (!guidIdDict.ContainsKey(guidString))
|
if (!guidIdDict.ContainsKey(guidString))
|
||||||
{
|
{
|
||||||
|
string idString = "";
|
||||||
if (Guid.TryParse(m.Groups[2].Value, out Guid coreId))
|
if (Guid.TryParse(m.Groups[2].Value, out Guid coreId))
|
||||||
{
|
|
||||||
if (!coreIdVisitIdMap.ContainsKey(coreId))
|
|
||||||
{
|
{
|
||||||
MessageCore aCore = DBManager.Instance.GetMessageCoreById(coreId);
|
MessageCore aCore = DBManager.Instance.GetMessageCoreById(coreId);
|
||||||
if (aCore != null)
|
if (aCore != null)
|
||||||
{
|
{
|
||||||
coreIdVisitIdMap[coreId] = aCore.DisplayId;
|
|
||||||
idString = aCore.DisplayId;
|
idString = aCore.DisplayId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
idString = coreIdVisitIdMap[coreId];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
guidIdDict[guidString] = idString;
|
guidIdDict[guidString] = idString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
namespace ENI2.Controls
|
||||||
{
|
{
|
||||||
@ -36,20 +35,6 @@ namespace ENI2.Controls
|
|||||||
closeButton.Click += (s, e) => { if (this.IsModal()) DialogResult = true; CloseClicked?.Invoke(); this.Close(); };
|
closeButton.Click += (s, e) => { if (this.IsModal()) DialogResult = true; CloseClicked?.Invoke(); this.Close(); };
|
||||||
refreshButton.Click += (s, e) => { RefreshClicked?.Invoke(); };
|
refreshButton.Click += (s, e) => { RefreshClicked?.Invoke(); };
|
||||||
|
|
||||||
string topProperty = "W2Top";
|
|
||||||
string leftProperty = "W2Left";
|
|
||||||
if(this.GetType().Name == "ViolationListDialog")
|
|
||||||
{
|
|
||||||
topProperty = "W3Top";
|
|
||||||
leftProperty = "W3Left";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SettingBindingExtension stBinding = new SettingBindingExtension(topProperty);
|
|
||||||
this.SetBinding(Window.TopProperty, stBinding);
|
|
||||||
|
|
||||||
SettingBindingExtension slBinding = new SettingBindingExtension(leftProperty);
|
|
||||||
this.SetBinding (Window.LeftProperty, slBinding);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,68 +0,0 @@
|
|||||||
<UserControl x:Class="ENI2.Controls.ValueMappingsControl"
|
|
||||||
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"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Label Grid.Row="0" Content="{x:Static p:Resources.textExcelValueMappings}" />
|
|
||||||
<GroupBox Name="groupBoxRP" Header="" Grid.Row="1">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="40" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="40" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="50" />
|
|
||||||
<ColumnDefinition Width="30" />
|
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Label Content="Type" Grid.Column="0" />
|
|
||||||
<ComboBox Margin="2" Grid.Column="1" x:Name="comboBoxType" SelectionChanged="comboBoxType_SelectionChanged" />
|
|
||||||
|
|
||||||
<local:BusyControl x:Name="busyControl" Grid.Column="2" />
|
|
||||||
<Button x:Name="buttonSave" Grid.Column="6" Margin="2" Content="Save all changes" Click="buttonSave_Click" />
|
|
||||||
<Button x:Name="buttonImport" Grid.Column="9" Margin="2" Content="Import" Click="buttonImport_Click" IsEnabled="False" />
|
|
||||||
<Button x:Name="buttonExport" Grid.Column="10" Margin="2" Content="Export" Click="buttonExport_Click" IsEnabled="False" />
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
<local:ENIDataGrid Grid.Row="1" Margin="2,8,2,2" x:Name="dataGridValueMappings" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
|
||||||
SelectionMode="Extended" AutoGenerateColumns="False" CellEditEnding="dataGridValueMappings_CellEditEnding" CanUserAddRows="False"
|
|
||||||
MouseDoubleClick="dataGridValueMappings_MouseDoubleClick" BeginningEdit="dataGridValueMappings_BeginningEdit">
|
|
||||||
<local:ENIDataGrid.RowStyle>
|
|
||||||
<Style TargetType="DataGridRow">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding Value}" Value="*">
|
|
||||||
<Setter Property="Background" Value="Pink"></Setter>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</local:ENIDataGrid.RowStyle>
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn x:Name="columnKey" Header="Key" Binding="{Binding Key, Mode=TwoWay}" IsReadOnly="False" />
|
|
||||||
<DataGridTextColumn x:Name="columnValue" Header="Value key" Binding="{Binding Value, Mode=TwoWay}" IsReadOnly="False" />
|
|
||||||
<DataGridTextColumn x:Name="columnValueText" Header="Value text" Binding="{Binding ValueText, Mode=TwoWay}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Created" Binding="{Binding Created}" IsReadOnly="True" />
|
|
||||||
<DataGridTextColumn Header="Changed" Binding="{Binding Changed}" IsReadOnly="True" />
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</local:ENIDataGrid>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@ -1,218 +0,0 @@
|
|||||||
using bsmd.database;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace ENI2.Controls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for ValueMappingsControl.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ValueMappingsControl : UserControl
|
|
||||||
{
|
|
||||||
private readonly ObservableCollection<ValueMapping> _mappings = new ObservableCollection<ValueMapping>();
|
|
||||||
private DataGridCellInfo activeCellAtEdit;
|
|
||||||
|
|
||||||
public ValueMappingsControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.comboBoxType.ItemsSource = Enum.GetValues(typeof(ValueMapping.MappingType)).Cast<ValueMapping.MappingType>();
|
|
||||||
this.dataGridValueMappings.ItemsSource = _mappings;
|
|
||||||
|
|
||||||
this.dataGridValueMappings.ContextMenu = new ContextMenu();
|
|
||||||
MenuItem addItem = new MenuItem
|
|
||||||
{
|
|
||||||
Header = Properties.Resources.textAdd,
|
|
||||||
Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/add.png")) }
|
|
||||||
};
|
|
||||||
|
|
||||||
addItem.Click += AddItem_Click;
|
|
||||||
this.dataGridValueMappings.ContextMenu.Items.Add(addItem);
|
|
||||||
|
|
||||||
MenuItem delItem = new MenuItem
|
|
||||||
{
|
|
||||||
Header = Properties.Resources.textDelete,
|
|
||||||
Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/delete.png")) }
|
|
||||||
};
|
|
||||||
|
|
||||||
delItem.Click += DelItem_Click;
|
|
||||||
this.dataGridValueMappings.ContextMenu.Items.Add(delItem);
|
|
||||||
|
|
||||||
MenuItem invalidItem = new MenuItem
|
|
||||||
{
|
|
||||||
Header = "Set as invalid key",
|
|
||||||
Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/sign_warning_radiation.png")) }
|
|
||||||
};
|
|
||||||
invalidItem.Click += InvalidItem_Click;
|
|
||||||
this.dataGridValueMappings.ContextMenu.Items.Add(invalidItem);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#region context menu event handler
|
|
||||||
|
|
||||||
private void InvalidItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.dataGridValueMappings.SelectedItem is ValueMapping vm)
|
|
||||||
{
|
|
||||||
vm.Value = "*";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void DelItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.dataGridValueMappings.SelectedItems.Count > 0)
|
|
||||||
{
|
|
||||||
if (MessageBox.Show($"Are you sure to delete the selected values?", Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==
|
|
||||||
MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
var selectedItems = new List<ValueMapping>();
|
|
||||||
foreach(ValueMapping vm in this.dataGridValueMappings.SelectedItems)
|
|
||||||
selectedItems.Add(vm);
|
|
||||||
foreach(ValueMapping vm in selectedItems)
|
|
||||||
{
|
|
||||||
int result = await DBManagerAsync.DeleteAsync(vm);
|
|
||||||
if (result == 1)
|
|
||||||
{
|
|
||||||
_mappings.Remove(vm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
ValueMapping.MappingType? mappingType = (ValueMapping.MappingType?) this.comboBoxType.SelectedItem;
|
|
||||||
if (mappingType == null) return;
|
|
||||||
ValueMapping vm = ValueMapping.Create(mappingType.Value);
|
|
||||||
_mappings.Add(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private void dataGridValueMappings_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
|
|
||||||
{
|
|
||||||
// we need to check that there are no keys entered twice or changed into something that is already here
|
|
||||||
string newValue = ((TextBox)e.EditingElement).Text;
|
|
||||||
if (newValue == null) return;
|
|
||||||
|
|
||||||
if (e.Column == columnKey)
|
|
||||||
{
|
|
||||||
ValueMapping editedMapping = e.Row.Item as ValueMapping;
|
|
||||||
foreach(ValueMapping vm in _mappings)
|
|
||||||
{
|
|
||||||
if (vm == editedMapping) continue; // dont compare with myself
|
|
||||||
if (vm.Key == newValue)
|
|
||||||
{
|
|
||||||
((TextBox)e.EditingElement).Text = editedMapping.Key;
|
|
||||||
e.Cancel = true; // hopefully this avoids writing back to the model
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(e.Column == columnValue)
|
|
||||||
{
|
|
||||||
ValueMapping editedMapping = e.Row.Item as ValueMapping;
|
|
||||||
|
|
||||||
ValueMapping.MappingType? mappingType = (ValueMapping.MappingType)this.comboBoxType.SelectedItem;
|
|
||||||
if ((mappingType != null) && (newValue != null))
|
|
||||||
{
|
|
||||||
switch (mappingType)
|
|
||||||
{
|
|
||||||
case ValueMapping.MappingType.GENDER:
|
|
||||||
if (Util.GlobalStructures.GenderDict.ContainsKey(newValue))
|
|
||||||
editedMapping.ValueText = Util.GlobalStructures.GenderDict[newValue];
|
|
||||||
else
|
|
||||||
editedMapping.ValueText = "";
|
|
||||||
break;
|
|
||||||
case ValueMapping.MappingType.DOCUMENT_TYPE:
|
|
||||||
if (Util.GlobalStructures.IDDocTypeDict.ContainsKey(newValue))
|
|
||||||
editedMapping.ValueText = Util.GlobalStructures.IDDocTypeDict[newValue];
|
|
||||||
else
|
|
||||||
editedMapping.ValueText = "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
editedMapping.ValueText = newValue;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dataGridValueMappings_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonImport_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonExport_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void comboBoxType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
this._mappings.Clear();
|
|
||||||
|
|
||||||
if(this.comboBoxType.SelectedItem != null)
|
|
||||||
{
|
|
||||||
ValueMapping.MappingType mappingType = (ValueMapping.MappingType)this.comboBoxType.SelectedItem;
|
|
||||||
List<ValueMapping> mappings = await DBManagerAsync.LoadValuesForType(mappingType);
|
|
||||||
foreach (ValueMapping vm in mappings)
|
|
||||||
{
|
|
||||||
// add "Klartext"
|
|
||||||
switch(mappingType)
|
|
||||||
{
|
|
||||||
case ValueMapping.MappingType.GENDER:
|
|
||||||
if (Util.GlobalStructures.GenderDict.ContainsKey(vm.Value))
|
|
||||||
vm.ValueText = Util.GlobalStructures.GenderDict[vm.Value];
|
|
||||||
break;
|
|
||||||
case ValueMapping.MappingType.DOCUMENT_TYPE:
|
|
||||||
if (Util.GlobalStructures.IDDocTypeDict.ContainsKey(vm.Value))
|
|
||||||
vm.ValueText = Util.GlobalStructures.IDDocTypeDict[vm.Value];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
vm.ValueText = vm.Value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
_mappings.Add(vm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dataGridValueMappings_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
|
|
||||||
{
|
|
||||||
this.activeCellAtEdit = this.dataGridValueMappings.CurrentCell;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void buttonSave_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int totalSaves = 0;
|
|
||||||
foreach(ValueMapping vm in _mappings)
|
|
||||||
{
|
|
||||||
if (vm.Key.IsNullOrEmpty()) continue;
|
|
||||||
if (vm.IsNew || vm.IsDirty)
|
|
||||||
{
|
|
||||||
totalSaves += await DBManagerAsync.SaveAsync(vm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(totalSaves > 0)
|
|
||||||
{
|
|
||||||
MessageBox.Show($"{totalSaves} value mappings saved", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -34,7 +34,8 @@ namespace ENI2
|
|||||||
if (parentObject == null) return null;
|
if (parentObject == null) return null;
|
||||||
|
|
||||||
//check if the parent matches the type we're looking for
|
//check if the parent matches the type we're looking for
|
||||||
if (parentObject is T parent)
|
T parent = parentObject as T;
|
||||||
|
if (parent != null)
|
||||||
return parent;
|
return parent;
|
||||||
else
|
else
|
||||||
return FindParent<T>(parentObject);
|
return FindParent<T>(parentObject);
|
||||||
|
|||||||
@ -33,7 +33,6 @@ namespace ENI2
|
|||||||
private DependencyPropertyDescriptor _dpComboboxValue;
|
private DependencyPropertyDescriptor _dpComboboxValue;
|
||||||
private DependencyPropertyDescriptor _dpNumericUpdown;
|
private DependencyPropertyDescriptor _dpNumericUpdown;
|
||||||
private DependencyPropertyDescriptor _dpIntUpdown;
|
private DependencyPropertyDescriptor _dpIntUpdown;
|
||||||
|
|
||||||
private readonly Dictionary<Object, Message.NotificationClass> _controlClassDict = new Dictionary<object, Message.NotificationClass>();
|
private readonly Dictionary<Object, Message.NotificationClass> _controlClassDict = new Dictionary<object, Message.NotificationClass>();
|
||||||
private readonly Dictionary<Message.NotificationClass, Message> _typeMessageDict = new Dictionary<Message.NotificationClass, Message>();
|
private readonly Dictionary<Message.NotificationClass, Message> _typeMessageDict = new Dictionary<Message.NotificationClass, Message>();
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ namespace ENI2
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Damit kann ein Listenelement eine Validierung der gesamten Anmeldung auslösen (inkl. Highlighting) (auf Knopfdruck)
|
/// Damit kann ein Listenelement eine Validierung der gesamten Anmeldung auslösen (inkl. Highlighting) (auf Knopfdruck)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<bool> RequestValidate;
|
public event Action RequestValidate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Alle Meldeklassen die auf "zu versenden" stehen werden validiert und falls die Validierung scheitert auf "SUSPEND" gestellt
|
/// Alle Meldeklassen die auf "zu versenden" stehen werden validiert und falls die Validierung scheitert auf "SUSPEND" gestellt
|
||||||
@ -90,7 +89,7 @@ namespace ENI2
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eine in der Detailansicht enthaltene Meldeklasse hat sich geändert
|
/// Eine in der Detailansicht enthaltene Meldeklasse hat sich geändert
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<Message.NotificationClass?> NotificationClassChanged;
|
public event Action<Message.NotificationClass> NotificationClassChanged;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eine Maske soll neu erzeugt werden weil sich dort "indirekt" etwas geändert hat durch eine Änderung in einer anderen Maske.
|
/// Eine Maske soll neu erzeugt werden weil sich dort "indirekt" etwas geändert hat durch eine Änderung in einer anderen Maske.
|
||||||
@ -135,6 +134,7 @@ namespace ENI2
|
|||||||
_dpNumericUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.DoubleUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.DoubleUpDown));
|
_dpNumericUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.DoubleUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.DoubleUpDown));
|
||||||
_dpIntUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.IntegerUpDown));
|
_dpIntUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.IntegerUpDown));
|
||||||
|
|
||||||
|
|
||||||
foreach(Message message in this.Messages)
|
foreach(Message message in this.Messages)
|
||||||
{
|
{
|
||||||
_typeMessageDict[message.MessageNotificationClass] = message;
|
_typeMessageDict[message.MessageNotificationClass] = message;
|
||||||
@ -160,9 +160,9 @@ namespace ENI2
|
|||||||
this.RequestReload?.Invoke(coreId);
|
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()
|
protected virtual void OnRequestSendValidation()
|
||||||
@ -185,17 +185,6 @@ namespace ENI2
|
|||||||
this.ResetControlCache?.Invoke(messageGroupName);
|
this.ResetControlCache?.Invoke(messageGroupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
|
||||||
{
|
|
||||||
ScrollViewer scv = (ScrollViewer)sender;
|
|
||||||
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual int SelectedTabIndex { get; set; } = -1;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region event handling for control content changes (signal dirty etc)
|
#region event handling for control content changes (signal dirty etc)
|
||||||
|
|
||||||
protected void RegisterTextboxChange(TextBox textBox, Message.NotificationClass notificationClass)
|
protected void RegisterTextboxChange(TextBox textBox, Message.NotificationClass notificationClass)
|
||||||
@ -269,16 +258,11 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
_typeMessageDict[notificationClass].IsDirty = true;
|
_typeMessageDict[notificationClass].IsDirty = true;
|
||||||
// signal this notification class changed..
|
// signal this notification class changed..
|
||||||
this.OnNotificationClassChanged(notificationClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void OnNotificationClassChanged(Message.NotificationClass? notificationClass)
|
|
||||||
{
|
|
||||||
this.NotificationClassChanged?.Invoke(notificationClass);
|
this.NotificationClassChanged?.Invoke(notificationClass);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region "BHV Spezial" Datetime Parsing..
|
#region "BHV Spezial" Datetime Parsing..
|
||||||
|
|
||||||
@ -296,9 +280,7 @@ namespace ENI2
|
|||||||
int minute = Int32.Parse(timevalText.Substring(10, 2));
|
int minute = Int32.Parse(timevalText.Substring(10, 2));
|
||||||
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
thePicker.Value = new DateTime(year, month, day, hour, minute, 0);
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (FormatException) { }
|
||||||
thePicker.Value = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,9 +296,7 @@ namespace ENI2
|
|||||||
int year = Int32.Parse(timevalText.Substring(4, 4));
|
int year = Int32.Parse(timevalText.Substring(4, 4));
|
||||||
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
thePicker.SelectedDate = new DateTime(year, month, day, 0, 0, 0);
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (FormatException) { }
|
||||||
thePicker.SelectedDate = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,6 +331,8 @@ namespace ENI2
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region IHighlightControlContainer implementation
|
#region IHighlightControlContainer implementation
|
||||||
|
|
||||||
public virtual void HighlightErrorMessageContainer()
|
public virtual void HighlightErrorMessageContainer()
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="220" x:Name="leftColumnDefinition"/>
|
<ColumnDefinition Width="220" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" >
|
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" >
|
||||||
<xctk:AutoSelectTextBox x:Name="displayIdLabel" Width="Auto" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
|
<xctk:AutoSelectTextBox x:Name="displayIdLabel" Width="Auto" VerticalContentAlignment="Center" FontWeight="Bold" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
|
||||||
<Label Margin="10,0,0,0" Content="{x:Static p:Resources.textShipEmail}" VerticalContentAlignment="Center" />
|
<Label Margin="10,0,0,0" Content="Ship e-mail:" VerticalContentAlignment="Center" />
|
||||||
<xctk:AutoSelectTextBox Width="400" x:Name="shipEMailLabel" VerticalContentAlignment="Center" FontWeight="Normal" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
|
<xctk:AutoSelectTextBox Width="400" x:Name="shipEMailLabel" VerticalContentAlignment="Center" FontWeight="Normal" IsReadOnly="True" BorderThickness="0" AutoSelectBehavior="OnFocus" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Button Name="buttonSave" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSave_Click" BorderThickness="0" Background="Transparent" Visibility="Hidden">
|
<Button Name="buttonSave" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSave_Click" BorderThickness="0" Background="Transparent" Visibility="Hidden">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -71,24 +71,8 @@
|
|||||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Width="0.2*">
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Binding="{Binding BunkerFuelType}" IsReadOnly="True" Width="0.2*" />
|
||||||
<DataGridTextColumn.Binding>
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" Binding="{Binding BunkerFuelQuantity_TNE, Mode=TwoWay}" IsReadOnly="True" Width="0.8*" />
|
||||||
<Binding Path="BunkerFuelType" Mode="TwoWay">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:StringValidationRule MaxLength="25" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" IsReadOnly="False" Width="0.8*">
|
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<Binding Path="BunkerFuelQuantity_TNE" Mode="TwoWay">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:NumberValidationRule MaxValue="10000"/>
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|||||||
@ -39,7 +39,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBA);
|
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBA);
|
||||||
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBA);
|
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBA);
|
||||||
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBA);
|
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBA);
|
||||||
this.dataGridBKRA.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.BKRA); };
|
|
||||||
startupComplete = true;
|
startupComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,9 +165,9 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void copyBKR(object sender, RoutedEventArgs e)
|
private void copyBKR(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.dataGridBKRA.SelectedItems != null)
|
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
|
||||||
{
|
|
||||||
foreach (BRKA brka in this.dataGridBKRA.SelectedItems)
|
foreach (BRKA brka in this.dataGridBKRA.Items)
|
||||||
{
|
{
|
||||||
BRKD copyBRKD = new BRKD();
|
BRKD copyBRKD = new BRKD();
|
||||||
copyBRKD.MessageHeader = this._brkdMessage;
|
copyBRKD.MessageHeader = this._brkdMessage;
|
||||||
@ -177,15 +176,13 @@ namespace ENI2.DetailViewControls
|
|||||||
this._brkdMessage.Elements.Add(copyBRKD);
|
this._brkdMessage.Elements.Add(copyBRKD);
|
||||||
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region BKRA grid events
|
#region BKRA grid events
|
||||||
|
|
||||||
private void DataGridBKRA_CreateRequested()
|
private void DataGridBKRA_CreateRequested()
|
||||||
{
|
{
|
||||||
this.dataGridBKRA.CancelEdit();
|
|
||||||
this.dataGridBKRA.CancelEdit();
|
|
||||||
EditBKRDialog ebd = new EditBKRDialog();
|
EditBKRDialog ebd = new EditBKRDialog();
|
||||||
ebd.BRKA = new BRKA();
|
ebd.BRKA = new BRKA();
|
||||||
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
|
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
|
||||||
@ -218,8 +215,6 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (obj is BRKA brka)
|
if (obj is BRKA brka)
|
||||||
{
|
{
|
||||||
this.dataGridBKRA.CancelEdit();
|
|
||||||
this.dataGridBKRA.CancelEdit();
|
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brka);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brka);
|
||||||
this._bkraMessage.Elements.Remove(brka);
|
this._bkraMessage.Elements.Remove(brka);
|
||||||
@ -231,10 +226,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridBKRA_EditRequested(DatabaseEntity obj)
|
private void DataGridBKRA_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
// I am not shitting you: this has to be called TWICE(!) in a row in order to work
|
|
||||||
// see: https://stackoverflow.com/questions/20204592/wpf-datagrid-refresh-is-not-allowed-during-an-addnew-or-edititem-transaction-m
|
|
||||||
this.dataGridBKRA.CancelEdit(DataGridEditingUnit.Row);
|
|
||||||
this.dataGridBKRA.CommitEdit(DataGridEditingUnit.Row, true);
|
|
||||||
|
|
||||||
EditBKRDialog eld = new EditBKRDialog();
|
EditBKRDialog eld = new EditBKRDialog();
|
||||||
eld.IsDeparture = false;
|
eld.IsDeparture = false;
|
||||||
@ -245,8 +236,7 @@ namespace ENI2.DetailViewControls
|
|||||||
eld.CopyValuesToEntity();
|
eld.CopyValuesToEntity();
|
||||||
if(!_bkraMessage.Elements.Contains(eld.BRKA))
|
if(!_bkraMessage.Elements.Contains(eld.BRKA))
|
||||||
_bkraMessage.Elements.Add(eld.BRKA);
|
_bkraMessage.Elements.Add(eld.BRKA);
|
||||||
this.dataGridBKRA.ItemsSource = null;
|
this.dataGridBKRA.Items.Refresh();
|
||||||
this.dataGridBKRA.ItemsSource = this._bkraMessage.Elements;
|
|
||||||
eld.BRKA = new BRKA();
|
eld.BRKA = new BRKA();
|
||||||
eld.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
|
eld.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
|
||||||
eld.BRKA.MessageHeader = _bkraMessage;
|
eld.BRKA.MessageHeader = _bkraMessage;
|
||||||
@ -257,8 +247,7 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (!_bkraMessage.Elements.Contains(eld.BRKA))
|
if (!_bkraMessage.Elements.Contains(eld.BRKA))
|
||||||
_bkraMessage.Elements.Add(eld.BRKA);
|
_bkraMessage.Elements.Add(eld.BRKA);
|
||||||
this.dataGridBKRA.ItemsSource = null;
|
this.dataGridBKRA.Items.Refresh();
|
||||||
this.dataGridBKRA.ItemsSource = this._bkraMessage.Elements;
|
|
||||||
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,6 +279,17 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region special datetimepicker validation popup (OMG)
|
#region special datetimepicker validation popup (OMG)
|
||||||
|
|
||||||
private void dateTimePickerATA_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
private void dateTimePickerATA_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{x:Static p:Resources.textCrewArrival}" Name="tabCrewArrival">
|
<TabItem Header="{x:Static p:Resources.textCrew}" Name="tabCrewArrival">
|
||||||
<GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}">
|
<GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@ -60,14 +60,13 @@
|
|||||||
<Button Name="buttonImportExcelCrew" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
|
<Button Name="buttonImportExcelCrew" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
|
||||||
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
||||||
<Label Name="labelCrewEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
<Label Name="labelCrewEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
<!--
|
||||||
<CheckBox Name="checkBoxCrewNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
|
<CheckBox Name="checkBoxCrewNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
|
||||||
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
||||||
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/>
|
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/>
|
||||||
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
|
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
|
||||||
<Button Name="buttonDeleteAllCrewA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewA_Click"/>
|
|
||||||
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" />
|
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" />
|
||||||
|
-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
@ -79,7 +78,7 @@
|
|||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding CrewMemberPlaceOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding CrewMemberPlaceOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<!--<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />--> <!-- XXX: TODO -->
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding CrewMemberDateOfBirth, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding CrewMemberDateOfBirth, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding CrewMemberIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding CrewMemberIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
@ -92,7 +91,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<!-- XXX : TODO
|
||||||
<TabItem Header="{x:Static p:Resources.textCrewDeparture}" Name="tabCrewDeparture">
|
<TabItem Header="{x:Static p:Resources.textCrewDeparture}" Name="tabCrewDeparture">
|
||||||
<GroupBox Name="groupBoxCrewListDeparture" Header="{x:Static p:Resources.textTabCrewList}">
|
<GroupBox Name="groupBoxCrewListDeparture" Header="{x:Static p:Resources.textTabCrewList}">
|
||||||
<Grid>
|
<Grid>
|
||||||
@ -108,7 +107,6 @@
|
|||||||
<Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
<Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
||||||
<CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/>
|
<CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/>
|
||||||
<Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
|
<Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
|
||||||
<Button Name="buttonDeleteAllCrewD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewD_Click"/>
|
|
||||||
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" />
|
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
@ -133,8 +131,8 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
-->
|
||||||
<TabItem Header="{x:Static p:Resources.textPasArrival}" Name="tabPassengerList">
|
<TabItem Header="{x:Static p:Resources.textPas}" Name="tabPassengerList">
|
||||||
<GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}">
|
<GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@ -145,12 +143,13 @@
|
|||||||
<Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
|
<Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
|
||||||
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
||||||
<Label Name="labelPasEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
<Label Name="labelPasEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
<!--
|
||||||
<CheckBox Name="checkBoxPasNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click"/>
|
<CheckBox Name="checkBoxPasNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click"/>
|
||||||
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
||||||
<CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
|
<CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
|
||||||
<Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
|
<Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
|
||||||
<Button Name="buttonDeleteAllPasA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasA_Click"/>
|
|
||||||
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" />
|
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" />
|
||||||
|
-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
@ -164,22 +163,22 @@
|
|||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textTransitPassenger}" Binding="{Binding PassengerInTransit}" IsReadOnly="True" Width="0.1*" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textTransitPassenger}" Binding="{Binding PassengerInTransit}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding PassengerPlaceOfBirth}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding PassengerPlaceOfBirth}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<!--<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />-->
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding PassengerDateOfBirth, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding PassengerDateOfBirth, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding PassengerIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding PassengerIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding PassengerIdentityDocumentId}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding PassengerIdentityDocumentId}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding PassengerIdentityDocumentIssuingState}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding PassengerIdentityDocumentIssuingState}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding PassengerIdentityDocumentExpiryDate, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding PassengerIdentityDocumentExpiryDate, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyCare}" Binding="{Binding EmergencyCare, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<!--<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyCare}" Binding="{Binding EmergencyCare, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />--> <!-- XXX : TODO -->
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyContactNumber}" Binding="{Binding EmergencyContactNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<!-- <DataGridTextColumn Header="{x:Static p:Resources.textEmergencyContactNumber}" Binding="{Binding EmergencyContactNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> -->
|
||||||
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<!-- XXX : TODO
|
||||||
<TabItem Header="{x:Static p:Resources.textPasDeparture}" Name="tabPassengerListDeparture">
|
<TabItem Header="{x:Static p:Resources.textPasDeparture}" Name="tabPassengerListDeparture">
|
||||||
<GroupBox Name="groupBoxPassengerListDeparture" Header="{x:Static p:Resources.textTabPassengerList}">
|
<GroupBox Name="groupBoxPassengerListDeparture" Header="{x:Static p:Resources.textTabPassengerList}">
|
||||||
<Grid>
|
<Grid>
|
||||||
@ -195,7 +194,6 @@
|
|||||||
<Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
<Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
|
||||||
<CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/>
|
<CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/>
|
||||||
<Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
|
<Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
|
||||||
<Button Name="buttonDeleteAllPasD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasD_Click"/>
|
|
||||||
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" />
|
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
@ -224,7 +222,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
-->
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|
||||||
</src:DetailBaseControl>
|
</src:DetailBaseControl>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -28,7 +28,6 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Name="textBlockMessageClass" FontWeight="DemiBold" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
<TextBlock Name="textBlockMessageClass" FontWeight="DemiBold" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||||
<Button Content="{x:Static p:Resources.textNewDGItem}" Name="buttonNewItem" Margin="2" Click="buttonNewItem_Click" Grid.Row="0" Grid.Column="1" />
|
|
||||||
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<Label Content="{x:Static p:Resources.textVesselClass}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textVesselClass}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<Label Content="{x:Static p:Resources.textDGManifestOnBoard}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textDGManifestOnBoard}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
@ -64,14 +63,13 @@
|
|||||||
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textControlTemperature}" Binding="{Binding ControlTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textControlTemperature}" Binding="{Binding ControlTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyTemperature}" Binding="{Binding EmergencyTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyTemperature}" Binding="{Binding EmergencyTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textMarinePollutant}" Binding="{Binding MarinePollutant}" IsReadOnly="True" Width="auto" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textMarinePollutant}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNumberOfPackages}" Binding="{Binding NumberOfPackages}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textNumberOfPackages}" Binding="{Binding NumberOfPackages}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textPackageType}" Binding="{Binding PackageType}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textPackageType}" Binding="{Binding PackageType}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textLimitedQuantity}" Binding="{Binding LimitedQuantities}" IsReadOnly="True" Width="auto" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textLimitedQuantity}" Binding="{Binding LimitedQuantities}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities}" IsReadOnly="True" Width="auto" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNetQuantity}" Binding="{Binding NetQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textNetQuantity}" Binding="{Binding NetQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textGrossQuantity}" Binding="{Binding GrossQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
<!--DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" /-->
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoVolume}" Binding="{Binding Volume_MTQ, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoVolume}" Binding="{Binding Volume_MTQ, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textGeneralCargo}" Binding="{Binding GeneralCargoIBC}" IsReadOnly="True" Width="auto" />
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textGeneralCargo}" Binding="{Binding GeneralCargoIBC}" IsReadOnly="True" Width="auto" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
|||||||
@ -22,19 +22,9 @@ namespace ENI2.DetailViewControls
|
|||||||
public partial class DangerousGoodsDetailControl : DetailBaseControl
|
public partial class DangerousGoodsDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
|
||||||
#region fields
|
private Message _hazMessage;
|
||||||
|
private HAZ haz;
|
||||||
private Message _hazaMessage;
|
private HAZ hazd; // referenz auf HAZD, falls das hier HAZA ist und wir Positionen kopieren wollen
|
||||||
private Message _hazdMessage;
|
|
||||||
|
|
||||||
private HAZ haza;
|
|
||||||
private HAZ hazd;
|
|
||||||
|
|
||||||
private NewDGItemDialog newDGDialog = null;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public DangerousGoodsDetailControl()
|
public DangerousGoodsDetailControl()
|
||||||
{
|
{
|
||||||
@ -42,8 +32,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.Loaded += DangerousGoodsDetailControl_Loaded;
|
this.Loaded += DangerousGoodsDetailControl_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private void DangerousGoodsDetailControl_Loaded(object sender, RoutedEventArgs e)
|
private void DangerousGoodsDetailControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
@ -52,9 +40,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Flag if this control is used for arrival or departure
|
|
||||||
/// </summary>
|
|
||||||
public bool IsDeparture { get; set; }
|
public bool IsDeparture { get; set; }
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@ -63,11 +48,21 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
foreach (Message aMessage in this.Messages)
|
foreach (Message aMessage in this.Messages)
|
||||||
{
|
{
|
||||||
|
if (IsDeparture)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) { this._hazMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA)
|
||||||
|
{
|
||||||
|
this._hazMessage = aMessage;
|
||||||
|
this.ControlMessages.Add(aMessage);
|
||||||
|
}
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD)
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD)
|
||||||
{
|
{
|
||||||
this._hazdMessage = aMessage;
|
if (aMessage != null)
|
||||||
this.ControlMessages.Add(aMessage);
|
{
|
||||||
if (aMessage.Elements.Count > 0)
|
if (aMessage.Elements.Count > 0)
|
||||||
this.hazd = aMessage.Elements[0] as HAZ;
|
this.hazd = aMessage.Elements[0] as HAZ;
|
||||||
if (this.hazd == null)
|
if (this.hazd == null)
|
||||||
@ -79,35 +74,41 @@ namespace ENI2.DetailViewControls
|
|||||||
aMessage.Elements.Add(this.hazd);
|
aMessage.Elements.Add(this.hazd);
|
||||||
SublistElementChanged(Message.NotificationClass.HAZD);
|
SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA)
|
|
||||||
{
|
|
||||||
this._hazaMessage = aMessage;
|
|
||||||
this.ControlMessages.Add(aMessage);
|
this.ControlMessages.Add(aMessage);
|
||||||
if (aMessage.Elements.Count > 0)
|
|
||||||
this.haza = aMessage.Elements[0] as HAZ;
|
|
||||||
if (this.haza == null)
|
|
||||||
{
|
|
||||||
this.haza = new HAZ();
|
|
||||||
this.haza.MessageCore = this.Core;
|
|
||||||
this.haza.MessageHeader = aMessage;
|
|
||||||
this.haza.IsDeparture = true;
|
|
||||||
aMessage.Elements.Add(this.haza);
|
|
||||||
SublistElementChanged(Message.NotificationClass.HAZA);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.textBlockMessageClass.Text = IsDeparture ? "HAZD" : "HAZA";
|
this.textBlockMessageClass.Text = IsDeparture ? "HAZD" : "HAZA";
|
||||||
}
|
}
|
||||||
|
|
||||||
#region HAZ
|
#region HAZ
|
||||||
|
|
||||||
|
if (this._hazMessage == null)
|
||||||
|
{
|
||||||
|
this._hazMessage = this.Core.CreateMessage(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.Messages.Add(this._hazMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
HAZ haz = null;
|
||||||
|
if (this._hazMessage.Elements.Count > 0)
|
||||||
|
haz = this._hazMessage.Elements[0] as HAZ;
|
||||||
|
if (haz == null)
|
||||||
|
{
|
||||||
|
haz = new HAZ();
|
||||||
|
haz.MessageCore = this.Core;
|
||||||
|
haz.MessageHeader = this._hazMessage;
|
||||||
|
haz.IsDeparture = this.IsDeparture;
|
||||||
|
_hazMessage.Elements.Add(haz);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.haz = haz;
|
||||||
|
|
||||||
this.comboBoxVesselClass.ItemsSource = GlobalStructures.vesselClasses;
|
this.comboBoxVesselClass.ItemsSource = GlobalStructures.vesselClasses;
|
||||||
|
|
||||||
this.groupBoxHAZ.DataContext = this.IsDeparture ? hazd : haza;
|
this.groupBoxHAZ.DataContext = haz;
|
||||||
|
|
||||||
this.dataGridIMDGItems.Initialize();
|
this.dataGridIMDGItems.Initialize();
|
||||||
this.dataGridIMDGItems.ItemsSource = this.IsDeparture ? this.hazd.IMDGPositions : this.haza.IMDGPositions;
|
this.dataGridIMDGItems.ItemsSource = this.haz.IMDGPositions;
|
||||||
CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMDGItems.Items);
|
CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMDGItems.Items);
|
||||||
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
this.dataGridIMDGItems.CreateRequested += DataGridIMDGItems_CreateRequested;
|
this.dataGridIMDGItems.CreateRequested += DataGridIMDGItems_CreateRequested;
|
||||||
@ -116,7 +117,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIMDGItems.DeleteRequested += DataGridIMDGItems_DeleteRequested;
|
this.dataGridIMDGItems.DeleteRequested += DataGridIMDGItems_DeleteRequested;
|
||||||
|
|
||||||
this.dataGridIBCItems.Initialize();
|
this.dataGridIBCItems.Initialize();
|
||||||
this.dataGridIBCItems.ItemsSource = this.IsDeparture ? this.hazd.IBCPositions : this.haza.IBCPositions;
|
this.dataGridIBCItems.ItemsSource = this.haz.IBCPositions;
|
||||||
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIBCItems.Items);
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIBCItems.Items);
|
||||||
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
this.dataGridIBCItems.CreateRequested += DataGridIBCItems_CreateRequested;
|
this.dataGridIBCItems.CreateRequested += DataGridIBCItems_CreateRequested;
|
||||||
@ -125,7 +126,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIBCItems.DeleteRequested += DataGridIBCItems_DeleteRequested;
|
this.dataGridIBCItems.DeleteRequested += DataGridIBCItems_DeleteRequested;
|
||||||
|
|
||||||
this.dataGridIGCItems.Initialize();
|
this.dataGridIGCItems.Initialize();
|
||||||
this.dataGridIGCItems.ItemsSource = this.IsDeparture ? this.hazd.IGCPositions : this.haza.IGCPositions;
|
this.dataGridIGCItems.ItemsSource = this.haz.IGCPositions;
|
||||||
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIGCItems.Items);
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIGCItems.Items);
|
||||||
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
this.dataGridIGCItems.CreateRequested += DataGridIGCItems_CreateRequested;
|
this.dataGridIGCItems.CreateRequested += DataGridIGCItems_CreateRequested;
|
||||||
@ -134,7 +135,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIGCItems.DeleteRequested += DataGridIGCItems_DeleteRequested;
|
this.dataGridIGCItems.DeleteRequested += DataGridIGCItems_DeleteRequested;
|
||||||
|
|
||||||
this.dataGridIMSBCItems.Initialize();
|
this.dataGridIMSBCItems.Initialize();
|
||||||
this.dataGridIMSBCItems.ItemsSource = this.IsDeparture ? this.hazd.IMSBCPositions : this.haza.IMSBCPositions;
|
this.dataGridIMSBCItems.ItemsSource = this.haz.IMSBCPositions;
|
||||||
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMSBCItems.Items);
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMSBCItems.Items);
|
||||||
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
this.dataGridIMSBCItems.CreateRequested += DataGridIMSBCItems_CreateRequested;
|
this.dataGridIMSBCItems.CreateRequested += DataGridIMSBCItems_CreateRequested;
|
||||||
@ -143,7 +144,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIMSBCItems.DeleteRequested += DataGridIMSBCItems_DeleteRequested;
|
this.dataGridIMSBCItems.DeleteRequested += DataGridIMSBCItems_DeleteRequested;
|
||||||
|
|
||||||
this.dataGridMARPOLItems.Initialize();
|
this.dataGridMARPOLItems.Initialize();
|
||||||
this.dataGridMARPOLItems.ItemsSource = this.IsDeparture ? this.hazd.MARPOLPositions : this.haza.MARPOLPositions;
|
this.dataGridMARPOLItems.ItemsSource = this.haz.MARPOLPositions;
|
||||||
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridMARPOLItems.Items);
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridMARPOLItems.Items);
|
||||||
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
this.dataGridMARPOLItems.CreateRequested += DataGridMARPOLItems_CreateRequested;
|
this.dataGridMARPOLItems.CreateRequested += DataGridMARPOLItems_CreateRequested;
|
||||||
@ -155,52 +156,50 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Extra Menüpunkte um Positionen zwischen HAZA / HAZD zu kopieren
|
if (!this.haz.IsDeparture)
|
||||||
|
{
|
||||||
|
#region Extra Menüpunkte um Positionen nach HAZD zu kopieren
|
||||||
|
|
||||||
this.dataGridIBCItems.ContextMenu.Items.Add(new Separator());
|
this.dataGridIBCItems.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyIBCItem = new MenuItem();
|
MenuItem copyIBCItem = new MenuItem();
|
||||||
copyIBCItem.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
copyIBCItem.Header = Properties.Resources.textCopyToHAZD;
|
||||||
copyIBCItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyIBCItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyIBCItem.Click += new RoutedEventHandler(this.copyIBC);
|
copyIBCItem.Click += new RoutedEventHandler(this.copyIBC);
|
||||||
this.dataGridIBCItems.ContextMenu.Items.Add(copyIBCItem);
|
this.dataGridIBCItems.ContextMenu.Items.Add(copyIBCItem);
|
||||||
|
|
||||||
this.dataGridIGCItems.ContextMenu.Items.Add(new Separator());
|
this.dataGridIGCItems.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyItemIGC = new MenuItem();
|
MenuItem copyItemIGC = new MenuItem();
|
||||||
copyItemIGC.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
copyItemIGC.Header = Properties.Resources.textCopyToHAZD;
|
||||||
copyItemIGC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyItemIGC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyItemIGC.Click += new RoutedEventHandler(this.copyIGC);
|
copyItemIGC.Click += new RoutedEventHandler(this.copyIGC);
|
||||||
this.dataGridIGCItems.ContextMenu.Items.Add(copyItemIGC);
|
this.dataGridIGCItems.ContextMenu.Items.Add(copyItemIGC);
|
||||||
|
|
||||||
this.dataGridIMDGItems.ContextMenu.Items.Add(new Separator());
|
this.dataGridIMDGItems.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyItemIMDG = new MenuItem();
|
MenuItem copyItemIMDG = new MenuItem();
|
||||||
copyItemIMDG.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
copyItemIMDG.Header = Properties.Resources.textCopyToHAZD;
|
||||||
copyItemIMDG.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyItemIMDG.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyItemIMDG.Click += new RoutedEventHandler(this.copyIMDG);
|
copyItemIMDG.Click += new RoutedEventHandler(this.copyIMDG);
|
||||||
this.dataGridIMDGItems.ContextMenu.Items.Add(copyItemIMDG);
|
this.dataGridIMDGItems.ContextMenu.Items.Add(copyItemIMDG);
|
||||||
|
|
||||||
this.dataGridIMSBCItems.ContextMenu.Items.Add(new Separator());
|
this.dataGridIMSBCItems.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyItemIMSBC = new MenuItem();
|
MenuItem copyItemIMSBC = new MenuItem();
|
||||||
copyItemIMSBC.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
copyItemIMSBC.Header = Properties.Resources.textCopyToHAZD;
|
||||||
copyItemIMSBC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyItemIMSBC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyItemIMSBC.Click += new RoutedEventHandler(this.copyIMSBC);
|
copyItemIMSBC.Click += new RoutedEventHandler(this.copyIMSBC);
|
||||||
this.dataGridIMSBCItems.ContextMenu.Items.Add(copyItemIMSBC);
|
this.dataGridIMSBCItems.ContextMenu.Items.Add(copyItemIMSBC);
|
||||||
|
|
||||||
this.dataGridMARPOLItems.ContextMenu.Items.Add(new Separator());
|
this.dataGridMARPOLItems.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyItemMARPOL = new MenuItem();
|
MenuItem copyItemMARPOL = new MenuItem();
|
||||||
copyItemMARPOL.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
copyItemMARPOL.Header = Properties.Resources.textCopyToHAZD;
|
||||||
copyItemMARPOL.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyItemMARPOL.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyItemMARPOL.Click += new RoutedEventHandler(this.copyMARPOL);
|
copyItemMARPOL.Click += new RoutedEventHandler(this.copyMARPOL);
|
||||||
this.dataGridMARPOLItems.ContextMenu.Items.Add(copyItemMARPOL);
|
this.dataGridMARPOLItems.ContextMenu.Items.Add(copyItemMARPOL);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
this._initialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int SelectedTabIndex
|
this._initialized = true;
|
||||||
{
|
|
||||||
get { return this.tabControlPositions.SelectedIndex; }
|
|
||||||
set { this.tabControlPositions.SelectedIndex = value; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region SetEnabled
|
#region SetEnabled
|
||||||
@ -227,18 +226,17 @@ namespace ENI2.DetailViewControls
|
|||||||
// aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren
|
// aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren
|
||||||
if (this.dataGridMARPOLItems.SelectedItems != null)
|
if (this.dataGridMARPOLItems.SelectedItems != null)
|
||||||
{
|
{
|
||||||
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
|
||||||
foreach (MARPOL_Annex_I_Position selectedMARPOL in this.dataGridMARPOLItems.SelectedItems)
|
foreach (MARPOL_Annex_I_Position selectedMARPOL in this.dataGridMARPOLItems.SelectedItems)
|
||||||
{
|
{
|
||||||
MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position();
|
MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position();
|
||||||
copyMARPOL.MessageHeader = target_haz.MessageHeader;
|
copyMARPOL.MessageHeader = this.hazd.MessageHeader;
|
||||||
copyMARPOL.HAZ = target_haz;
|
copyMARPOL.HAZ = this.hazd;
|
||||||
copyMARPOL.CopyFromMARPOL(selectedMARPOL);
|
copyMARPOL.CopyFromMARPOL(selectedMARPOL);
|
||||||
copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.MARPOLPositions, "MARPOL-");
|
copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.MARPOLPositions, "MARPOL-");
|
||||||
target_haz.MARPOLPositions.Add(copyMARPOL);
|
this.hazd.MARPOLPositions.Add(copyMARPOL);
|
||||||
target_haz.NoDPGOnBoardOnArrival = false;
|
this.SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
|
||||||
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
this.SetHAZGlobalFlags(this.hazd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,18 +246,17 @@ namespace ENI2.DetailViewControls
|
|||||||
// aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren
|
// aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren
|
||||||
if (this.dataGridIMSBCItems.SelectedItems != null)
|
if (this.dataGridIMSBCItems.SelectedItems != null)
|
||||||
{
|
{
|
||||||
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
|
||||||
foreach (IMSBCPosition selectedIMSBC in this.dataGridIMSBCItems.SelectedItems)
|
foreach (IMSBCPosition selectedIMSBC in this.dataGridIMSBCItems.SelectedItems)
|
||||||
{
|
{
|
||||||
IMSBCPosition copyIMSBC = new IMSBCPosition();
|
IMSBCPosition copyIMSBC = new IMSBCPosition();
|
||||||
copyIMSBC.MessageHeader = target_haz.MessageHeader;
|
copyIMSBC.MessageHeader = this.hazd.MessageHeader;
|
||||||
copyIMSBC.HAZ = target_haz;
|
copyIMSBC.HAZ = this.hazd;
|
||||||
copyIMSBC.CopyFromIMSBC(selectedIMSBC);
|
copyIMSBC.CopyFromIMSBC(selectedIMSBC);
|
||||||
copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IMSBCPositions, "IMSBC-");
|
copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMSBCPositions, "IMSBC-");
|
||||||
target_haz.IMSBCPositions.Add(copyIMSBC);
|
this.hazd.IMSBCPositions.Add(copyIMSBC);
|
||||||
target_haz.NoDPGOnBoardOnArrival = false;
|
this.SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
|
||||||
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
this.SetHAZGlobalFlags(this.hazd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,18 +266,17 @@ namespace ENI2.DetailViewControls
|
|||||||
// aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren
|
// aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren
|
||||||
if (this.dataGridIMDGItems.SelectedItems != null)
|
if (this.dataGridIMDGItems.SelectedItems != null)
|
||||||
{
|
{
|
||||||
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
|
||||||
foreach (IMDGPosition selectedIMDG in this.dataGridIMDGItems.SelectedItems)
|
foreach (IMDGPosition selectedIMDG in this.dataGridIMDGItems.SelectedItems)
|
||||||
{
|
{
|
||||||
IMDGPosition copyIMDG = new IMDGPosition();
|
IMDGPosition copyIMDG = new IMDGPosition();
|
||||||
copyIMDG.MessageHeader = target_haz.MessageHeader;
|
copyIMDG.MessageHeader = this.hazd.MessageHeader;
|
||||||
copyIMDG.HAZ = target_haz;
|
copyIMDG.HAZ = this.hazd;
|
||||||
copyIMDG.CopyFromIMDG(selectedIMDG);
|
copyIMDG.CopyFromIMDG(selectedIMDG);
|
||||||
copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IMDGPositions, "IMDG-");
|
copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMDGPositions, "IMDG-");
|
||||||
target_haz.IMDGPositions.Add(copyIMDG);
|
this.hazd.IMDGPositions.Add(copyIMDG);
|
||||||
target_haz.NoDPGOnBoardOnArrival = false;
|
this.SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
|
||||||
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
this.SetHAZGlobalFlags(this.hazd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,18 +286,17 @@ namespace ENI2.DetailViewControls
|
|||||||
// aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren
|
// aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren
|
||||||
if (this.dataGridIGCItems.SelectedItems != null)
|
if (this.dataGridIGCItems.SelectedItems != null)
|
||||||
{
|
{
|
||||||
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
|
||||||
foreach (IGCPosition selectedIGC in this.dataGridIGCItems.SelectedItems)
|
foreach (IGCPosition selectedIGC in this.dataGridIGCItems.SelectedItems)
|
||||||
{
|
{
|
||||||
IGCPosition copyIGC = new IGCPosition();
|
IGCPosition copyIGC = new IGCPosition();
|
||||||
copyIGC.MessageHeader = target_haz.MessageHeader;
|
copyIGC.MessageHeader = this.hazd.MessageHeader;
|
||||||
copyIGC.HAZ = target_haz;
|
copyIGC.HAZ = this.hazd;
|
||||||
copyIGC.CopyFromIGC(selectedIGC);
|
copyIGC.CopyFromIGC(selectedIGC);
|
||||||
copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IGCPositions, "IGC-");
|
copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IGCPositions, "IGC-");
|
||||||
target_haz.IGCPositions.Add(copyIGC);
|
this.hazd.IGCPositions.Add(copyIGC);
|
||||||
target_haz.NoDPGOnBoardOnArrival = false;
|
this.SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
|
||||||
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
this.SetHAZGlobalFlags(this.hazd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,20 +306,19 @@ namespace ENI2.DetailViewControls
|
|||||||
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
|
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
|
||||||
if (this.dataGridIBCItems.SelectedItems != null)
|
if (this.dataGridIBCItems.SelectedItems != null)
|
||||||
{
|
{
|
||||||
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
|
||||||
foreach (IBCPosition selectedIBC in this.dataGridIBCItems.SelectedItems)
|
foreach (IBCPosition selectedIBC in this.dataGridIBCItems.SelectedItems)
|
||||||
{
|
{
|
||||||
if (selectedIBC != null)
|
if (selectedIBC != null)
|
||||||
{
|
{
|
||||||
IBCPosition copyIBC = new IBCPosition();
|
IBCPosition copyIBC = new IBCPosition();
|
||||||
copyIBC.MessageHeader = target_haz.MessageHeader;
|
copyIBC.MessageHeader = this.hazd.MessageHeader;
|
||||||
copyIBC.HAZ = target_haz;
|
copyIBC.HAZ = this.hazd;
|
||||||
copyIBC.CopyFromIBC(selectedIBC);
|
copyIBC.CopyFromIBC(selectedIBC);
|
||||||
copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IBCPositions, "IBC-");
|
copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IBCPositions, "IBC-");
|
||||||
target_haz.IBCPositions.Add(copyIBC);
|
this.hazd.IBCPositions.Add(copyIBC);
|
||||||
target_haz.NoDPGOnBoardOnArrival = false;
|
this.SublistElementChanged(Message.NotificationClass.HAZD);
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
|
||||||
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
this.SetHAZGlobalFlags(this.hazd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -332,16 +326,39 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Beim Hinzufügen der allerersten Gefahrgutposition sollen die Flags vorbelegt werden
|
||||||
|
/// </summary>
|
||||||
|
void SetHAZGlobalFlags(HAZ theHAZ)
|
||||||
|
{
|
||||||
|
int totalCount = theHAZ.MARPOLPositions.Count + theHAZ.IMDGPositions.Count + theHAZ.IGCPositions.Count + theHAZ.IBCPositions.Count + theHAZ.IMSBCPositions.Count;
|
||||||
|
if(totalCount == 1)
|
||||||
|
{
|
||||||
|
if (theHAZ == this.haz)
|
||||||
|
{
|
||||||
|
if (!(this.checkBoxDangerousGoodsOnBoard.IsChecked ?? false)) this.checkBoxDangerousGoodsOnBoard.IsChecked = true;
|
||||||
|
// if (!(this.checkBoxDGManifestOnBoard.IsChecked ?? false)) this.checkBoxDGManifestOnBoard.IsChecked = true;
|
||||||
|
if (this.checkBoxMoUBaltic.IsChecked ?? true) this.checkBoxMoUBaltic.IsChecked = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
theHAZ.NoDPGOnBoardOnArrival = false;
|
||||||
|
// theHAZ.DPGManifestOnBoardOnArrival = true;
|
||||||
|
theHAZ.MOUBaltic = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region MARPOL datagrid handlers
|
#region MARPOL datagrid handlers
|
||||||
|
|
||||||
private void DataGridMARPOLItems_DeleteRequested(DatabaseEntity obj)
|
private void DataGridMARPOLItems_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
MARPOL_Annex_I_Position marpol = obj as MARPOL_Annex_I_Position;
|
||||||
if (obj is MARPOL_Annex_I_Position marpol)
|
if (marpol != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(marpol);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(marpol);
|
||||||
haz.MARPOLPositions.Remove(marpol);
|
this.haz.MARPOLPositions.Remove(marpol);
|
||||||
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.MARPOLPositions));
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.MARPOLPositions));
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
@ -352,7 +369,6 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
EditMarpolDialog eld = new EditMarpolDialog();
|
EditMarpolDialog eld = new EditMarpolDialog();
|
||||||
eld.MARPOL = obj as MARPOL_Annex_I_Position;
|
eld.MARPOL = obj as MARPOL_Annex_I_Position;
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
|
|
||||||
eld.AddClicked += () =>
|
eld.AddClicked += () =>
|
||||||
{
|
{
|
||||||
@ -362,9 +378,9 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
eld.MARPOL = new MARPOL_Annex_I_Position();
|
eld.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
eld.MARPOL.HAZ = haz;
|
eld.MARPOL.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (eld.ShowDialog() ?? false)
|
if (eld.ShowDialog() ?? false)
|
||||||
@ -384,11 +400,10 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridMARPOLItems_CreateRequested()
|
private void DataGridMARPOLItems_CreateRequested()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditMarpolDialog ebd = new EditMarpolDialog();
|
EditMarpolDialog ebd = new EditMarpolDialog();
|
||||||
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
|
||||||
ebd.MARPOL.HAZ = haz;
|
ebd.MARPOL.HAZ = this.haz;
|
||||||
|
|
||||||
ebd.AddClicked += () =>
|
ebd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
@ -397,10 +412,10 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.MARPOLPositions.Add(ebd.MARPOL);
|
haz.MARPOLPositions.Add(ebd.MARPOL);
|
||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
ebd.MARPOL.HAZ = haz;
|
ebd.MARPOL.HAZ = this.haz;
|
||||||
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ebd.ShowDialog() ?? false)
|
if (ebd.ShowDialog() ?? false)
|
||||||
@ -409,7 +424,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.MARPOLPositions.Add(ebd.MARPOL);
|
haz.MARPOLPositions.Add(ebd.MARPOL);
|
||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,12 +434,12 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMSBCItems_DeleteRequested(DatabaseEntity obj)
|
private void DataGridIMSBCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
IMSBCPosition imsbc = obj as IMSBCPosition;
|
||||||
if (obj is IMSBCPosition imsbc)
|
if (imsbc != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imsbc);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imsbc);
|
||||||
haz.IMSBCPositions.Remove(imsbc);
|
this.haz.IMSBCPositions.Remove(imsbc);
|
||||||
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMSBCPositions));
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMSBCPositions));
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
@ -433,7 +448,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMSBCItems_EditRequested(DatabaseEntity obj)
|
private void DataGridIMSBCItems_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIMSBCDialog eld = new EditIMSBCDialog();
|
EditIMSBCDialog eld = new EditIMSBCDialog();
|
||||||
eld.IMSBC = obj as IMSBCPosition;
|
eld.IMSBC = obj as IMSBCPosition;
|
||||||
|
|
||||||
@ -444,10 +458,10 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMSBCPositions.Add(eld.IMSBC);
|
haz.IMSBCPositions.Add(eld.IMSBC);
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
eld.IMSBC = new IMSBCPosition();
|
eld.IMSBC = new IMSBCPosition();
|
||||||
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
||||||
eld.IMSBC.HAZ = haz;
|
eld.IMSBC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (eld.ShowDialog() ?? false)
|
if (eld.ShowDialog() ?? false)
|
||||||
@ -466,23 +480,22 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMSBCItems_CreateRequested()
|
private void DataGridIMSBCItems_CreateRequested()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIMSBCDialog ebd = new EditIMSBCDialog();
|
EditIMSBCDialog ebd = new EditIMSBCDialog();
|
||||||
ebd.IMSBC = new IMSBCPosition();
|
ebd.IMSBC = new IMSBCPosition();
|
||||||
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
||||||
ebd.IMSBC.HAZ = haz;
|
ebd.IMSBC.HAZ = this.haz;
|
||||||
|
|
||||||
ebd.AddClicked += () =>
|
ebd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ebd.CopyValuesToEntity();
|
ebd.CopyValuesToEntity();
|
||||||
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
|
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
|
||||||
haz.IMSBCPositions.Add(ebd.IMSBC);
|
this.haz.IMSBCPositions.Add(ebd.IMSBC);
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
ebd.IMSBC = new IMSBCPosition();
|
ebd.IMSBC = new IMSBCPosition();
|
||||||
ebd.IMSBC.HAZ = haz;
|
ebd.IMSBC.HAZ = this.haz;
|
||||||
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ebd.ShowDialog() ?? false)
|
if (ebd.ShowDialog() ?? false)
|
||||||
@ -491,7 +504,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMSBCPositions.Add(ebd.IMSBC);
|
haz.IMSBCPositions.Add(ebd.IMSBC);
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,12 +514,12 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIGCItems_DeleteRequested(DatabaseEntity obj)
|
private void DataGridIGCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
IGCPosition igc = obj as IGCPosition;
|
||||||
if (obj is IGCPosition igc)
|
if (igc != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(igc);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(igc);
|
||||||
haz.IGCPositions.Remove(igc);
|
this.haz.IGCPositions.Remove(igc);
|
||||||
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IGCPositions));
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IGCPositions));
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
@ -515,7 +528,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIGCItems_EditRequested(DatabaseEntity obj)
|
private void DataGridIGCItems_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIGCDialog eld = new EditIGCDialog();
|
EditIGCDialog eld = new EditIGCDialog();
|
||||||
eld.IGC = obj as IGCPosition;
|
eld.IGC = obj as IGCPosition;
|
||||||
|
|
||||||
@ -526,10 +538,10 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IGCPositions.Add(eld.IGC);
|
haz.IGCPositions.Add(eld.IGC);
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
eld.IGC = new IGCPosition();
|
eld.IGC = new IGCPosition();
|
||||||
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
||||||
eld.IGC.HAZ = haz;
|
eld.IGC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (eld.ShowDialog() ?? false)
|
if (eld.ShowDialog() ?? false)
|
||||||
@ -548,31 +560,30 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIGCItems_CreateRequested()
|
private void DataGridIGCItems_CreateRequested()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIGCDialog ebd = new EditIGCDialog();
|
EditIGCDialog ebd = new EditIGCDialog();
|
||||||
ebd.IGC = new IGCPosition();
|
ebd.IGC = new IGCPosition();
|
||||||
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
||||||
ebd.IGC.HAZ = haz;
|
ebd.IGC.HAZ = this.haz;
|
||||||
|
|
||||||
ebd.AddClicked += () =>
|
ebd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ebd.CopyValuesToEntity();
|
ebd.CopyValuesToEntity();
|
||||||
if(!haz.IGCPositions.Contains(ebd.IGC))
|
if(!this.haz.IGCPositions.Contains(ebd.IGC))
|
||||||
haz.IGCPositions.Add(ebd.IGC);
|
this.haz.IGCPositions.Add(ebd.IGC);
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
ebd.IGC = new IGCPosition();
|
ebd.IGC = new IGCPosition();
|
||||||
ebd.IGC.HAZ = haz;
|
ebd.IGC.HAZ = this.haz;
|
||||||
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ebd.ShowDialog() ?? false)
|
if (ebd.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
if(!haz.IGCPositions.Contains(ebd.IGC))
|
if(!this.haz.IGCPositions.Contains(ebd.IGC))
|
||||||
haz.IGCPositions.Add(ebd.IGC);
|
haz.IGCPositions.Add(ebd.IGC);
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,12 +593,12 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIBCItems_DeleteRequested(DatabaseEntity obj)
|
private void DataGridIBCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
IBCPosition ibc = obj as IBCPosition;
|
||||||
if (obj is IBCPosition ibc)
|
if (ibc != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ibc);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ibc);
|
||||||
haz.IBCPositions.Remove(ibc);
|
this.haz.IBCPositions.Remove(ibc);
|
||||||
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IBCPositions));
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IBCPositions));
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
@ -596,7 +607,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIBCItems_EditRequested(DatabaseEntity obj)
|
private void DataGridIBCItems_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIBCDialog eld = new EditIBCDialog();
|
EditIBCDialog eld = new EditIBCDialog();
|
||||||
eld.IBC = obj as IBCPosition;
|
eld.IBC = obj as IBCPosition;
|
||||||
|
|
||||||
@ -607,10 +617,10 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IBCPositions.Add(eld.IBC);
|
haz.IBCPositions.Add(eld.IBC);
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
eld.IBC = new IBCPosition();
|
eld.IBC = new IBCPosition();
|
||||||
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
||||||
eld.IBC.HAZ = haz;
|
eld.IBC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (eld.ShowDialog() ?? false)
|
if (eld.ShowDialog() ?? false)
|
||||||
@ -629,31 +639,30 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIBCItems_CreateRequested()
|
private void DataGridIBCItems_CreateRequested()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIBCDialog ebd = new EditIBCDialog();
|
EditIBCDialog ebd = new EditIBCDialog();
|
||||||
ebd.IBC = new IBCPosition();
|
ebd.IBC = new IBCPosition();
|
||||||
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
||||||
ebd.IBC.HAZ = haz;
|
ebd.IBC.HAZ = this.haz;
|
||||||
|
|
||||||
ebd.AddClicked += () =>
|
ebd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ebd.CopyValuesToEntity();
|
ebd.CopyValuesToEntity();
|
||||||
if(!haz.IBCPositions.Contains(ebd.IBC))
|
if(!this.haz.IBCPositions.Contains(ebd.IBC))
|
||||||
haz.IBCPositions.Add(ebd.IBC);
|
this.haz.IBCPositions.Add(ebd.IBC);
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
ebd.IBC = new IBCPosition();
|
ebd.IBC = new IBCPosition();
|
||||||
ebd.IBC.HAZ = haz;
|
ebd.IBC.HAZ = this.haz;
|
||||||
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ebd.ShowDialog() ?? false)
|
if (ebd.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
if(!haz.IBCPositions.Contains(ebd.IBC))
|
if(!this.haz.IBCPositions.Contains(ebd.IBC))
|
||||||
haz.IBCPositions.Add(ebd.IBC);
|
haz.IBCPositions.Add(ebd.IBC);
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,12 +672,12 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMDGItems_DeleteRequested(DatabaseEntity obj)
|
private void DataGridIMDGItems_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
IMDGPosition imdg = obj as IMDGPosition;
|
||||||
if (obj is IMDGPosition imdg)
|
if (imdg != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imdg);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imdg);
|
||||||
haz.IMDGPositions.Remove(imdg);
|
this.haz.IMDGPositions.Remove(imdg);
|
||||||
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMDGPositions));
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMDGPositions));
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
@ -677,7 +686,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMDGItems_EditRequested(DatabaseEntity obj)
|
private void DataGridIMDGItems_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIMDGDialog eld = new EditIMDGDialog();
|
EditIMDGDialog eld = new EditIMDGDialog();
|
||||||
eld.IMDG = obj as IMDGPosition;
|
eld.IMDG = obj as IMDGPosition;
|
||||||
|
|
||||||
@ -688,8 +696,8 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMDGPositions.Add(eld.IMDG);
|
haz.IMDGPositions.Add(eld.IMDG);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
eld.IMDG = new IMDGPosition();
|
eld.IMDG = new IMDGPosition();
|
||||||
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
||||||
eld.IMDG.HAZ = haz;
|
eld.IMDG.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -699,7 +707,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMDGPositions.Add(eld.IMDG);
|
haz.IMDGPositions.Add(eld.IMDG);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,21 +718,20 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridIMDGItems_CreateRequested()
|
private void DataGridIMDGItems_CreateRequested()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
EditIMDGDialog ebd = new EditIMDGDialog();
|
EditIMDGDialog ebd = new EditIMDGDialog();
|
||||||
ebd.IMDG = new IMDGPosition();
|
ebd.IMDG = new IMDGPosition();
|
||||||
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
||||||
ebd.IMDG.HAZ = haz;
|
ebd.IMDG.HAZ = this.haz;
|
||||||
|
|
||||||
ebd.AddClicked += () =>
|
ebd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ebd.CopyValuesToEntity();
|
ebd.CopyValuesToEntity();
|
||||||
if(!haz.IMDGPositions.Contains(ebd.IMDG))
|
if(!this.haz.IMDGPositions.Contains(ebd.IMDG))
|
||||||
haz.IMDGPositions.Add(ebd.IMDG);
|
this.haz.IMDGPositions.Add(ebd.IMDG);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
ebd.IMDG = new IMDGPosition();
|
ebd.IMDG = new IMDGPosition();
|
||||||
ebd.IMDG.HAZ = haz;
|
ebd.IMDG.HAZ = this.haz;
|
||||||
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -734,7 +741,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMDGPositions.Add(ebd.IMDG);
|
haz.IMDGPositions.Add(ebd.IMDG);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
this.SetHAZGlobalFlags();
|
this.SetHAZGlobalFlags(this.haz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,24 +751,20 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
public override void HighlightErrorMessageContainer()
|
public override void HighlightErrorMessageContainer()
|
||||||
{
|
{
|
||||||
Message hazMessage = this.IsDeparture ? _hazdMessage : _hazaMessage;
|
if (this._hazMessage.HasErrors)
|
||||||
if (hazMessage.HasErrors)
|
|
||||||
{
|
{
|
||||||
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.ERROR, hazMessage);
|
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.ERROR, this._hazMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void HighlightViolationMessageContainer()
|
public override void HighlightViolationMessageContainer()
|
||||||
{
|
{
|
||||||
Message hazMessage = this.IsDeparture ? _hazdMessage : _hazaMessage;
|
if (this._hazMessage.HasViolations)
|
||||||
if (hazMessage.HasViolations)
|
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.VIOLATION, this._hazMessage);
|
||||||
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.VIOLATION, hazMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region handle tab header info
|
|
||||||
|
|
||||||
private void DangerousGoodsDetailControl_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void DangerousGoodsDetailControl_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.RefreshTabHeaders();
|
this.RefreshTabHeaders();
|
||||||
@ -769,144 +772,31 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void RefreshTabHeaders()
|
private void RefreshTabHeaders()
|
||||||
{
|
{
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
if (this.haz.IMDGPositions.Count > 0)
|
||||||
if (haz.IMDGPositions.Count > 0)
|
this.tabIMDGItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMDGItems, this.haz.IMDGPositions.Count);
|
||||||
this.tabIMDGItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMDGItems, haz.IMDGPositions.Count);
|
|
||||||
else
|
else
|
||||||
this.tabIMDGItems.Header = Properties.Resources.textIMDGItems;
|
this.tabIMDGItems.Header = Properties.Resources.textIMDGItems;
|
||||||
|
|
||||||
if (haz.IBCPositions.Count > 0)
|
if (this.haz.IBCPositions.Count > 0)
|
||||||
this.tabIBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIBCItems, haz.IBCPositions.Count);
|
this.tabIBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIBCItems, this.haz.IBCPositions.Count);
|
||||||
else
|
else
|
||||||
this.tabIBCItems.Header = Properties.Resources.textIBCItems;
|
this.tabIBCItems.Header = Properties.Resources.textIBCItems;
|
||||||
|
|
||||||
if (haz.IGCPositions.Count > 0)
|
if (this.haz.IGCPositions.Count > 0)
|
||||||
this.tabIGCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIGCItems, haz.IGCPositions.Count);
|
this.tabIGCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIGCItems, this.haz.IGCPositions.Count);
|
||||||
else
|
else
|
||||||
this.tabIGCItems.Header = Properties.Resources.textIGCItems;
|
this.tabIGCItems.Header = Properties.Resources.textIGCItems;
|
||||||
|
|
||||||
if (haz.IMSBCPositions.Count > 0)
|
if (this.haz.IMSBCPositions.Count > 0)
|
||||||
this.tabIMSBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMSBCItems, haz.IMSBCPositions.Count);
|
this.tabIMSBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMSBCItems, this.haz.IMSBCPositions.Count);
|
||||||
else
|
else
|
||||||
this.tabIMSBCItems.Header = Properties.Resources.textIMSBCItems;
|
this.tabIMSBCItems.Header = Properties.Resources.textIMSBCItems;
|
||||||
|
|
||||||
if (haz.MARPOLPositions.Count > 0)
|
if (this.haz.MARPOLPositions.Count > 0)
|
||||||
this.tabMarpolItems.Header = string.Format("{0} ({1})", Properties.Resources.textMARPOLItems, haz.MARPOLPositions.Count);
|
this.tabMarpolItems.Header = string.Format("{0} ({1})", Properties.Resources.textMARPOLItems, this.haz.MARPOLPositions.Count);
|
||||||
else
|
else
|
||||||
this.tabMarpolItems.Header = Properties.Resources.textMARPOLItems;
|
this.tabMarpolItems.Header = Properties.Resources.textMARPOLItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region new sublist item button handler
|
|
||||||
|
|
||||||
private void buttonNewItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (newDGDialog != null)
|
|
||||||
{
|
|
||||||
newDGDialog.Activate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newDGDialog = new NewDGItemDialog();
|
|
||||||
newDGDialog.Closed += NewDGDialog_Closed;
|
|
||||||
newDGDialog.OKClicked += NewDGDialog_OKClicked;
|
|
||||||
newDGDialog.AddClicked += NewDGDialog_OKClicked;
|
|
||||||
newDGDialog.Show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NewDGDialog_Closed(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
newDGDialog = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NewDGDialog_OKClicked()
|
|
||||||
{
|
|
||||||
HAZ haz = this.IsDeparture ? hazd : haza;
|
|
||||||
|
|
||||||
HAZPosTemplate selectedTemplate = this.newDGDialog.SelectedTemplate;
|
|
||||||
|
|
||||||
if (selectedTemplate != null)
|
|
||||||
{
|
|
||||||
// create new DG position based on template
|
|
||||||
switch (selectedTemplate.TemplateType)
|
|
||||||
{
|
|
||||||
case HAZPosTemplate.SublistType.IBC:
|
|
||||||
this.tabControlPositions.SelectedIndex = 1;
|
|
||||||
IBCPosition ibcPos = new IBCPosition();
|
|
||||||
ibcPos.FlashpointInformation = selectedTemplate.Flashpoint;
|
|
||||||
ibcPos.Flashpoint_CEL = selectedTemplate.FP_IBC;
|
|
||||||
ibcPos.SpecRef15_19 = selectedTemplate.SpecRef15_19;
|
|
||||||
ibcPos.Hazards = selectedTemplate.Hazard;
|
|
||||||
ibcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
|
||||||
ibcPos.PollutionCategory = selectedTemplate.PollutionCategory;
|
|
||||||
ibcPos.HAZ = haz;
|
|
||||||
haz.IBCPositions.Add(ibcPos);
|
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
|
||||||
this.DataGridIBCItems_EditRequested(ibcPos);
|
|
||||||
break;
|
|
||||||
case HAZPosTemplate.SublistType.IGC:
|
|
||||||
this.tabControlPositions.SelectedIndex = 2;
|
|
||||||
IGCPosition igcPos = new IGCPosition();
|
|
||||||
igcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
|
||||||
igcPos.UNNumber = selectedTemplate.UNNr;
|
|
||||||
igcPos.IMOClass = selectedTemplate.IMOClass;
|
|
||||||
igcPos.HAZ = haz;
|
|
||||||
haz.IGCPositions.Add(igcPos);
|
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
|
||||||
this.DataGridIGCItems_EditRequested(igcPos);
|
|
||||||
break;
|
|
||||||
case HAZPosTemplate.SublistType.IMSBC:
|
|
||||||
this.tabControlPositions.SelectedIndex = 3;
|
|
||||||
IMSBCPosition imsbcPos = new IMSBCPosition();
|
|
||||||
imsbcPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
|
||||||
imsbcPos.IMOHazardClass = selectedTemplate.IMSBC_HAZ;
|
|
||||||
imsbcPos.UNNumber = selectedTemplate.UNNr;
|
|
||||||
imsbcPos.IMOClass = selectedTemplate.IMOClass;
|
|
||||||
imsbcPos.MHB = selectedTemplate.MHB ?? false;
|
|
||||||
imsbcPos.HAZ = haz;
|
|
||||||
haz.IMSBCPositions.Add(imsbcPos);
|
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
|
||||||
this.DataGridIMSBCItems_EditRequested(imsbcPos);
|
|
||||||
break;
|
|
||||||
case HAZPosTemplate.SublistType.MARPOL:
|
|
||||||
this.tabControlPositions.SelectedIndex = 4;
|
|
||||||
MARPOL_Annex_I_Position marpolPos = new MARPOL_Annex_I_Position();
|
|
||||||
marpolPos.FlashpointInformation = selectedTemplate.Flashpoint;
|
|
||||||
marpolPos.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
|
||||||
marpolPos.HAZ = haz;
|
|
||||||
haz.MARPOLPositions.Add(marpolPos);
|
|
||||||
this.dataGridMARPOLItems.Items.Refresh();
|
|
||||||
this.DataGridMARPOLItems_EditRequested(marpolPos);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.SetHAZGlobalFlags();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region private methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Beim Hinzufügen der allerersten Gefahrgutposition sollen die Flags vorbelegt werden
|
|
||||||
/// </summary>
|
|
||||||
void SetHAZGlobalFlags()
|
|
||||||
{
|
|
||||||
HAZ haz = this.IsDeparture ? this.hazd : this.haza;
|
|
||||||
|
|
||||||
int totalCount = haz.MARPOLPositions.Count + haz.IMDGPositions.Count + haz.IGCPositions.Count + haz.IBCPositions.Count + haz.IMSBCPositions.Count;
|
|
||||||
if (totalCount == 1)
|
|
||||||
{
|
|
||||||
if (!(this.checkBoxDangerousGoodsOnBoard.IsChecked ?? false)) this.checkBoxDangerousGoodsOnBoard.IsChecked = true;
|
|
||||||
if (this.checkBoxMoUBaltic.IsChecked ?? true) this.checkBoxMoUBaltic.IsChecked = false;
|
|
||||||
haz.NoDPGOnBoardOnArrival = false;
|
|
||||||
haz.MOUBaltic = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,24 +70,8 @@
|
|||||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Width="0.2*">
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Binding="{Binding BunkerFuelType}" IsReadOnly="True" Width="0.2*" />
|
||||||
<DataGridTextColumn.Binding>
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" Binding="{Binding BunkerFuelQuantity_TNE, Mode=TwoWay}" IsReadOnly="True" Width="0.8*" />
|
||||||
<Binding Path="BunkerFuelType" Mode="TwoWay">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:StringValidationRule MaxLength="25" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" IsReadOnly="False" Width="0.8*">
|
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<Binding Path="BunkerFuelQuantity_TNE" Mode="TwoWay">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:NumberValidationRule MaxValue="10000" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|||||||
@ -9,7 +9,6 @@ using bsmd.database;
|
|||||||
using ENI2.EditControls;
|
using ENI2.EditControls;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -23,7 +22,6 @@ namespace ENI2.DetailViewControls
|
|||||||
private Message _tiefdMessage;
|
private Message _tiefdMessage;
|
||||||
private Message _pobdMessage;
|
private Message _pobdMessage;
|
||||||
private Message _bkrdMessage;
|
private Message _bkrdMessage;
|
||||||
private Message _brkaMessage;
|
|
||||||
bool startupComplete = false;
|
bool startupComplete = false;
|
||||||
|
|
||||||
public DepartureNotificationDetailControl()
|
public DepartureNotificationDetailControl()
|
||||||
@ -40,7 +38,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBD);
|
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBD);
|
||||||
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBD);
|
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBD);
|
||||||
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBD);
|
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBD);
|
||||||
this.dataGridBKRD.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.BKRD); };
|
|
||||||
startupComplete = true;
|
startupComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +51,6 @@ namespace ENI2.DetailViewControls
|
|||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) { this._tiefdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) { this._tiefdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBD) { this._pobdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBD) { this._pobdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._bkrdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._bkrdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRA) { this._brkaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ATD
|
#region ATD
|
||||||
@ -151,15 +147,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;
|
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;
|
||||||
this.dataGridBKRD.CreateRequested += DataGridBKRD_CreateRequested;
|
this.dataGridBKRD.CreateRequested += DataGridBKRD_CreateRequested;
|
||||||
|
|
||||||
// Extra Menüpunkt um alle Bunker Positionen nach BKRA zu kopieren
|
|
||||||
|
|
||||||
this.dataGridBKRD.ContextMenu.Items.Add(new Separator());
|
|
||||||
MenuItem copyBKRItem = new MenuItem();
|
|
||||||
copyBKRItem.Header = string.Format(Properties.Resources.textCopyTo, "BKRA");
|
|
||||||
copyBKRItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
|
||||||
copyBKRItem.Click += this.copyBKR;
|
|
||||||
this.dataGridBKRD.ContextMenu.Items.Add(copyBKRItem);
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -168,8 +155,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridBKRD_CreateRequested()
|
private void DataGridBKRD_CreateRequested()
|
||||||
{
|
{
|
||||||
this.dataGridBKRD.CancelEdit();
|
|
||||||
this.dataGridBKRD.CancelEdit();
|
|
||||||
EditBKRDialog ebd = new EditBKRDialog();
|
EditBKRDialog ebd = new EditBKRDialog();
|
||||||
ebd.IsDeparture = true;
|
ebd.IsDeparture = true;
|
||||||
ebd.BRKD = new BRKD();
|
ebd.BRKD = new BRKD();
|
||||||
@ -202,8 +187,6 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (obj is BRKD brkd)
|
if (obj is BRKD brkd)
|
||||||
{
|
{
|
||||||
this.dataGridBKRD.CancelEdit();
|
|
||||||
this.dataGridBKRD.CancelEdit();
|
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
this._bkrdMessage.Elements.Remove(brkd);
|
this._bkrdMessage.Elements.Remove(brkd);
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brkd);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brkd);
|
||||||
@ -215,8 +198,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridBKRD_EditRequested(DatabaseEntity obj)
|
private void DataGridBKRD_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
this.dataGridBKRD.CancelEdit(DataGridEditingUnit.Row);
|
|
||||||
this.dataGridBKRD.CommitEdit(DataGridEditingUnit.Row, true);
|
|
||||||
EditBKRDialog eld = new EditBKRDialog();
|
EditBKRDialog eld = new EditBKRDialog();
|
||||||
eld.IsDeparture = true;
|
eld.IsDeparture = true;
|
||||||
eld.BRKD = obj as BRKD;
|
eld.BRKD = obj as BRKD;
|
||||||
@ -237,8 +218,7 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (!_bkrdMessage.Elements.Contains(eld.BRKD))
|
if (!_bkrdMessage.Elements.Contains(eld.BRKD))
|
||||||
_bkrdMessage.Elements.Add(eld.BRKD);
|
_bkrdMessage.Elements.Add(eld.BRKD);
|
||||||
this.dataGridBKRD.ItemsSource = null;
|
this.dataGridBKRD.Items.Refresh();
|
||||||
this.dataGridBKRD.ItemsSource = this._bkrdMessage.Elements;
|
|
||||||
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,22 +228,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.DataGridBKRD_CreateRequested();
|
this.DataGridBKRD_CreateRequested();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyBKR(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.dataGridBKRD.SelectedItems != null)
|
|
||||||
{
|
|
||||||
foreach (BRKD brkd in this.dataGridBKRD.SelectedItems)
|
|
||||||
{
|
|
||||||
BRKA copyBRKA = new BRKA();
|
|
||||||
copyBRKA.MessageHeader = this._brkaMessage;
|
|
||||||
copyBRKA.CopyFromBKRD(brkd);
|
|
||||||
copyBRKA.Identifier = DatabaseEntity.GetNewIdentifier(this._brkaMessage.Elements);
|
|
||||||
this._brkaMessage.Elements.Add(copyBRKA);
|
|
||||||
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Highlighting
|
#region Highlighting
|
||||||
@ -300,6 +264,17 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region special datetimepicker validation popup (OMG)
|
#region special datetimepicker validation popup (OMG)
|
||||||
|
|
||||||
private void dateTimePickerATD_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
private void dateTimePickerATD_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:util="clr-namespace:ENI2.Util"
|
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="600" d:DesignWidth="1024">
|
d:DesignHeight="600" d:DesignWidth="1024">
|
||||||
@ -80,7 +79,7 @@
|
|||||||
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding StowawaysJoiningLocationText}" Margin="2" VerticalContentAlignment="Top"/>
|
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding StowawaysJoiningLocationText}" Margin="2" VerticalContentAlignment="Top"/>
|
||||||
<CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center"/>
|
<CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
<CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
<CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue, Converter={util:TrimStringConverter}}" Margin="2" />
|
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" />
|
||||||
<DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding DateOfIssue, Mode=TwoWay}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding DateOfIssue, Mode=TwoWay}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
|||||||
@ -2,16 +2,18 @@
|
|||||||
// Description: MDH Meldung Bearbeitungsseite
|
// Description: MDH Meldung Bearbeitungsseite
|
||||||
//
|
//
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ClosedXML.Excel;
|
|
||||||
using ENI2.EditControls;
|
|
||||||
using ENI2.Util;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using bsmd.database;
|
||||||
|
|
||||||
|
using ExcelDataReader;
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -128,12 +130,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int SelectedTabIndex
|
|
||||||
{
|
|
||||||
get { return this.mainFrame.SelectedIndex; }
|
|
||||||
set { this.mainFrame.SelectedIndex = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#region SetEnabled
|
#region SetEnabled
|
||||||
|
|
||||||
public override void SetEnabled(bool enabled)
|
public override void SetEnabled(bool enabled)
|
||||||
@ -281,18 +277,89 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void ButtonImportFromExcel_Click(object sender, RoutedEventArgs e)
|
private void ButtonImportFromExcel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int cnt = Excel.ExcelLocalImportHelper.ImportLast30Days(this._mdh);
|
OpenFileDialog ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Filter = "Excel Files|*.xls;*.xlsx"
|
||||||
|
};
|
||||||
|
if (ofd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
FileStream stream;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cnt > 0)
|
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<PortOfCallLast30Days> importPoC30 = new List<PortOfCallLast30Days>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (reader.FieldCount < 3)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have at least 3 Columns of data");
|
||||||
|
}
|
||||||
|
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) poc30.PortOfCallLast30DaysLocode = reader.GetString(0);
|
||||||
|
if (!reader.IsDBNull(1)) poc30.PortOfCallLast30DaysDateOfDeparture = reader.GetDateTime(1);
|
||||||
|
string boolString = "";
|
||||||
|
if (!reader.IsDBNull(2)) boolString = reader.GetString(2);
|
||||||
|
poc30.PortOfCallLast30DaysCrewMembersJoined = (boolString.Equals("y", StringComparison.OrdinalIgnoreCase) || (boolString.Equals("yes", StringComparison.OrdinalIgnoreCase)) ||
|
||||||
|
(boolString.Equals("j", StringComparison.OrdinalIgnoreCase)));
|
||||||
|
|
||||||
|
if(reader.FieldCount > 3)
|
||||||
|
{
|
||||||
|
string allNewCrew = reader.GetString(3)?.Trim();
|
||||||
|
if(!allNewCrew.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
string[] crewNames = allNewCrew.Split(',', ';');
|
||||||
|
for(int i=0;i<crewNames.Length;i++)
|
||||||
|
{
|
||||||
|
string crewName = crewNames[i].Trim();
|
||||||
|
if (crewName.IsNullOrEmpty()) continue;
|
||||||
|
PortOfCallLast30DaysCrewJoinedShip poc30Crew = new PortOfCallLast30DaysCrewJoinedShip();
|
||||||
|
poc30Crew.PortOfCallLast30DaysCrewJoinedShipName = crewName;
|
||||||
|
poc30Crew.PortOfCallLast30Days = poc30;
|
||||||
|
poc30.CrewJoinedShip.Add(poc30Crew);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
poc30.MDH = this._mdh;
|
||||||
|
this._mdh.PortOfCallLast30Days.Add(poc30);
|
||||||
|
importPoC30.Add(poc30);
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importPoC30.Count > 0)
|
||||||
{
|
{
|
||||||
this.dataGridPortOfCallLast30Days.Items.Refresh();
|
this.dataGridPortOfCallLast30Days.Items.Refresh();
|
||||||
this.SublistElementChanged(Message.NotificationClass.MDH);
|
this.SublistElementChanged(Message.NotificationClass.MDH);
|
||||||
MessageBox.Show(String.Format(Properties.Resources.textPoC30Imported, cnt),
|
MessageBox.Show(String.Format(Properties.Resources.textPoC30Imported, importPoC30.Count), Properties.Resources.textCaptionInformation,
|
||||||
Properties.Resources.textCaptionInformation,
|
|
||||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SanitaryMeasures Grid
|
#region SanitaryMeasures Grid
|
||||||
@ -536,5 +603,16 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,10 +8,9 @@
|
|||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:util="clr-namespace:ENI2.Util"
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
xmlns:data="clr-namespace:bsmd.database;assembly=bsmd.database"
|
|
||||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="768" d:DesignWidth="1024">
|
d:DesignHeight="300" d:DesignWidth="800">
|
||||||
<xctk:BusyIndicator Name="busyIndicator">
|
<xctk:BusyIndicator Name="busyIndicator">
|
||||||
<xctk:BusyIndicator.ProgressBarStyle>
|
<xctk:BusyIndicator.ProgressBarStyle>
|
||||||
<Style TargetType="ProgressBar">
|
<Style TargetType="ProgressBar">
|
||||||
@ -26,85 +25,75 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</xctk:BusyIndicator.BusyContent>
|
</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">
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
|
||||||
<Grid>
|
<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>
|
<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="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
|
|
||||||
<RowDefinition Height="4" />
|
<RowDefinition Height="4" />
|
||||||
<RowDefinition Height="36" />
|
<RowDefinition Height="32" />
|
||||||
|
<RowDefinition Height="32" />
|
||||||
<RowDefinition Height="4" />
|
<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="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</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}" 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}" 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}" 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" />
|
<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" />
|
||||||
<TextBox Name="textBoxDisplayId" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" IsReadOnly="True" Margin="2" VerticalContentAlignment="Center" />
|
<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}"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" Margin="0,0,10,0"/>
|
<Button IsEnabled="True" Name="buttonSendPDF" Grid.Column="3" Grid.Row="6" Margin="2" Click="buttonSendPDF_Click">
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" IsEnabled="False" />
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{x:Static p:Resources.textCreatePDF}"></TextBlock>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" Margin="0,0,10,0" />
|
<Image Source="../Resources/document_pdf.png" Margin="10,0,5,0" Height="16"/>
|
||||||
<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"/>
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textENI}" Margin="0,0,10,0" />
|
<Button Name="buttonQueryHIS" Grid.Column="4" Grid.Row="6" Margin="2" Click="buttonQueryHIS_Click" Content="{x:Static p:Resources.textQueryHIS}"/>
|
||||||
<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"/>
|
<StackPanel Orientation="Horizontal" Grid.Column="5" Grid.Row="6">
|
||||||
|
|
||||||
<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">
|
|
||||||
<Button Name="buttonRefresh" Margin="2" Click="buttonRefresh_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipRefresh}">
|
<Button Name="buttonRefresh" Margin="2" Click="buttonRefresh_Click" BorderThickness="0" Background="Transparent" ToolTip="{x:Static p:Resources.textTooltipRefresh}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Image Source="../Resources/nav_refresh_blue.png" Margin="0,0,5,0" Height="24"/>
|
<Image Source="../Resources/nav_refresh_blue.png" Margin="0,0,5,0" Height="24"/>
|
||||||
@ -124,45 +113,15 @@
|
|||||||
</Button>
|
</Button>
|
||||||
-->
|
-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="11" Visibility="Hidden" Name="stackPanelLock">
|
<Label Grid.Column="0" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelCancelled" VerticalContentAlignment="Center" FontWeight="Bold" />
|
||||||
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
|
<Label Grid.Column="1" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelHIS" VerticalContentAlignment="Center" Content="{x:Static p:Resources.textSendToHIS}" />
|
||||||
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
|
<ComboBox Grid.Column="2" Grid.Row="7" Margin="2" Name="comboBoxInitialHis" VerticalContentAlignment="Center" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding Path=InitialHIS}" />
|
||||||
</StackPanel>
|
<Button Grid.Column="3" Grid.Row="7" Margin="2" Name="buttonExcelImport" Click="buttonExcelImport_Click">
|
||||||
|
|
||||||
<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">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{x:Static p:Resources.textExcelImport}"></TextBlock>
|
<TextBlock Text="{x:Static p:Resources.textExcelImport}"></TextBlock>
|
||||||
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
|
<Image Source="../Resources/excel.png" Margin="10,0,5,0" Height="16"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</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">
|
<Button Grid.Column="4" Grid.Row="7" Margin="2" Name="buttonExcelExport" Click="buttonExcelExport_Click">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@ -171,64 +130,14 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</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 -->
|
<!-- Data Grid -->
|
||||||
<DataGrid Grid.Row="0" Grid.ColumnSpan="1" Grid.Column="1" Margin="2" x:Name="dataGridMessages" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" CanUserAddRows="False"
|
<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">
|
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 shared‐size 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>
|
|
||||||
|
|
||||||
<!-- Row 0: A single big header across all columns -->
|
|
||||||
<!--TextBlock Grid.Row="0" Grid.ColumnSpan="4" Text="Main Application" HorizontalAlignment="Center" FontWeight="Bold"/ -->
|
|
||||||
|
|
||||||
<!-- Row 1: 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"/>
|
|
||||||
|
|
||||||
<!-- Row 2: 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.RowStyle>
|
<DataGrid.RowStyle>
|
||||||
<Style TargetType="DataGridRow">
|
<Style TargetType="DataGridRow">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@ -238,54 +147,25 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="LightYellow" />
|
<Setter Property="Background" Value="LightYellow" />
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<MultiDataTrigger>
|
|
||||||
<MultiDataTrigger.Conditions>
|
|
||||||
<Condition Binding="{Binding Path=Elements, Converter={util:CutoffConverter}, ConverterParameter=0}" Value="True" />
|
|
||||||
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PASA}" />
|
|
||||||
</MultiDataTrigger.Conditions>
|
|
||||||
<Setter Property="Background" Value="Yellow" />
|
|
||||||
</MultiDataTrigger>
|
|
||||||
<MultiDataTrigger>
|
|
||||||
<MultiDataTrigger.Conditions>
|
|
||||||
<Condition Binding="{Binding Path=Elements, Converter={util:CutoffConverter}, ConverterParameter=0}" Value="True" />
|
|
||||||
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PASD}" />
|
|
||||||
</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.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.RowStyle>
|
</DataGrid.RowStyle>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
|
||||||
<DataGridTemplateColumn Header=" " Width="SizeToCells" IsReadOnly="True">
|
<DataGridTemplateColumn Header=" " Width="SizeToCells" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<!--Image Source="{Binding src:Util.ImageDict[ENINotificationDetailGroup]}" /-->
|
<!--Image Source="{Binding src:Util.ImageDict[ENINotificationDetailGroup]}" /-->
|
||||||
<!--Image Source="{Binding Source={x:Static src:Util.ImageDict}, Path=[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>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}" IsReadOnly="True" Width="0.1*" FontWeight="Bold">
|
<!--
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationGroup}" Binding="{Binding ENINotificationDetailGroup}" IsReadOnly="True" Width="0.25*" />
|
||||||
|
-->
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}"
|
||||||
|
IsReadOnly="True" Width="0.075*" FontWeight="Bold">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="TextBlock">
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
@ -293,75 +173,6 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</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 Header="" Width="SizeToCells" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@ -434,7 +245,6 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
||||||
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
|
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@ -447,7 +257,41 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</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 Header="{x:Static p:Resources.textStatusInfo}" Binding="{Binding StatusInfo}" IsReadOnly="True" Width="0.2*">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="TextBlock">
|
||||||
@ -455,7 +299,13 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</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.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -19,10 +19,6 @@ using System.Collections.Generic;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.ComponentModel;
|
|
||||||
using static bsmd.database.Message;
|
|
||||||
using PdfSharp.Fonts;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -31,9 +27,6 @@ namespace ENI2.DetailViewControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class OverViewDetailControl : DetailBaseControl
|
public partial class OverViewDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
private Message _message = null;
|
private Message _message = null;
|
||||||
private Message _ataMessage;
|
private Message _ataMessage;
|
||||||
private Message _atdMessage;
|
private Message _atdMessage;
|
||||||
@ -43,29 +36,21 @@ namespace ENI2.DetailViewControls
|
|||||||
private readonly object _collectionLock = new object();
|
private readonly object _collectionLock = new object();
|
||||||
// private MessageSendStatusDialog mssd = null;
|
// private MessageSendStatusDialog mssd = null;
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public OverViewDetailControl()
|
public OverViewDetailControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Loaded += OverViewDetailControl_Loaded;
|
this.Loaded += OverViewDetailControl_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Initialize
|
|
||||||
|
|
||||||
private void OverViewDetailControl_Loaded(object sender, RoutedEventArgs e)
|
private void OverViewDetailControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// die Controls nach Änderungen monitoren
|
// die Controls nach Änderungen monitoren
|
||||||
// diese Einträge gehen auf core
|
// diese Einträge gehen auf core
|
||||||
this.textBoxTicketNo.TextChanged += CoreTextBox_TextChanged;
|
this.RegisterTextboxChange(this.textBoxTicketNo, Message.NotificationClass.ATA);
|
||||||
this.textBoxDisplayId.TextChanged += CoreTextBox_TextChanged;
|
this.RegisterTextboxChange(this.textBoxDisplayId, Message.NotificationClass.ATA);
|
||||||
this.textBoxIMO.TextChanged += CoreTextBox_TextChanged;
|
this.RegisterTextboxChange(this.textBoxIMO, Message.NotificationClass.ATA);
|
||||||
this.textBoxENI.TextChanged += CoreTextBox_TextChanged;
|
this.RegisterTextboxChange(this.textBoxENI, Message.NotificationClass.ATA);
|
||||||
this.locodePoC.PropertyChanged += CoreLocode_LocodeChanged;
|
this.RegisterLocodeChange(this.locodePoC, Message.NotificationClass.ATA);
|
||||||
|
|
||||||
this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA);
|
this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA);
|
||||||
this.RegisterDateTimePickerChange(this.dateTimePickerATD, Message.NotificationClass.ATD);
|
this.RegisterDateTimePickerChange(this.dateTimePickerATD, Message.NotificationClass.ATD);
|
||||||
@ -73,19 +58,19 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterDateTimePickerChange(this.dateTimePickerETD, Message.NotificationClass.NOA_NOD);
|
this.RegisterDateTimePickerChange(this.dateTimePickerETD, Message.NotificationClass.NOA_NOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Initialize
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
bool iAmAdmin = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsAdmin;
|
|
||||||
|
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
Message.NotificationClass notificationClass = this.Core.IsTransit ? Message.NotificationClass.TRANSIT : Message.NotificationClass.VISIT;
|
Message.NotificationClass notificationClass = this.Core.IsTransit ? Message.NotificationClass.TRANSIT : Message.NotificationClass.VISIT;
|
||||||
if (this.Messages == null) return;
|
if (this.Messages == null) return;
|
||||||
if (this.Core == null) return;
|
if (this.Core == null) return;
|
||||||
|
|
||||||
this.textBoxENI.IsReadOnly = !iAmAdmin;
|
this.textBoxENI.IsReadOnly = false;
|
||||||
this.textBoxIMO.IsReadOnly = !iAmAdmin;
|
this.textBoxIMO.IsReadOnly = false;
|
||||||
this.locodePoC.IsEnabled = iAmAdmin;
|
this.locodePoC.IsEnabled = true;
|
||||||
this.textBoxDisplayId.IsReadOnly = !iAmAdmin;
|
this.textBoxDisplayId.IsReadOnly = false;
|
||||||
|
|
||||||
this.textBoxENI.DataContext = this.Core;
|
this.textBoxENI.DataContext = this.Core;
|
||||||
this.textBoxIMO.DataContext = this.Core;
|
this.textBoxIMO.DataContext = this.Core;
|
||||||
@ -199,6 +184,12 @@ namespace ENI2.DetailViewControls
|
|||||||
pasdMessage = aMessage;
|
pasdMessage = aMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX : TODO remove this
|
||||||
|
|
||||||
|
this.Messages.Remove(crewdMessage);
|
||||||
|
this.Messages.Remove(pasdMessage);
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region init ATA
|
#region init ATA
|
||||||
@ -318,8 +309,6 @@ namespace ENI2.DetailViewControls
|
|||||||
BindingOperations.EnableCollectionSynchronization(this.Messages, _collectionLock);
|
BindingOperations.EnableCollectionSynchronization(this.Messages, _collectionLock);
|
||||||
this.dataGridMessages.ItemsSource = this.Messages;
|
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
|
base.Initialize(); // wenn Meldeklassen erst bei der Init. erzeugt werden, fehlen die Handler, die hier erneut festgelegt werden
|
||||||
this._initialized = true;
|
this._initialized = true;
|
||||||
}
|
}
|
||||||
@ -357,9 +346,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
this.buttonExcelImport.IsEnabled = !this.Core.DisplayId.IsNullOrEmpty();
|
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));
|
//MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
|
||||||
//ShowIdDialog sid = new ShowIdDialog(this.Core)
|
//ShowIdDialog sid = new ShowIdDialog(this.Core)
|
||||||
//{
|
//{
|
||||||
@ -370,11 +356,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.Core.IsDirty = false; // ist ja schon gespeichert..
|
this.Core.IsDirty = false; // ist ja schon gespeichert..
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RefreshMessageGrid()
|
|
||||||
{
|
|
||||||
this.dataGridMessages?.Items?.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region private methods
|
#region private methods
|
||||||
@ -441,28 +422,21 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmSend, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmSend, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
if (result == MessageBoxResult.Yes)
|
if (result == MessageBoxResult.Yes)
|
||||||
{
|
|
||||||
this.SendMessages(this.dataGridMessages.SelectedItems.Cast<Message>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SendMessages(IEnumerable<Message> messages)
|
|
||||||
{
|
{
|
||||||
bool somethingsNotSaved = false;
|
bool somethingsNotSaved = false;
|
||||||
|
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
|
||||||
foreach (Message selectedMessage in messages)
|
|
||||||
{
|
{
|
||||||
if (selectedMessage.IsDirty) somethingsNotSaved = true;
|
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)
|
if (MessageBox.Show(Properties.Resources.textUnsavedChangesSendAnyWay, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Message> watchList = new List<Message>();
|
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
|
if (selectedMessage.Reset) selectedMessage.Reset = false; // "nochmal" Versenden ist möglich
|
||||||
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
|
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
|
||||||
@ -485,6 +459,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.OnRequestSendValidation();
|
this.OnRequestSendValidation();
|
||||||
this.dataGridMessages.Items.Refresh();
|
this.dataGridMessages.Items.Refresh();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (this.mssd == null)
|
if (this.mssd == null)
|
||||||
{
|
{
|
||||||
@ -506,6 +481,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.mssd.AddMessages(watchList);
|
this.mssd.AddMessages(watchList);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void contextResetMessage(object sender, RoutedEventArgs e)
|
private void contextResetMessage(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
@ -592,12 +568,6 @@ namespace ENI2.DetailViewControls
|
|||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
ReportManager rm = new ReportManager();
|
ReportManager rm = new ReportManager();
|
||||||
|
|
||||||
// TODO!!
|
|
||||||
// https://docs.pdfsharp.net/PDFsharp/Topics/Fonts/Font-Resolving.html
|
|
||||||
// https://docs.pdfsharp.net/MigraDoc/DOM/Document/MigraDocSettings.html
|
|
||||||
GlobalFontSettings.UseWindowsFontsUnderWindows = true;
|
|
||||||
GlobalFontSettings.UseWindowsFontsUnderWsl2 = true;
|
|
||||||
|
|
||||||
// create PDF from message classes
|
// create PDF from message classes
|
||||||
if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText))
|
if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText))
|
||||||
{
|
{
|
||||||
@ -638,16 +608,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#region event handler
|
#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)
|
private void _checkStatusTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
bool? statusFlag = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreQueryStatusFlag(this.Core.Id.Value);
|
bool? statusFlag = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreQueryStatusFlag(this.Core.Id.Value);
|
||||||
@ -756,7 +716,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void buttonValidate_Click(object sender, RoutedEventArgs e)
|
private void buttonValidate_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.OnRequestValidate(true);
|
this.OnRequestValidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -786,7 +746,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.OnRequestReload(this.Core.Id.Value);
|
this.OnRequestReload(this.Core.Id.Value);
|
||||||
|
|
||||||
// validate all selected import classes (Finger with "selection")
|
// validate all selected import classes (Finger with "selection")
|
||||||
this.OnRequestValidate(true);
|
this.OnRequestValidate();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -825,6 +785,7 @@ namespace ENI2.DetailViewControls
|
|||||||
if (sfd.ShowDialog() ?? false)
|
if (sfd.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
|
|
||||||
ExcelManager em = new ExcelManager();
|
ExcelManager em = new ExcelManager();
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -840,71 +801,15 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonSendAll_Click(object sender, RoutedEventArgs e)
|
#endregion
|
||||||
{
|
|
||||||
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
|
#region mouse wheel
|
||||||
bool addToSend;
|
|
||||||
foreach (Message message in this.Messages)
|
|
||||||
{
|
|
||||||
addToSend = true;
|
|
||||||
|
|
||||||
// if ((message.ErrorCount ?? 0) > 0) continue; // skip selection if there are any errors left
|
private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||||
|
|
||||||
switch(message.MessageNotificationClass)
|
|
||||||
{
|
{
|
||||||
case NotificationClass.HAZA:
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
addToSend = XtraSendLogic.ShouldSendMessage(message); break;
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
case NotificationClass.HAZD:
|
e.Handled = true;
|
||||||
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
|
#endregion
|
||||||
|
|||||||
@ -38,13 +38,13 @@
|
|||||||
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
<Label Content="{x:Static p:Resources.textTankerNatureOfCargo}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textTankerNatureOfCargo}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" VerticalContentAlignment="Center" MaxLength="99" />
|
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" VerticalContentAlignment="Center" MaxLength="99" />
|
||||||
<Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N3" Value="{Binding VolumeOfCargo, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" TextAlignment="Left"/>
|
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N3" Value="{Binding VolumeOfCargo, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" TextAlignment="Left"/>
|
||||||
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" VerticalContentAlignment="Center" MaxLength="99"/>
|
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" VerticalContentAlignment="Center" MaxLength="99"/>
|
||||||
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="6" Margin="2,2,2,2" MaxLength="255" />
|
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="6" Margin="2,2,2,2" MaxLength="255" />
|
||||||
<Label Content="{x:Static p:Resources.textLastExpandedInspection }" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
<Label Content="{x:Static p:Resources.textLastExpandedInspection }" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
<DatePicker Grid.Column="1" Grid.Row="7" Name="datePickerLastExpandedInspection" VerticalAlignment="Center" SelectedDate="{Binding DateOfLastExpandedInspection, Mode=TwoWay}" Margin="2,2,2,2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Column="1" Grid.Row="7" Name="datePickerLastExpandedInspection" VerticalAlignment="Center" SelectedDate="{Binding DateOfLastExpandedInspection, Mode=TwoWay}" Margin="2,2,2,2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
|
|||||||
@ -18,13 +18,13 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private Message _pre72hMessage;
|
private Message _pre72hMessage;
|
||||||
|
|
||||||
private static readonly string[] hullConfiguration = {
|
private static string[] hullConfiguration = {
|
||||||
Properties.Resources.textSingleHull,
|
Properties.Resources.textSingleHull,
|
||||||
Properties.Resources.textSingleHullBallast,
|
Properties.Resources.textSingleHullBallast,
|
||||||
Properties.Resources.textDoubleHull
|
Properties.Resources.textDoubleHull
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly string[] conditionCargoTanks =
|
private static string[] conditionCargoTanks =
|
||||||
{
|
{
|
||||||
Properties.Resources.textFull,
|
Properties.Resources.textFull,
|
||||||
Properties.Resources.textEmpty,
|
Properties.Resources.textEmpty,
|
||||||
@ -118,6 +118,17 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="600" d:DesignWidth="800">
|
d:DesignHeight="600" d:DesignWidth="800">
|
||||||
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}">
|
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}">
|
||||||
<ScrollViewer>
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="300" />
|
<RowDefinition Height="300" />
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}" LocodeSource="SSN" />
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}"/>
|
||||||
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" />
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
<xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
@ -92,24 +92,22 @@
|
|||||||
<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="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="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="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.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.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="3" Grid.Column="0" Content="{x:Static p:Resources.textCountry}" Name="label_AgentCountry" 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="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" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textTitle}" Name="labelAgentTemplateTitle" Margin="0,0,10,0" Visibility="Hidden" />
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="99" Margin="2" Text="{Binding AgentCompanyName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="99" Margin="2" Text="{Binding AgentCompanyName}" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="99" Margin="2" Text="{Binding AgentStreetAndNumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="99" Margin="2" Text="{Binding AgentStreetAndNumber}" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="99" Margin="2" Text="{Binding AgentPostalCode, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="99" Margin="2" Text="{Binding AgentPostalCode}" VerticalContentAlignment="Center"/>
|
||||||
<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="3" Name="textBox_AgentCity" MaxLength="99" Margin="2" Text="{Binding AgentCity}" 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="3" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="99" Margin="2" Text="{Binding AgentCountry}" 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="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName}" 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}" 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="1" Name="textBox_AgentPhone" MaxLength="99" Margin="2" Text="{Binding AgentPhone}" 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}" 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="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail}" 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" />
|
<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">
|
<Grid Grid.Column="2" Grid.Row="1" HorizontalAlignment="Right">
|
||||||
|
|||||||
@ -25,7 +25,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private NOA_NOD _noa_nod;
|
private NOA_NOD _noa_nod;
|
||||||
private AGNT _agnt;
|
private AGNT _agnt;
|
||||||
private WAS _was;
|
|
||||||
private static List<AGNT_Template> _agntTemplates = null;
|
private static List<AGNT_Template> _agntTemplates = null;
|
||||||
private AGNT_Template _currentTemplate;
|
private AGNT_Template _currentTemplate;
|
||||||
private AGNT_Template _undoTemplate;
|
private AGNT_Template _undoTemplate;
|
||||||
@ -68,15 +67,9 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterTextboxChange(this.textBox_AgentPostalCode, Message.NotificationClass.AGNT);
|
this.RegisterTextboxChange(this.textBox_AgentPostalCode, Message.NotificationClass.AGNT);
|
||||||
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
|
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
|
||||||
this.RegisterTextboxChange(this.textBox_AgentCountry, 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
@ -99,16 +92,6 @@ namespace ENI2.DetailViewControls
|
|||||||
_agnt = new AGNT();
|
_agnt = new AGNT();
|
||||||
this.ControlMessages.Add(aMessage);
|
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;
|
this.dateTimePicker_ETAToKielCanal.IsEnabled = this.Core.IsTransit;
|
||||||
@ -137,13 +120,11 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dateTimePicker_ETDFromLastPort.DataContext = _noa_nod;
|
this.dateTimePicker_ETDFromLastPort.DataContext = _noa_nod;
|
||||||
this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
|
this.dateTimePicker_ETDFromPortOfCall.DataContext = _noa_nod;
|
||||||
|
|
||||||
this.textBox_WasteDisposalServiceProvider.DataContext = _was;
|
|
||||||
|
|
||||||
this.checkBox_IsAnchored.IsEnabled = this.Core.IsDK;
|
this.checkBox_IsAnchored.IsEnabled = this.Core.IsDK;
|
||||||
|
|
||||||
if(_agntTemplates == null)
|
if(_agntTemplates == null)
|
||||||
{
|
{
|
||||||
_agntTemplates = await DBManagerAsync.GetAGNTTemplatesAsync(); // inital full load
|
_agntTemplates = DBManager.Instance.GetAGNTTemplates(); // inital full load
|
||||||
_agntTemplates.Sort();
|
_agntTemplates.Sort();
|
||||||
Trace.WriteLine(string.Format("{0} agent templates loaded", _agntTemplates.Count));
|
Trace.WriteLine(string.Format("{0} agent templates loaded", _agntTemplates.Count));
|
||||||
}
|
}
|
||||||
@ -157,7 +138,8 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridCallPurposes_DeleteRequested(DatabaseEntity obj)
|
private void DataGridCallPurposes_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
if (obj is CallPurpose cp)
|
CallPurpose cp = obj as CallPurpose;
|
||||||
|
if (cp != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
_noa_nod.CallPurposes.Remove(cp);
|
_noa_nod.CallPurposes.Remove(cp);
|
||||||
@ -258,12 +240,24 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region AGNT templates combo
|
#region AGNT templates combo
|
||||||
|
|
||||||
private void comboBox_AgentTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void comboBox_AgentTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Trace.WriteLine("combo selection changed");
|
Trace.WriteLine("combo selection changed");
|
||||||
if (this.comboBox_AgentTemplate.SelectedItem is AGNT_Template at)
|
AGNT_Template at = this.comboBox_AgentTemplate.SelectedItem as AGNT_Template;
|
||||||
|
if(at != null)
|
||||||
{
|
{
|
||||||
this.textBoxTemplateTitle.Text = at.AgentTitle;
|
this.textBoxTemplateTitle.Text = at.AgentTitle;
|
||||||
this.buttonDeleteTemplate.IsEnabled = true;
|
this.buttonDeleteTemplate.IsEnabled = true;
|
||||||
@ -353,8 +347,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||||
this.textBox_AgentStreetAndNumber.Text = this._undoTemplate.AgentStreetAndNumber;
|
this.textBox_AgentStreetAndNumber.Text = this._undoTemplate.AgentStreetAndNumber;
|
||||||
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
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
|
this.buttonUndoTemplate.IsEnabled = false; // can't undo after undo
|
||||||
}
|
}
|
||||||
@ -363,13 +355,6 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (this._currentTemplate == null) return;
|
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._undoTemplate = createFromCurrentText(null, null);
|
||||||
|
|
||||||
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;
|
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;
|
||||||
@ -381,7 +366,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.textBox_AgentEMail.Text = this._currentTemplate.AgentEMail;
|
this.textBox_AgentEMail.Text = this._currentTemplate.AgentEMail;
|
||||||
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
this.textBox_AgentEMail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||||
this.textBox_AgentFax.Text = this._currentTemplate.AgentFax;
|
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.Text = this._currentTemplate.AgentFirstName;
|
||||||
this.textBox_AgentFirstName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
this.textBox_AgentFirstName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||||
this.textBox_AgentLastName.Text = this._currentTemplate.AgentLastName;
|
this.textBox_AgentLastName.Text = this._currentTemplate.AgentLastName;
|
||||||
@ -392,11 +377,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
this.textBox_AgentPostalCode.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||||
this.textBox_AgentStreetAndNumber.Text = this._currentTemplate.AgentStreetAndNumber;
|
this.textBox_AgentStreetAndNumber.Text = this._currentTemplate.AgentStreetAndNumber;
|
||||||
this.textBox_AgentStreetAndNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
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.buttonUndoTemplate.IsEnabled = true;
|
||||||
this.buttonSetTemplate.IsEnabled = false;
|
this.buttonSetTemplate.IsEnabled = false;
|
||||||
@ -422,7 +402,6 @@ namespace ENI2.DetailViewControls
|
|||||||
at.AgentPhone = this.textBox_AgentPhone.Text;
|
at.AgentPhone = this.textBox_AgentPhone.Text;
|
||||||
at.AgentPostalCode = this.textBox_AgentPostalCode.Text;
|
at.AgentPostalCode = this.textBox_AgentPostalCode.Text;
|
||||||
at.AgentStreetAndNumber = textBox_AgentStreetAndNumber.Text;
|
at.AgentStreetAndNumber = textBox_AgentStreetAndNumber.Text;
|
||||||
at.WasteDisposalServiceProviderName = textBox_WasteDisposalServiceProvider.Text;
|
|
||||||
|
|
||||||
return at;
|
return at;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,16 +19,14 @@
|
|||||||
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
|
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
|
||||||
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
|
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
|
||||||
<col:DictionaryEntry Key="Hoegh BHV" Value="8" />
|
<col:DictionaryEntry Key="Hoegh BHV" Value="8" />
|
||||||
<col:DictionaryEntry Key="Elbe Bulk" Value="16" />
|
|
||||||
<col:DictionaryEntry Key="Fct Junge" Value="32" />
|
|
||||||
</col:ArrayList>
|
</col:ArrayList>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<GroupBox Name="portNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}">
|
<GroupBox Name="portNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}">
|
||||||
<ScrollViewer>
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="50" />
|
<RowDefinition Height="50" />
|
||||||
<RowDefinition Height="194" />
|
<RowDefinition Height="220" />
|
||||||
<RowDefinition Height="200" />
|
<RowDefinition Height="200" />
|
||||||
<RowDefinition Height="200" />
|
<RowDefinition Height="200" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@ -36,12 +34,10 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*" />
|
<ColumnDefinition Width="1*" />
|
||||||
<ColumnDefinition Width="4*" />
|
<ColumnDefinition Width="5*" />
|
||||||
<ColumnDefinition Width="1*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
||||||
<Button x:Name="buttonCopyNameFromCREWA" Grid.Row="0" Grid.Column="2" Margin="2" Content="{x:Static p:Resources.textCopyFromCREWA}" Click="buttonCopyNameFromCREWA_Click"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
|
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
|
||||||
@ -59,84 +55,32 @@
|
|||||||
<RowDefinition Height="26" />
|
<RowDefinition Height="26" />
|
||||||
<RowDefinition Height="26" />
|
<RowDefinition Height="26" />
|
||||||
<RowDefinition Height="26" />
|
<RowDefinition Height="26" />
|
||||||
|
<RowDefinition Height="26" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
<ComboBox Grid.Row="0" Grid.Column="3" x:Name="comboBoxGroup" Margin="0,2,4,2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged"/>
|
||||||
<Grid Grid.Row="1" Grid.Column="1">
|
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
<Grid.ColumnDefinitions>
|
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall}" VerticalContentAlignment="Center"/>
|
||||||
<ColumnDefinition Width="*" />
|
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower}" VerticalContentAlignment="Center"/>
|
||||||
<ColumnDefinition Width="110" />
|
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower}" VerticalContentAlignment="Center"/>
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox Grid.Column="0" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
|
||||||
<Button Grid.Column="1" x:Name="buttonSearchPortArea" Margin="2" Content="Lookup port area" Click="buttonSearchPortArea_Click" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
|
||||||
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
|
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="0" Grid.Column="3" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top" />
|
<TextBox Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth}" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top"/>
|
<TextBox Grid.Row="4" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip}" VerticalContentAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
|
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
|
||||||
<Grid>
|
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width=".1*" />
|
|
||||||
<ColumnDefinition Width=".2*" />
|
|
||||||
<ColumnDefinition Width="26" />
|
|
||||||
<ColumnDefinition Width="26" />
|
|
||||||
<ColumnDefinition Width="26" />
|
|
||||||
<ColumnDefinition Width="26" />
|
|
||||||
<ColumnDefinition Width="26" />
|
|
||||||
|
|
||||||
<ColumnDefinition Width=".2*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textSERVTemplate}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxGroup" Margin="2,2,4,2" DisplayMemberPath="ServiceName"
|
|
||||||
SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
|
|
||||||
<Button Name="buttonSetTemplate" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" Grid.Column="2"
|
|
||||||
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>
|
|
||||||
|
|
||||||
<Button Name="buttonEditTemplate" Grid.Column="4" Grid.Row="0" Margin="2" Click="buttonEditTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Edit template">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Source="../Resources/pencil.png" Margin="0,0,0,0" Height="20" Width="20" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Button Name="buttonNewTemplate" Grid.Column="5" Grid.Row="0" Margin="2" Click="buttonNewTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="New template">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Source="../Resources/document_plain_new.png" Margin="0,0,0,0" Height="20" Width="20" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Button Name="buttonDeleteTemplate" Grid.Column="6" 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>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
<enictrl:ENIDataGrid Grid.Row="1" x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
|
||||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
@ -145,7 +89,7 @@
|
|||||||
<DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Name="ladgGroupBox" Header="{x:Static p:Resources.textLadg}" Grid.Row="3">
|
<GroupBox Name="ladgGroupBox" Header="{x:Static p:Resources.textLadg}" Grid.Row="3">
|
||||||
<enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
@ -156,27 +100,8 @@
|
|||||||
<DataGridTextColumn Header="{x:Static p:Resources.textLACodes}" Binding="{Binding CargoLACode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textLACodes}" Binding="{Binding CargoLACode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoCodeNST}" Binding="{Binding CargoCodeNST, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoCodeNST}" Binding="{Binding CargoCodeNST, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoCodeNST3}" Binding="{Binding CargoCodeNST_3, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoCodeNST3}" Binding="{Binding CargoCodeNST_3, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoNumberOfItems}" Binding="{Binding CargoNumberOfItems, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoNumberOfItems}" IsReadOnly="False" Width="0.15*">
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoGrossQuantity}" Binding="{Binding CargoGrossQuantity_TNE, Mode=TwoWay, StringFormat={}{0:N3}}" IsReadOnly="True" Width="0.15*" />
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<Binding Path="CargoNumberOfItems" Mode="TwoWay">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:NumberValidationRule MaxValue="9999999" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoGrossQuantity}" IsReadOnly="False" Width="0.15*">
|
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<Binding Path="CargoGrossQuantity_TNE" Mode="TwoWay" StringFormat="N3">
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:NumberValidationRule MaxValue="1000000" MinValue="0" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoPortOfLoading}" Binding="{Binding PortOfLoading, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoPortOfLoading}" Binding="{Binding PortOfLoading, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoPortOfDischarge}" Binding="{Binding PortOfDischarge, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoPortOfDischarge}" Binding="{Binding PortOfDischarge, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
// Copyright (c) 2017 schick Informatik
|
||||||
// Description:
|
|
||||||
//
|
|
||||||
|
|
||||||
// Description: Detailansicht Gruppe Port Notification
|
// Description: Detailansicht Gruppe Port Notification
|
||||||
//
|
//
|
||||||
@ -8,7 +6,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
@ -16,8 +13,6 @@ using ENI2.EditControls;
|
|||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -27,18 +22,10 @@ namespace ENI2.DetailViewControls
|
|||||||
public partial class PortNotificationDetailControl : DetailBaseControl
|
public partial class PortNotificationDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
private Message _nameMessage;
|
private Message _nameMessage;
|
||||||
private Message _infoMessage;
|
private Message _infoMessage;
|
||||||
private Message _servMessage;
|
private Message _servMessage;
|
||||||
private Message _ladgMessage;
|
private Message _ladgMessage;
|
||||||
private Message _crewaMessage;
|
|
||||||
private Dictionary<string, string> portAreas = null;
|
|
||||||
private static List<SERV_Template> _servTemplates = null;
|
|
||||||
private SERV_Template _currentTemplate;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private static readonly string[] shippingAreas = {
|
private static readonly string[] shippingAreas = {
|
||||||
Properties.Resources.textShippingAreaNORTHBALTIC,
|
Properties.Resources.textShippingAreaNORTHBALTIC,
|
||||||
@ -65,10 +52,10 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterDoubleUpDownChange(this.doubleUpDownDisplacementSummerDraught, Message.NotificationClass.INFO);
|
this.RegisterDoubleUpDownChange(this.doubleUpDownDisplacementSummerDraught, Message.NotificationClass.INFO);
|
||||||
this.RegisterTextboxChange(this.textSpecialRequirements, Message.NotificationClass.INFO);
|
this.RegisterTextboxChange(this.textSpecialRequirements, Message.NotificationClass.INFO);
|
||||||
this.RegisterTextboxChange(this.textConstructionCharacteristics, Message.NotificationClass.INFO);
|
this.RegisterTextboxChange(this.textConstructionCharacteristics, Message.NotificationClass.INFO);
|
||||||
this.dataGridLADG.CellEditEnding += (obj, ev) => { this.OnNotificationClassChanged(Message.NotificationClass.LADG); };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
@ -78,7 +65,6 @@ namespace ENI2.DetailViewControls
|
|||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if(aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewaMessage = aMessage;}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region init NAME
|
#region init NAME
|
||||||
@ -123,7 +109,7 @@ namespace ENI2.DetailViewControls
|
|||||||
_infoMessage.Elements.Add(info);
|
_infoMessage.Elements.Add(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
portAreas = LocalizedLookup.getPortAreasForLocode(this.Core.PoC);
|
Dictionary<string, string> portAreas = LocalizedLookup.getPortAreasForLocode(this.Core.PoC);
|
||||||
this.comboBoxPortArea.ItemsSource = portAreas;
|
this.comboBoxPortArea.ItemsSource = portAreas;
|
||||||
|
|
||||||
this.comboBoxShippingArea.ItemsSource = shippingAreas;
|
this.comboBoxShippingArea.ItemsSource = shippingAreas;
|
||||||
@ -167,31 +153,20 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region init SERV templates
|
#region init helper Maersk / SeaGo Field
|
||||||
|
|
||||||
if(_servTemplates == null)
|
if (this.Core.IsFlagSet(MessageCore.CoreFlags.MAERSK_BHV)) this.comboBoxGroup.SelectedIndex = 1;
|
||||||
{
|
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.comboBoxGroup.SelectedIndex = 2;
|
||||||
_servTemplates = await DBManagerAsync.GetSERVTemplatesAsync(); // initial load
|
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.comboBoxGroup.SelectedIndex = 3;
|
||||||
_servTemplates.Sort();
|
if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4;
|
||||||
Trace.WriteLine($"{_servTemplates.Count} SERV templates loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.comboBoxGroup.ItemsSource = _servTemplates;
|
|
||||||
|
|
||||||
this.buttonDeleteTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
this.buttonEditTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
this.buttonNewTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region datagrid LADG
|
#region datagrid LADG
|
||||||
|
|
||||||
private void DataGridLADG_CreateRequested()
|
private void DataGridLADG_CreateRequested()
|
||||||
{
|
{
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
EditLADGDialog eld = new EditLADGDialog();
|
EditLADGDialog eld = new EditLADGDialog();
|
||||||
eld.LADG = new LADG();
|
eld.LADG = new LADG();
|
||||||
eld.LADG.MessageHeader = _ladgMessage;
|
eld.LADG.MessageHeader = _ladgMessage;
|
||||||
@ -224,8 +199,6 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (obj is LADG ladg)
|
if (obj is LADG ladg)
|
||||||
{
|
{
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
this._ladgMessage.Elements.Remove(ladg);
|
this._ladgMessage.Elements.Remove(ladg);
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ladg);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ladg);
|
||||||
@ -237,9 +210,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridLADG_EditRequested(DatabaseEntity obj)
|
private void DataGridLADG_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
this.dataGridLADG.CancelEdit();
|
|
||||||
|
|
||||||
LADG ladg = obj as LADG;
|
LADG ladg = obj as LADG;
|
||||||
|
|
||||||
EditLADGDialog eld = new EditLADGDialog();
|
EditLADGDialog eld = new EditLADGDialog();
|
||||||
@ -381,38 +351,57 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SERV template event handler
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Spezialbalkon für die Gruppenauswahl im Core (Maersk BHV / Seago usw.)
|
||||||
|
|
||||||
private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if(this.comboBoxGroup.SelectedItem is SERV_Template st)
|
// clear all
|
||||||
|
this.Core.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
|
||||||
|
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
|
||||||
|
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
|
||||||
|
this.Core.SetFlag(false, MessageCore.CoreFlags.HOEGH);
|
||||||
|
|
||||||
|
DictionaryEntry selectedItem = (DictionaryEntry) this.comboBoxGroup.SelectedItem;
|
||||||
|
if(Int32.TryParse((string)selectedItem.Value, out int selectedValue))
|
||||||
{
|
{
|
||||||
this.buttonDeleteTemplate.IsEnabled = true;
|
if (selectedValue == (int)MessageCore.CoreFlags.MAERSK_BHV) CheckServiceEntryMaerskBHV();
|
||||||
this.buttonSetTemplate.IsEnabled = true;
|
if (selectedValue == (int)MessageCore.CoreFlags.SEAGO_BHV) CheckServiceEntrySeaGoBHV();
|
||||||
this._currentTemplate = st;
|
if (selectedValue == (int)MessageCore.CoreFlags.HOEGH) CheckServiceEntryHoegh();
|
||||||
|
this.Core.SetFlag(true, (MessageCore.CoreFlags)selectedValue);
|
||||||
|
DBManager.Instance.Save(this.Core);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonSetTemplate_Click(object sender, RoutedEventArgs e)
|
#endregion
|
||||||
{
|
|
||||||
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
|
#region special entry ship service check
|
||||||
|
|
||||||
|
private void CheckServiceEntryMaerskBHV()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
|
foreach(SERV serv in this._servMessage.Elements)
|
||||||
{
|
{
|
||||||
if (serv.ServiceName.Equals(st.ServiceName))
|
if (serv.ServiceBeneficiary.Equals("Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655"))
|
||||||
{
|
found = true;
|
||||||
found = true; break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if(!found)
|
||||||
{
|
{
|
||||||
SERV newServ = new SERV();
|
SERV newServ = new SERV();
|
||||||
newServ.ServiceName = st.ServiceName;
|
newServ.ServiceBeneficiary = "Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655";
|
||||||
newServ.ServiceBeneficiary = st.ServiceBeneficiary;
|
newServ.ServiceInvoiceRecipient = "Maersk Deutschland A/S & Co.KG, Ericusspitze 2-4, 20457 Hamburg";
|
||||||
newServ.ServiceInvoiceRecipient = st.ServiceInvoiceRecipient;
|
newServ.ServiceName = "Maersk BHV";
|
||||||
|
|
||||||
newServ.MessageHeader = this._servMessage;
|
newServ.MessageHeader = this._servMessage;
|
||||||
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
|
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
|
||||||
this._servMessage.Elements.Add(newServ);
|
this._servMessage.Elements.Add(newServ);
|
||||||
@ -420,101 +409,53 @@ namespace ENI2.DetailViewControls
|
|||||||
this.SublistElementChanged(Message.NotificationClass.SERV);
|
this.SublistElementChanged(Message.NotificationClass.SERV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckServiceEntrySeaGoBHV()
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
foreach (SERV serv in this._servMessage.Elements)
|
||||||
|
{
|
||||||
|
if (serv.ServiceBeneficiary.Equals("Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655"))
|
||||||
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonNewTemplate_Click(object sender, RoutedEventArgs e)
|
if (!found)
|
||||||
{
|
{
|
||||||
SERV_Template newTemplate = new SERV_Template();
|
SERV newServ = new SERV();
|
||||||
EditSERVDialog esd = new EditSERVDialog();
|
newServ.ServiceBeneficiary = "Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655";
|
||||||
esd.AddVisible = false;
|
newServ.ServiceInvoiceRecipient = "Sealand Europe Deutschland A/S & Co. KG, Ericusspitze 2-4, 20457 Hamburg";
|
||||||
esd.SERV_Template = newTemplate;
|
newServ.ServiceName = "SeaGo BHV";
|
||||||
if(esd.ShowDialog() ?? false)
|
newServ.MessageHeader = this._servMessage;
|
||||||
{
|
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
|
||||||
_ = DBManagerAsync.SaveAsync(esd.SERV_Template);
|
this._servMessage.Elements.Add(newServ);
|
||||||
this.comboBoxGroup.ItemsSource = null;
|
this.dataGridSERV.Items.Refresh();
|
||||||
_servTemplates.Add(newTemplate);
|
this.SublistElementChanged(Message.NotificationClass.SERV);
|
||||||
_servTemplates.Sort();
|
|
||||||
this.comboBoxGroup.ItemsSource = _servTemplates;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonEditTemplate_Click(object sender, RoutedEventArgs e)
|
private void CheckServiceEntryHoegh()
|
||||||
{
|
{
|
||||||
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
|
bool found = false;
|
||||||
|
foreach (SERV serv in this._servMessage.Elements)
|
||||||
{
|
{
|
||||||
EditSERVDialog editSERVDialog = new EditSERVDialog();
|
if (serv.ServiceBeneficiary.Equals("Höegh Autoliners AS, Oslo, Norway"))
|
||||||
editSERVDialog.AddVisible = false;
|
found = true;
|
||||||
editSERVDialog.SERV_Template = st;
|
|
||||||
if (editSERVDialog.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
_ = DBManagerAsync.SaveAsync(st);
|
|
||||||
this.comboBoxGroup.ItemsSource = null;
|
|
||||||
_servTemplates.Sort();
|
|
||||||
this.comboBoxGroup.ItemsSource = _servTemplates;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
SERV newServ = new SERV();
|
||||||
|
newServ.ServiceBeneficiary = "Höegh Autoliners AS, Oslo, Norway";
|
||||||
|
newServ.ServiceInvoiceRecipient = " PWL Port Services GmbH & Co. KG";
|
||||||
|
newServ.ServiceName = "HOEGH BHV";
|
||||||
|
newServ.MessageHeader = this._servMessage;
|
||||||
|
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
|
||||||
|
this._servMessage.Elements.Add(newServ);
|
||||||
|
this.dataGridSERV.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.SERV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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.comboBoxGroup.SelectedItem = null;
|
|
||||||
this.comboBoxGroup.ItemsSource = null;
|
|
||||||
_ = DBManagerAsync.DeleteAsync(_currentTemplate);
|
|
||||||
_servTemplates.Remove(_currentTemplate);
|
|
||||||
this.buttonDeleteTemplate.IsEnabled = false;
|
|
||||||
this.comboBoxGroup.ItemsSource = _servTemplates;
|
|
||||||
this.buttonSetTemplate.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region other event handler
|
|
||||||
|
|
||||||
private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (portAreas != null)
|
|
||||||
{
|
|
||||||
SelectPortAreaDialog spad = new SelectPortAreaDialog(this.Core.PoC);
|
|
||||||
if (spad.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
if (spad.SelectedArea != null)
|
|
||||||
{
|
|
||||||
if (portAreas.ContainsKey(spad.SelectedArea))
|
|
||||||
{
|
|
||||||
var pair = portAreas.SingleOrDefault(p => p.Key == spad.SelectedArea);
|
|
||||||
this.comboBoxPortArea.SelectedItem = pair;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonCopyNameFromCREWA_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CREW crewA = null;
|
|
||||||
if (this._crewaMessage.Elements.Count > 0)
|
|
||||||
{
|
|
||||||
crewA = this._crewaMessage.Elements[0] as CREW;
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectCrewMemberDialog scmd = new SelectCrewMemberDialog();
|
|
||||||
scmd.CREW = crewA;
|
|
||||||
scmd.AddVisible = false;
|
|
||||||
|
|
||||||
if (scmd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
this.textBox_NameMaster.Text = $"{crewA.CrewMemberFirstName} {crewA.CrewMemberLastName}";
|
|
||||||
this.SublistElementChanged(Message.NotificationClass.NAME);
|
|
||||||
var binding = textBox_NameMaster.GetBindingExpression(TextBox.TextProperty);
|
|
||||||
binding?.UpdateSource();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@ -74,13 +74,13 @@
|
|||||||
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<CheckBox Name="checkBoxSECSimplification" IsChecked="{Binding SECSimplification}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/>
|
<CheckBox Name="checkBoxSECSimplification" IsChecked="{Binding SECSimplification}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
<enictrl:LocodeControl x:Name="locodePortOfCallWhereCompleteSECNotified" Grid.Row="6" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteSECNotified, Mode=TwoWay}" />
|
<enictrl:LocodeControl x:Name="locodePortOfCallWhereCompleteSECNotified" Grid.Row="6" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteSECNotified, Mode=TwoWay}" />
|
||||||
<TextBox Name="textBoxCSOFirstName" Grid.Row="8" Grid.Column="1" MaxLength="100" Text="{Binding CSOFirstName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCSOFirstName" Grid.Row="8" Grid.Column="1" MaxLength="100" Text="{Binding CSOFirstName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCSOLastName" Grid.Row="8" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCSOLastName" Grid.Row="8" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCSOPhoneName" Grid.Row="9" Grid.Column="1" MaxLength="100" Text="{Binding CSOPhone, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCSOPhoneName" Grid.Row="9" Grid.Column="1" MaxLength="100" Text="{Binding CSOPhone}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCSOFaxName" Grid.Row="9" Grid.Column="3" MaxLength="100" Text="{Binding CSOFax, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCSOFaxName" Grid.Row="9" Grid.Column="3" MaxLength="100" Text="{Binding CSOFax}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCSOEMailName" Grid.Row="10" Grid.Column="1" MaxLength="100" Text="{Binding CSOEMail, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCSOEMailName" Grid.Row="10" Grid.Column="1" MaxLength="100" Text="{Binding CSOEMail}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<CheckBox Name="checkBoxValidISSCOnBoard" IsChecked="{Binding ValidISSCOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
<CheckBox Name="checkBoxValidISSCOnBoard" IsChecked="{Binding ValidISSCOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
<TextBox Name="textBoxReasonsForNoValidISSC" Grid.Row="13" Grid.Column="3" MaxLength="255" Text="{Binding ReasonsForNoValidISSC, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxReasonsForNoValidISSC" Grid.Row="13" Grid.Column="3" MaxLength="255" Text="{Binding ReasonsForNoValidISSC}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Name="comboBoxISSCType" Grid.Row="14" Grid.Column="1" SelectedIndex="{Binding ISSCType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
<ComboBox Name="comboBoxISSCType" Grid.Row="14" Grid.Column="1" SelectedIndex="{Binding ISSCType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
<ComboBox Name="comboBoxISSCIssuerType" Grid.Row="14" Grid.Column="3" SelectedIndex="{Binding ISSCIssuerType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
<ComboBox Name="comboBoxISSCIssuerType" Grid.Row="14" Grid.Column="3" SelectedIndex="{Binding ISSCIssuerType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
<DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
@ -90,9 +90,9 @@
|
|||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
|
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<TextBox Name="textBoxISSCIssuerName" Grid.Row="15" Grid.Column="3" MaxLength="100" Text="{Binding ISSCIssuerName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxISSCIssuerName" Grid.Row="15" Grid.Column="3" MaxLength="100" Text="{Binding ISSCIssuerName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<CheckBox Name="checkBoxApprovedSecurityPlanOnBoard" IsChecked="{Binding ApprovedSecurityPlanOnBoard}" Grid.Row="17" Grid.Column="1" VerticalAlignment="Center"/>
|
<CheckBox Name="checkBoxApprovedSecurityPlanOnBoard" IsChecked="{Binding ApprovedSecurityPlanOnBoard}" Grid.Row="17" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
<TextBox Name="textBoxPortFacilityOfArrival" Grid.Row="18" Grid.Column="1" MaxLength="100" Text="{Binding PortFacilityOfArrival, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxPortFacilityOfArrival" Grid.Row="18" Grid.Column="1" MaxLength="100" Text="{Binding PortFacilityOfArrival}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="18" Grid.Column="3" IsEditable="True" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo, Converter={util:ByteConverter}}" Margin="2" IsTextSearchEnabled="True"/>
|
<ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="18" Grid.Column="3" IsEditable="True" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo, Converter={util:ByteConverter}}" Margin="2" IsTextSearchEnabled="True"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -2,17 +2,18 @@
|
|||||||
// Description: SEC Meldung Bearbeitungsseite
|
// Description: SEC Meldung Bearbeitungsseite
|
||||||
//
|
//
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ClosedXML.Excel;
|
|
||||||
using ENI2.EditControls;
|
|
||||||
using ENI2.Util;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using bsmd.database;
|
||||||
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
using System;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System.IO;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -115,12 +116,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int SelectedTabIndex
|
|
||||||
{
|
|
||||||
get { return this.mainFrame.SelectedIndex; }
|
|
||||||
set { this.mainFrame.SelectedIndex = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#region SetEnabled
|
#region SetEnabled
|
||||||
|
|
||||||
public override void SetEnabled(bool enabled)
|
public override void SetEnabled(bool enabled)
|
||||||
@ -337,14 +332,83 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void buttonImportExcel_Click(object sender, RoutedEventArgs e)
|
private void buttonImportExcel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int importedCount = Excel.ExcelLocalImportHelper.ImportLast10PortFacilities(this._sec);
|
OpenFileDialog ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Filter = "Excel Files|*.xls;*.xlsx"
|
||||||
|
};
|
||||||
|
|
||||||
if (importedCount > 0)
|
if (ofd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
FileStream stream;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<LastTenPortFacilitiesCalled> importL10C = new List<LastTenPortFacilitiesCalled>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
int cnt = 0;
|
||||||
|
while (reader.Read() && (cnt < 10))
|
||||||
|
{
|
||||||
|
if (((IExcelDataReader)reader).FieldCount < 8)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 8 Columns of data");
|
||||||
|
}
|
||||||
|
LastTenPortFacilitiesCalled l10c = new LastTenPortFacilitiesCalled();
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) l10c.PortFacilityPortName = reader.GetString(0);
|
||||||
|
if (!reader.IsDBNull(2)) l10c.PortFacilityPortCountry = reader.GetString(2);
|
||||||
|
if (!reader.IsDBNull(3)) l10c.PortFacilityPortLoCode = reader.GetString(3);
|
||||||
|
object o = null;
|
||||||
|
if (!reader.IsDBNull(4)) o = reader.GetValue(4);
|
||||||
|
if(o != null) l10c.PortFacilityDateOfArrival = Convert.ToDateTime(o);
|
||||||
|
if (!reader.IsDBNull(5)) o = reader.GetValue(5);
|
||||||
|
if (o != null) l10c.PortFacilityDateOfDeparture = Convert.ToDateTime(o);
|
||||||
|
// if (!reader.IsDBNull(4)) l10c.PortFacilityDateOfArrival = reader.GetDateTime(4);
|
||||||
|
// if (!reader.IsDBNull(5)) l10c.PortFacilityDateOfDeparture = reader.GetDateTime(5);
|
||||||
|
if (!reader.IsDBNull(6)) o = reader.GetValue(6);
|
||||||
|
if (o != null) l10c.PortFacilityShipSecurityLevel = Convert.ToByte(o);
|
||||||
|
if (!reader.IsDBNull(7)) o = reader.GetValue(7);
|
||||||
|
int gisis = Convert.ToInt32(o);
|
||||||
|
if (!reader.IsDBNull(7)) l10c.PortFacilityGISISCode = gisis.ToString().PadLeft(4, '0');
|
||||||
|
if (!reader.IsDBNull(8)) l10c.PortFacilitySecurityMattersToReport = reader.GetString(8);
|
||||||
|
if (l10c.PortFacilitySecurityMattersToReport.Equals("nil", StringComparison.CurrentCultureIgnoreCase))
|
||||||
|
l10c.PortFacilitySecurityMattersToReport = null;
|
||||||
|
if (!reader.IsDBNull(9)) l10c.PortFacilityGISISCodeLocode = reader.GetString(9);
|
||||||
|
l10c.SEC = this._sec;
|
||||||
|
l10c.IsDirty = true;
|
||||||
|
l10c.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(this._sec.LastTenPortFacilitesCalled);
|
||||||
|
this._sec.LastTenPortFacilitesCalled.Add(l10c);
|
||||||
|
importL10C.Add(l10c);
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importL10C.Count > 0)
|
||||||
{
|
{
|
||||||
this.dataGridLast10PortFacilities.Items.Refresh();
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
||||||
this.SublistElementChanged(Message.NotificationClass.SEC);
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
||||||
MessageBox.Show(String.Format(Properties.Resources.textL10PImported, importedCount),
|
MessageBox.Show(String.Format(Properties.Resources.textL10PImported, importL10C.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,5 +504,16 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,14 +5,13 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
xmlns:util="clr-namespace:ENI2.Util"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="600" d:DesignWidth="800">
|
d:DesignHeight="600" d:DesignWidth="800">
|
||||||
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.textShipData}" >
|
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.textShipData}" >
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="260" />
|
<RowDefinition Height="260" />
|
||||||
@ -52,9 +51,9 @@
|
|||||||
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="3" Content="{x:Static p:Resources.textInmarsatCallNumber}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="3" Content="{x:Static p:Resources.textInmarsatCallNumber}" Margin="0,0,10,0" />
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="3" Content="{x:Static p:Resources.textLimitCallNumbers}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="3" Content="{x:Static p:Resources.textLimitCallNumbers}" Margin="0,0,10,0" />
|
||||||
|
|
||||||
<TextBox Name="textBoxVesselName" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding ShipName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxVesselName" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2" Text="{Binding ShipName}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Name="comboBoxVesselType" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" SelectedValue="{Binding ShipType}" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Name="comboBoxVesselType" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" SelectedValue="{Binding ShipType}" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<TextBox Name="textBoxCallsign" Grid.Column="4" Grid.Row="1" Text="{Binding CallSign, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="7"/>
|
<TextBox Name="textBoxCallsign" Grid.Column="4" Grid.Row="1" Text="{Binding CallSign}" Margin="2" VerticalContentAlignment="Center" MaxLength="7"/>
|
||||||
<ComboBox Name="comboBoxTransportMode" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="2" SelectedValue="{Binding TransportMode}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Name="comboBoxTransportMode" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="2" SelectedValue="{Binding TransportMode}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<ComboBox Name="comboBoxFlag" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="2" SelectedValue="{Binding Flag}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Name="comboBoxFlag" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="2" SelectedValue="{Binding Flag}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" LocodeValue="{Binding PortOfRegistry, Mode=TwoWay}" LocodeSource="NO_PORT_FLAG" />
|
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" LocodeValue="{Binding PortOfRegistry, Mode=TwoWay}" LocodeSource="NO_PORT_FLAG" />
|
||||||
@ -65,8 +64,8 @@
|
|||||||
<Label Content="m" Grid.Column="2" Grid.Row="5" />
|
<Label Content="m" Grid.Column="2" Grid.Row="5" />
|
||||||
<xctk:DoubleUpDown Name="doubleUpDownBeam" Grid.Column="4" Grid.Row="5" Margin="2" Value="{Binding Beam_MTR}" ShowButtonSpinner="False" TextAlignment="Left" ParsingNumberStyle="Any" FormatString="N2" />
|
<xctk:DoubleUpDown Name="doubleUpDownBeam" Grid.Column="4" Grid.Row="5" Margin="2" Value="{Binding Beam_MTR}" ShowButtonSpinner="False" TextAlignment="Left" ParsingNumberStyle="Any" FormatString="N2" />
|
||||||
<Label Content="m" Grid.Column="5" Grid.Row="5" />
|
<Label Content="m" Grid.Column="5" Grid.Row="5" />
|
||||||
<TextBox Name="textBoxMMSI" Grid.Column="1" Grid.Row="6" Margin="2" Text="{Binding MMSINumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" MaxLength="10"/>
|
<TextBox Name="textBoxMMSI" Grid.Column="1" Grid.Row="6" Margin="2" Text="{Binding MMSINumber}" VerticalContentAlignment="Center" MaxLength="10"/>
|
||||||
<TextBox Name="textBoxInmarsatCallNumber" Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="6" Grid.RowSpan="2" Margin="2" Text="{Binding InmarsatCallNumber, Converter={util:TrimStringConverter}}"
|
<TextBox Name="textBoxInmarsatCallNumber" Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="6" Grid.RowSpan="2" Margin="2" Text="{Binding InmarsatCallNumber}"
|
||||||
VerticalContentAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" />
|
VerticalContentAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -94,16 +93,16 @@
|
|||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textCompanyId}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="3" Content="{x:Static p:Resources.textCompanyId}" Margin="0,0,10,0" />
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textCity}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textCity}" Margin="0,0,10,0" />
|
||||||
|
|
||||||
<TextBox Name="textBoxCompanyName" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyName, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCompanyName" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyName}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId, Converter={util:TrimStringConverter}}" MaxLength="7" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId}" MaxLength="7" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxStreetNumber" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyStreetAndNumber, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxStreetNumber" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyStreetAndNumber}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCity" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCity, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCity" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCity}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxPostalCode" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyPostalCode, Converter={util:TrimStringConverter}}" MaxLength="24" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxPostalCode" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyPostalCode}" MaxLength="24" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxCountry" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCountry, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxCountry" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCountry}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</src:DetailBaseControl>
|
</src:DetailBaseControl>
|
||||||
|
|||||||
@ -5,8 +5,10 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using System.Windows.Media;
|
||||||
using ENI2.Util;
|
using ENI2.Util;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -104,5 +106,16 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,18 +35,10 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
this.dataGridTowageOnArrival.ContextMenu.Items.Add(new Separator());
|
this.dataGridTowageOnArrival.ContextMenu.Items.Add(new Separator());
|
||||||
MenuItem copyItem = new MenuItem();
|
MenuItem copyItem = new MenuItem();
|
||||||
copyItem.Header = string.Format(Properties.Resources.textCopyTo, "TOWD");
|
copyItem.Header = Properties.Resources.textCopyTOWATOWD;
|
||||||
copyItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyItem.Click += new RoutedEventHandler(this.copyItem);
|
copyItem.Click += new RoutedEventHandler(this.copyItem);
|
||||||
this.dataGridTowageOnArrival.ContextMenu.Items.Add(copyItem);
|
this.dataGridTowageOnArrival.ContextMenu.Items.Add(copyItem);
|
||||||
|
|
||||||
this.dataGridTowageOnDeparture.ContextMenu.Items.Add(new Separator());
|
|
||||||
copyItem = new MenuItem();
|
|
||||||
copyItem.Header = string.Format(Properties.Resources.textCopyTo, "TOWA");
|
|
||||||
copyItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
|
||||||
copyItem.Click += new RoutedEventHandler(this.copyItemToTOWA);
|
|
||||||
this.dataGridTowageOnDeparture.ContextMenu.Items.Add(copyItem);
|
|
||||||
|
|
||||||
_ctxInitialized = true;
|
_ctxInitialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,24 +61,6 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyItemToTOWA(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// aus dem aktuell selektierten TOWD Element ein neues TOWA Element machen
|
|
||||||
if (this.dataGridTowageOnDeparture.SelectedItems != null)
|
|
||||||
{
|
|
||||||
foreach (TOWD selectedTOWD in this.dataGridTowageOnDeparture.SelectedItems)
|
|
||||||
{
|
|
||||||
TOWA copyTOWA = new TOWA();
|
|
||||||
copyTOWA.MessageHeader = _towaMessage;
|
|
||||||
copyTOWA.CopyFromTOWD(selectedTOWD);
|
|
||||||
copyTOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
|
|
||||||
this._towaMessage.Elements.Add(copyTOWA);
|
|
||||||
this.dataGridTowageOnArrival.Items.Refresh();
|
|
||||||
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@ -166,7 +140,8 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
if (obj is TOWD towd)
|
TOWD towd = obj as TOWD;
|
||||||
|
if (towd != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
this._towdMessage.Elements.Remove(towd);
|
this._towdMessage.Elements.Remove(towd);
|
||||||
@ -244,7 +219,8 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
if (obj is TOWA towa)
|
TOWA towa = obj as TOWA;
|
||||||
|
if (towa != null)
|
||||||
{
|
{
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
this._towaMessage.Elements.Remove(towa);
|
this._towaMessage.Elements.Remove(towa);
|
||||||
@ -310,5 +286,16 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/>
|
||||||
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" />
|
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" />
|
||||||
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" />
|
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" />
|
||||||
|
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlNextWastePort" LocodeValue="{Binding NextWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
<DatePicker Grid.Row="1" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Mode=TwoWay}" DisplayDateStart="1/1/1800" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="1" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Mode=TwoWay}" DisplayDateStart="1/1/1800" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
@ -53,9 +53,7 @@
|
|||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<enictrl:LocodeControl Grid.Row="2" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
|
<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}" Margin="2" />
|
||||||
<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="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" />
|
<Button Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -153,12 +151,10 @@
|
|||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
<Grid Grid.Row="1">
|
<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="120" />
|
|
||||||
<ColumnDefinition Width="120" />
|
<ColumnDefinition Width="120" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Grid.Row="0" Grid.Column="0" Name="buttonWasteReceivedAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonWasteReceivedAddMissingEntries_Click"/>
|
<Button Grid.Row="0" Grid.Column="0" Name="buttonWasteReceivedAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonWasteReceivedAddMissingEntries_Click"/>
|
||||||
<Button Grid.Row="0" Grid.Column="1" Name="buttonCopyFromWAS" Content="{x:Static p:Resources.textCopyFromWAS}" Margin="2" Click="buttonCopyFromWAS_Click"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<enictrl:ENIDataGrid x:Name="dataGridWasteReceived" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
<enictrl:ENIDataGrid x:Name="dataGridWasteReceived" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="2" CanUserAddRows="False">
|
AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="2" CanUserAddRows="False">
|
||||||
@ -166,7 +162,7 @@
|
|||||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding WasteTypeDisplayGrid}" IsReadOnly="True" Width="0.2*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding WasteTypeDisplayGrid}" IsReadOnly="True" Width="0.2*" />
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding WasteDescription}" IsReadOnly="True" Width="0.3*" />
|
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding WasteDescription}" IsReadOnly="True" Width="0.3*" />
|
||||||
<!--DataGridTemplateColumn IsReadOnly="True" Width="0.15*">
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.15*">
|
||||||
<DataGridTemplateColumn.HeaderTemplate>
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textAmountWasteReceived_MTQ}" FontSize="10"/>
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textAmountWasteReceived_MTQ}" FontSize="10"/>
|
||||||
@ -177,16 +173,7 @@
|
|||||||
<TextBlock TextAlignment="Center" Text="{Binding AmountWasteReceived_MTQ, StringFormat={}{0:N3}}" />
|
<TextBlock TextAlignment="Center" Text="{Binding AmountWasteReceived_MTQ, StringFormat={}{0:N3}}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn-->
|
</DataGridTemplateColumn>
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textAmountWasteReceived_MTQ}" IsReadOnly="False" Width="0.15*">
|
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<Binding Path="AmountWasteReceived_MTQ" Mode="TwoWay" StringFormat="N3" >
|
|
||||||
<Binding.ValidationRules>
|
|
||||||
<util:NumberValidationRule MaxValue="10000" MinValue="0" />
|
|
||||||
</Binding.ValidationRules>
|
|
||||||
</Binding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
|
|||||||
@ -2,18 +2,17 @@
|
|||||||
// Description: Detailansicht Müllmeldung
|
// Description: Detailansicht Müllmeldung
|
||||||
//
|
//
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ClosedXML.Excel;
|
|
||||||
using ENI2.EditControls;
|
|
||||||
using ENI2.Excel;
|
|
||||||
using ENI2.Util;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using bsmd.database;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using System.IO;
|
||||||
|
using System;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace ENI2.DetailViewControls
|
namespace ENI2.DetailViewControls
|
||||||
{
|
{
|
||||||
@ -23,14 +22,17 @@ namespace ENI2.DetailViewControls
|
|||||||
public partial class WasteDetailControl : DetailBaseControl
|
public partial class WasteDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
private Message _wasMessage;
|
private Message _wasMessage;
|
||||||
private WAS _was;
|
private WAS _was;
|
||||||
private Message _wasRcptMessage;
|
private Message _wasRcptMessage;
|
||||||
private WAS_RCPT _selectedWAS_RCPT;
|
private WAS_RCPT _selectedWAS_RCPT;
|
||||||
|
|
||||||
#endregion
|
private static readonly string[] _wasteDeliveryList =
|
||||||
|
{
|
||||||
|
"ALL",
|
||||||
|
"SOME",
|
||||||
|
"NONE"
|
||||||
|
};
|
||||||
|
|
||||||
public WasteDetailControl()
|
public WasteDetailControl()
|
||||||
{
|
{
|
||||||
@ -47,7 +49,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.RegisterCheckboxChange(this.checkBoxValidExemption, Message.NotificationClass.WAS);
|
this.RegisterCheckboxChange(this.checkBoxValidExemption, Message.NotificationClass.WAS);
|
||||||
this.RegisterDatePickerChange(this.datePickerDateLastDisposal, Message.NotificationClass.WAS);
|
this.RegisterDatePickerChange(this.datePickerDateLastDisposal, Message.NotificationClass.WAS);
|
||||||
this.RegisterTextboxChange(this.textBoxWasteDisposalServiceProviders, Message.NotificationClass.WAS);
|
this.RegisterTextboxChange(this.textBoxWasteDisposalServiceProviders, Message.NotificationClass.WAS);
|
||||||
this.dataGridWasteReceived.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckBoxValidExemption_Checked(object sender, RoutedEventArgs e)
|
private void CheckBoxValidExemption_Checked(object sender, RoutedEventArgs e)
|
||||||
@ -178,12 +180,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int SelectedTabIndex
|
|
||||||
{
|
|
||||||
get { return this.mainFrame.SelectedIndex; }
|
|
||||||
set { this.mainFrame.SelectedIndex = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Waste receipt grid event handler
|
#region Waste receipt grid event handler
|
||||||
|
|
||||||
private void DataGridWasteReceipt_CreateRequested()
|
private void DataGridWasteReceipt_CreateRequested()
|
||||||
@ -217,8 +213,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridWasteReceived.ItemsSource = null;
|
this.dataGridWasteReceived.ItemsSource = null;
|
||||||
dataGridWasteReceipt_SelectionChanged(this, null);
|
dataGridWasteReceipt_SelectionChanged(this, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataGridWasteReceipt_DeleteRequested(DatabaseEntity obj)
|
private void DataGridWasteReceipt_DeleteRequested(DatabaseEntity obj)
|
||||||
@ -264,7 +258,6 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridWasteReceipt.Items.Refresh();
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
dataGridWasteReceipt_SelectionChanged(this, null);
|
dataGridWasteReceipt_SelectionChanged(this, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataGridWasteReceipt_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
private void DataGridWasteReceipt_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
@ -289,8 +282,7 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
if (obj is WasteReceived wasteReceived)
|
if (obj is WasteReceived wasteReceived)
|
||||||
{
|
{
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
// are you sure dialog is in base class
|
// are you sure dialog is in base class
|
||||||
_selectedWAS_RCPT.WasteReceived.Remove(wasteReceived);
|
_selectedWAS_RCPT.WasteReceived.Remove(wasteReceived);
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(wasteReceived);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(wasteReceived);
|
||||||
@ -302,9 +294,6 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridWasteReceived_CreateRequested()
|
private void DataGridWasteReceived_CreateRequested()
|
||||||
{
|
{
|
||||||
if (_selectedWAS_RCPT == null) return;
|
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
||||||
ewrd.WasteReceived = new WasteReceived();
|
ewrd.WasteReceived = new WasteReceived();
|
||||||
ewrd.WasteReceived.WAS_RCPT = _selectedWAS_RCPT;
|
ewrd.WasteReceived.WAS_RCPT = _selectedWAS_RCPT;
|
||||||
@ -313,7 +302,7 @@ namespace ENI2.DetailViewControls
|
|||||||
ewrd.AddClicked += () =>
|
ewrd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ewrd.CopyValuesToEntity();
|
ewrd.CopyValuesToEntity();
|
||||||
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
if (!this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
{
|
{
|
||||||
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
this.dataGridWasteReceived.Items.Refresh();
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
@ -326,7 +315,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
if (ewrd.ShowDialog() ?? false)
|
if (ewrd.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
if (!this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
{
|
{
|
||||||
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
this.dataGridWasteReceived.Items.Refresh();
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
@ -338,16 +327,13 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridWasteReceived_EditRequested(DatabaseEntity obj)
|
private void DataGridWasteReceived_EditRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
this.dataGridWasteReceived.CancelEdit();
|
|
||||||
|
|
||||||
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
||||||
ewrd.WasteReceived = obj as WasteReceived;
|
ewrd.WasteReceived = obj as WasteReceived;
|
||||||
|
|
||||||
ewrd.AddClicked += () =>
|
ewrd.AddClicked += () =>
|
||||||
{
|
{
|
||||||
ewrd.CopyValuesToEntity();
|
ewrd.CopyValuesToEntity();
|
||||||
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
if (!this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
{
|
{
|
||||||
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
this.dataGridWasteReceived.Items.Refresh();
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
@ -360,7 +346,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
if (ewrd.ShowDialog() ?? false)
|
if (ewrd.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
if ((ewrd.WasteReceived.WasteCode != null) && !_selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
if (!_selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
{
|
{
|
||||||
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
}
|
}
|
||||||
@ -476,52 +462,124 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region mouse wheel
|
||||||
|
|
||||||
|
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||||
|
{
|
||||||
|
ScrollViewer scv = (ScrollViewer)sender;
|
||||||
|
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Excel file import
|
#region Excel file import
|
||||||
|
|
||||||
private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e)
|
private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int importWasteListCnt = ExcelLocalImportHelper.ImportWaste(_was);
|
OpenFileDialog ofd = new OpenFileDialog();
|
||||||
|
ofd.Filter = "Excel Files|*.xls;*.xlsx";
|
||||||
|
if (ofd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
FileStream stream;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (importWasteListCnt > 0)
|
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<Waste> importWasteList = new List<Waste>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// skip first three rows
|
||||||
|
reader.Read();
|
||||||
|
reader.Read();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
int cnt = 0;
|
||||||
|
object o = null;
|
||||||
|
|
||||||
|
// Diese Funktion kann das "alte" Sheet Format nicht mehr einlesen!
|
||||||
|
|
||||||
|
while (reader.Read() && (cnt < 35))
|
||||||
|
{
|
||||||
|
if (reader.FieldCount < 9)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 9 Columns of data");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(1)) o = reader.GetValue(1); else o = null;
|
||||||
|
if ((o != null) && Int32.TryParse(o.ToString(), out int wasteType))
|
||||||
|
{
|
||||||
|
Waste waste = _was.GetWasteForType(wasteType);
|
||||||
|
if (waste == null)
|
||||||
|
{
|
||||||
|
waste = new Waste();
|
||||||
|
waste.WasteType = wasteType;
|
||||||
|
waste.WAS = this._was;
|
||||||
|
waste.IsDirty = true;
|
||||||
|
waste.Identifier = Waste.GetNewIdentifier(this._was.Waste);
|
||||||
|
this._was.Waste.Add(waste);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
waste.IsDirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(4)) waste.WasteDescription = reader.GetString(4);
|
||||||
|
if (waste.WasteDescription.IsNullOrEmpty())
|
||||||
|
waste.WasteDescription = "-";
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(5)) o = reader.GetValue(5); else o = null;
|
||||||
|
if (o != null) waste.WasteDisposalAmount_MTQ = Convert.ToDouble(o);
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(6)) o = reader.GetValue(6); else o = null;
|
||||||
|
if (o != null) waste.WasteCapacity_MTQ = Convert.ToDouble(o);
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(7)) o = reader.GetValue(7); else o = null;
|
||||||
|
if (o != null) waste.WasteAmountRetained_MTQ = Convert.ToDouble(o);
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(8)) waste.WasteDisposalPort = reader.GetString(8);
|
||||||
|
|
||||||
|
if (!reader.IsDBNull(9)) o = reader.GetValue(9); else o = null;
|
||||||
|
if (o != null) waste.WasteAmountGeneratedTillNextPort_MTQ = Convert.ToDouble(o);
|
||||||
|
|
||||||
|
importWasteList.Add(waste);
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importWasteList.Count > 0)
|
||||||
{
|
{
|
||||||
this.dataGridWaste.Items.Refresh();
|
this.dataGridWaste.Items.Refresh();
|
||||||
this.SublistElementChanged(Message.NotificationClass.WAS);
|
this.SublistElementChanged(Message.NotificationClass.WAS);
|
||||||
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteListCnt), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteList.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Copy WAS to WAS_RCPT handler
|
|
||||||
|
|
||||||
private void buttonCopyFromWAS_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (_selectedWAS_RCPT == null) return;
|
|
||||||
|
|
||||||
if(MessageBox.Show(Properties.Resources.textCopyToWASConfirmation, Properties.Resources.textConfirmation,
|
|
||||||
MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
foreach(Waste waste in _was.Waste)
|
|
||||||
{
|
|
||||||
if(waste.WasteDisposalAmount_MTQ.HasValue && waste.WasteDisposalAmount_MTQ > 0)
|
|
||||||
{
|
|
||||||
// find matching WAS_RCPT entry
|
|
||||||
foreach(WasteReceived wasteReceived in _selectedWAS_RCPT.WasteReceived)
|
|
||||||
{
|
|
||||||
if(wasteReceived.WasteCode.Equals(waste.WasteType.ToString()))
|
|
||||||
{
|
|
||||||
wasteReceived.AmountWasteReceived_MTQ = waste.WasteDisposalAmount_MTQ;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.dataGridWasteReceived.Items.Refresh();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
398
ENI2/ENI2.csproj
398
ENI2/ENI2.csproj
@ -8,8 +8,8 @@
|
|||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>ENI2</RootNamespace>
|
<RootNamespace>ENI2</RootNamespace>
|
||||||
<AssemblyName>ENI2Test</AssemblyName>
|
<AssemblyName>ENI2</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
@ -36,8 +36,8 @@
|
|||||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
<WebPage>publish.html</WebPage>
|
<WebPage>publish.html</WebPage>
|
||||||
<ApplicationRevision>2</ApplicationRevision>
|
<ApplicationRevision>3</ApplicationRevision>
|
||||||
<ApplicationVersion>7.2.14.2</ApplicationVersion>
|
<ApplicationVersion>7.1.0.3</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
@ -62,8 +62,7 @@
|
|||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>0</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>ENI2.App</StartupObject>
|
<StartupObject>ENI2.App</StartupObject>
|
||||||
@ -85,13 +84,14 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestCertificateThumbprint>C5FD306818D481FBECE3B2E74D7A912F515191E0</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>94D98790E3B6C4CC9F4B57C8FD305E3225894DF8</ManifestCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>true</SignManifests>
|
<SignManifests>true</SignManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestKeyFile>ENI2_7_TemporaryKey.pfx</ManifestKeyFile>
|
<ManifestKeyFile>
|
||||||
|
</ManifestKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 64|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug 64|AnyCPU'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -134,132 +134,43 @@
|
|||||||
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>..\code.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ClosedXML, Version=0.105.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
|
<Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\ClosedXML.0.105.0\lib\netstandard2.0\ClosedXML.dll</HintPath>
|
<HintPath>packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ClosedXML.Parser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d5f7376574c51ec, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\ClosedXML.Parser.2.0.0\lib\netstandard2.0\ClosedXML.Parser.dll</HintPath>
|
<HintPath>packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DocumentFormat.OpenXml, Version=3.3.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\DocumentFormat.OpenXml.3.3.0\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
|
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
|
||||||
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.3.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
|
<Reference Include="MigraDoc.DocumentObjectModel-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\DocumentFormat.OpenXml.Framework.3.3.0\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.DocumentObjectModel-gdi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ExcelNumberFormat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
|
<Reference Include="MigraDoc.Rendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\ExcelNumberFormat.1.1.0\lib\net20\ExcelNumberFormat.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.Rendering-gdi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="log4net, Version=3.2.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="MigraDoc.RtfRendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\log4net.3.2.0\lib\net462\log4net.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.RtfRendering-gdi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="PdfSharp-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.10.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp-gdi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Bcl.Cryptography, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="PdfSharp.Charting-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Bcl.Cryptography.10.0.0\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp.Charting-gdi.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Bcl.HashCode, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Bcl.HashCode.6.0.0\lib\net462\Microsoft.Bcl.HashCode.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.DependencyInjection.10.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.10.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.Logging, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.Logging.10.0.0\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.10.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.Options, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.Options.10.0.0\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.Extensions.Primitives, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\Microsoft.Extensions.Primitives.10.0.0\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MigraDoc.DocumentObjectModel, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp-MigraDoc.6.2.3\lib\netstandard2.0\MigraDoc.DocumentObjectModel.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MigraDoc.Rendering, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp-MigraDoc.6.2.3\lib\netstandard2.0\MigraDoc.Rendering.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MigraDoc.RtfRendering, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp-MigraDoc.6.2.3\lib\netstandard2.0\MigraDoc.RtfRendering.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.BarCodes, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.BarCodes.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.Charting, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.Charting.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.Cryptography, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.Cryptography.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.Quality, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.Quality.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.Shared, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.Shared.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.Snippets, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.Snippets.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.System, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.System.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PdfSharp.WPFonts, Version=6.2.3.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\PDFsharp.6.2.3\lib\netstandard2.0\PdfSharp.WPFonts.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RBush, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c77e27b81f4d0187, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\RBush.Signed.4.0.0\lib\net47\RBush.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\SixLabors.Fonts.1.0.0\lib\netstandard2.0\SixLabors.Fonts.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite, Version=1.0.115.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>
|
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Diagnostics.DiagnosticSource.10.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Formats.Asn1, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Formats.Asn1.10.0.0\lib\net462\System.Formats.Asn1.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Numerics" />
|
|
||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.Security" />
|
|
||||||
<Reference Include="System.Security.Cryptography.Pkcs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Security.Cryptography.Pkcs.10.0.0\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.ServiceModel.Web" />
|
<Reference Include="System.ServiceModel.Web" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@ -274,20 +185,20 @@
|
|||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.3.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
<HintPath>packages\Extended.Wpf.Toolkit.4.3.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.3.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>
|
<HintPath>packages\Extended.Wpf.Toolkit.4.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.3.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>
|
<HintPath>packages\Extended.Wpf.Toolkit.4.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.3.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>
|
<HintPath>packages\Extended.Wpf.Toolkit.4.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.Toolkit, Version=5.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.Toolkit, Version=4.3.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Extended.Wpf.Toolkit.5.0.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
<HintPath>packages\Extended.Wpf.Toolkit.4.3.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -307,62 +218,29 @@
|
|||||||
<Compile Include="..\bsmd.ExcelReadService\LocodeDB.cs">
|
<Compile Include="..\bsmd.ExcelReadService\LocodeDB.cs">
|
||||||
<Link>Locode\LocodeDB.cs</Link>
|
<Link>Locode\LocodeDB.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Controls\BusyControl.xaml.cs">
|
|
||||||
<DependentUpon>BusyControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Controls\ClosableTabItem.cs" />
|
<Compile Include="Controls\ClosableTabItem.cs" />
|
||||||
<Compile Include="Controls\ConditionGroupControl.xaml.cs">
|
<Compile Include="Controls\ConditionGroupControl.xaml.cs">
|
||||||
<DependentUpon>ConditionGroupControl.xaml</DependentUpon>
|
<DependentUpon>ConditionGroupControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Controls\EasyPeasyControl.xaml.cs">
|
|
||||||
<DependentUpon>EasyPeasyControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Controls\EditWindowBase.cs" />
|
<Compile Include="Controls\EditWindowBase.cs" />
|
||||||
<Compile Include="Controls\ENIDataGrid.cs" />
|
<Compile Include="Controls\ENIDataGrid.cs" />
|
||||||
<Compile Include="Controls\IHighlightControlContainer.cs" />
|
<Compile Include="Controls\IHighlightControlContainer.cs" />
|
||||||
<Compile Include="Controls\LocodeControl.xaml.cs">
|
<Compile Include="Controls\LocodeControl.xaml.cs">
|
||||||
<DependentUpon>LocodeControl.xaml</DependentUpon>
|
<DependentUpon>LocodeControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Controls\MaerskOverviewControl.xaml.cs">
|
|
||||||
<DependentUpon>MaerskOverviewControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Controls\ValueMappingsControl.xaml.cs">
|
|
||||||
<DependentUpon>ValueMappingsControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\ChangePasswordDialog.xaml.cs">
|
|
||||||
<DependentUpon>ChangePasswordDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\CompareExcelDialog.xaml.cs">
|
|
||||||
<DependentUpon>CompareExcelDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\EditWasteReceiptDialog.xaml.cs">
|
<Compile Include="EditControls\EditWasteReceiptDialog.xaml.cs">
|
||||||
<DependentUpon>EditWasteReceiptDialog.xaml</DependentUpon>
|
<DependentUpon>EditWasteReceiptDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="EditControls\EditWasteReceivedDialog.xaml.cs">
|
<Compile Include="EditControls\EditWasteReceivedDialog.xaml.cs">
|
||||||
<DependentUpon>EditWasteReceivedDialog.xaml</DependentUpon>
|
<DependentUpon>EditWasteReceivedDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="EditControls\FixImportDialog.xaml.cs">
|
|
||||||
<DependentUpon>FixImportDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\NewDGItemDialog.xaml.cs">
|
|
||||||
<DependentUpon>NewDGItemDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\SelectCrewMemberDialog.xaml.cs">
|
|
||||||
<DependentUpon>SelectCrewMemberDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="EditControls\SelectPortAreaDialog.xaml.cs">
|
|
||||||
<DependentUpon>SelectPortAreaDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Excel\DakosyUtil.cs" />
|
<Compile Include="Excel\DakosyUtil.cs" />
|
||||||
<Compile Include="Excel\ExcelBase.cs" />
|
<Compile Include="Excel\ExcelBase.cs" />
|
||||||
<Compile Include="Excel\ExcelComparer.cs" />
|
|
||||||
<Compile Include="Excel\ExcelLocalImportHelper.cs" />
|
|
||||||
<Compile Include="Excel\ExcelManager.cs" />
|
<Compile Include="Excel\ExcelManager.cs" />
|
||||||
<Compile Include="Excel\ExcelReader.cs" />
|
<Compile Include="Excel\ExcelReader.cs" />
|
||||||
<Compile Include="Excel\ExcelSimpleWriter.cs" />
|
|
||||||
<Compile Include="Excel\ExcelUtil.cs" />
|
<Compile Include="Excel\ExcelUtil.cs" />
|
||||||
<Compile Include="Controls\MaerskListControl.xaml.cs">
|
<Compile Include="Controls\POListControl.xaml.cs">
|
||||||
<DependentUpon>MaerskListControl.xaml</DependentUpon>
|
<DependentUpon>POListControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Controls\ReportingPartyControl.xaml.cs">
|
<Compile Include="Controls\ReportingPartyControl.xaml.cs">
|
||||||
<DependentUpon>ReportingPartyControl.xaml</DependentUpon>
|
<DependentUpon>ReportingPartyControl.xaml</DependentUpon>
|
||||||
@ -533,42 +411,6 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="SheetDisplayControls\ATAControl.xaml.cs">
|
|
||||||
<DependentUpon>ATAControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\CrewDepartureControl.xaml.cs">
|
|
||||||
<DependentUpon>CrewDepartureControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\CrewPreArrivalControl.xaml.cs">
|
|
||||||
<DependentUpon>CrewPreArrivalControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\DangerousCargoControl.xaml.cs">
|
|
||||||
<DependentUpon>DangerousCargoControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\PassengerDepartureControl.xaml.cs">
|
|
||||||
<DependentUpon>PassengerDepartureControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\PassengerPreArrivalControl.xaml.cs">
|
|
||||||
<DependentUpon>PassengerPreArrivalControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\PortControl.xaml.cs">
|
|
||||||
<DependentUpon>PortControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\PreArrivalControl.xaml.cs">
|
|
||||||
<DependentUpon>PreArrivalControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\PreDepartureControl.xaml.cs">
|
|
||||||
<DependentUpon>PreDepartureControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\ShipDataControl.xaml.cs">
|
|
||||||
<DependentUpon>ShipDataControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\VoyageControl.xaml.cs">
|
|
||||||
<DependentUpon>VoyageControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SheetDisplayControls\WasteReceiptsControl.xaml.cs">
|
|
||||||
<DependentUpon>WasteReceiptsControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SplashScreenWindow.xaml.cs">
|
<Compile Include="SplashScreenWindow.xaml.cs">
|
||||||
<DependentUpon>SplashScreenWindow.xaml</DependentUpon>
|
<DependentUpon>SplashScreenWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -577,51 +419,35 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Util\BoolToVisibilityConverter.cs" />
|
<Compile Include="Util\BoolToVisibilityConverter.cs" />
|
||||||
<Compile Include="Util\ByteConverter.cs" />
|
<Compile Include="Util\ByteConverter.cs" />
|
||||||
<Compile Include="Util\CutoffConverter.cs" />
|
|
||||||
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
|
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
|
||||||
<Compile Include="Util\EasyPeasyState.cs" />
|
|
||||||
<Compile Include="Util\EnumHelper.cs" />
|
<Compile Include="Util\EnumHelper.cs" />
|
||||||
<Compile Include="Util\EnumToBooleanConverter.cs" />
|
<Compile Include="Util\EnumToBooleanConverter.cs" />
|
||||||
<Compile Include="Util\EnumToCollectionConverter.cs" />
|
<Compile Include="Util\EnumToCollectionConverter.cs" />
|
||||||
<Compile Include="Util\ExpandableListConverter.cs" />
|
<Compile Include="Util\ExpandableListConverter.cs" />
|
||||||
<Compile Include="Util\Extensions.cs" />
|
|
||||||
<Compile Include="Util\GlobalStructures.cs" />
|
<Compile Include="Util\GlobalStructures.cs" />
|
||||||
<Compile Include="Util\HighlightService.cs" />
|
<Compile Include="Util\HighlightService.cs" />
|
||||||
<Compile Include="Util\InverseBooleanConverter.cs" />
|
<Compile Include="Util\InverseBooleanConverter.cs" />
|
||||||
<Compile Include="Util\NullImageConverter.cs" />
|
<Compile Include="Util\NullImageConverter.cs" />
|
||||||
<Compile Include="Util\NumberValidationRule.cs" />
|
|
||||||
<Compile Include="Util\SettingBindingExtension.cs" />
|
|
||||||
<Compile Include="Util\StringValidationRule.cs" />
|
|
||||||
<Compile Include="Util\TrimStringConverter.cs" />
|
|
||||||
<Compile Include="Util\UIHelper.cs" />
|
<Compile Include="Util\UIHelper.cs" />
|
||||||
<Compile Include="Util\UtcToLocalDateTimeConverter.cs" />
|
<Compile Include="Util\UtcToLocalDateTimeConverter.cs" />
|
||||||
<Compile Include="Util\ValidationContext.cs" />
|
<Compile Include="Util\ValidationContext.cs" />
|
||||||
|
<Compile Include="VorgaengeControl.xaml.cs">
|
||||||
|
<DependentUpon>VorgaengeControl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="WindowPlacement.cs" />
|
<Compile Include="WindowPlacement.cs" />
|
||||||
<Page Include="AnmeldungenControl.xaml">
|
<Page Include="AnmeldungenControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Controls\BusyControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Controls\ConditionGroupControl.xaml">
|
<Page Include="Controls\ConditionGroupControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Controls\EasyPeasyControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Controls\LocodeControl.xaml">
|
<Page Include="Controls\LocodeControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Controls\MaerskOverviewControl.xaml">
|
<Page Include="Controls\POListControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Controls\MaerskListControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
@ -641,10 +467,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Controls\ValueMappingsControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="ControlTemplates.xaml">
|
<Page Include="ControlTemplates.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -709,14 +531,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="EditControls\ChangePasswordDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\CompareExcelDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\CopyDeclarationDialog.xaml">
|
<Page Include="EditControls\CopyDeclarationDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -821,10 +635,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="EditControls\FixImportDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\MessageHistoryDialog.xaml">
|
<Page Include="EditControls\MessageHistoryDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -833,26 +643,14 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="EditControls\NewDGItemDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\NewWithIdDialog.xaml">
|
<Page Include="EditControls\NewWithIdDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="EditControls\SelectCrewMemberDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\SelectImportClassesDialog.xaml">
|
<Page Include="EditControls\SelectImportClassesDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="EditControls\SelectPortAreaDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="EditControls\ShowIdDialog.xaml">
|
<Page Include="EditControls\ShowIdDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -888,54 +686,6 @@
|
|||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="SheetDisplayControls\ATAControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\CrewDepartureControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\CrewPreArrivalControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\DangerousCargoControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\PassengerDepartureControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\PassengerPreArrivalControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\PortControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\PreArrivalControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\PreDepartureControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\ShipDataControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\VoyageControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SheetDisplayControls\WasteReceiptsControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="SplashScreenWindow.xaml">
|
<Page Include="SplashScreenWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -948,6 +698,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="VorgaengeControl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
@ -963,6 +717,10 @@
|
|||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Content Include="..\misc\Logo.gif">
|
||||||
|
<Link>Report\Logo.gif</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="..\misc\report.db">
|
<Content Include="..\misc\report.db">
|
||||||
<Link>report.db</Link>
|
<Link>report.db</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
@ -980,9 +738,6 @@
|
|||||||
<None Include="ENI2_3_TemporaryKey.pfx" />
|
<None Include="ENI2_3_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_4_TemporaryKey.pfx" />
|
<None Include="ENI2_4_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_5_TemporaryKey.pfx" />
|
<None Include="ENI2_5_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_6_TemporaryKey.pfx" />
|
|
||||||
<None Include="ENI2_7_TemporaryKey.pfx" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Service References\LockingServiceReference\ENI2.LockingServiceReference.CoreLock.datasource">
|
<None Include="Service References\LockingServiceReference\ENI2.LockingServiceReference.CoreLock.datasource">
|
||||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
@ -1021,10 +776,10 @@
|
|||||||
<None Include="Resources\lightbulb_on.png" />
|
<None Include="Resources\lightbulb_on.png" />
|
||||||
<None Include="Resources\rotate_left.png" />
|
<None Include="Resources\rotate_left.png" />
|
||||||
<Resource Include="Resources\sign_warning.png" />
|
<Resource Include="Resources\sign_warning.png" />
|
||||||
<Resource Include="Resources\trafficlight_green.png" />
|
<None Include="Resources\trafficlight_green.png" />
|
||||||
<Resource Include="Resources\trafficlight_off.png" />
|
<None Include="Resources\trafficlight_off.png" />
|
||||||
<Resource Include="Resources\trafficlight_red.png" />
|
<None Include="Resources\trafficlight_red.png" />
|
||||||
<Resource Include="Resources\trafficlight_yellow.png" />
|
<None Include="Resources\trafficlight_yellow.png" />
|
||||||
<None Include="Resources\user_edit.png" />
|
<None Include="Resources\user_edit.png" />
|
||||||
<Resource Include="Resources\delete2.png" />
|
<Resource Include="Resources\delete2.png" />
|
||||||
<None Include="Resources\mail_new.png" />
|
<None Include="Resources\mail_new.png" />
|
||||||
@ -1058,22 +813,6 @@
|
|||||||
<Resource Include="Resources\Logo.gif" />
|
<Resource Include="Resources\Logo.gif" />
|
||||||
<Resource Include="Resources\excel.png" />
|
<Resource Include="Resources\excel.png" />
|
||||||
<Resource Include="Resources\logo_eni.png" />
|
<Resource Include="Resources\logo_eni.png" />
|
||||||
<Resource Include="Resources\import1.png" />
|
|
||||||
<Resource Include="Resources\import2.png" />
|
|
||||||
<Resource Include="Resources\about.png" />
|
|
||||||
<Resource Include="Resources\document_into.png" />
|
|
||||||
<Resource Include="Resources\document_plain_new.png" />
|
|
||||||
<Resource Include="Resources\exit.png" />
|
|
||||||
<Resource Include="Resources\document_exchange.png" />
|
|
||||||
<Resource Include="Resources\arrival_user.png" />
|
|
||||||
<Resource Include="Resources\arrival_worker.png" />
|
|
||||||
<Resource Include="Resources\departure_user.png" />
|
|
||||||
<Resource Include="Resources\departure_worker.png" />
|
|
||||||
<Resource Include="Resources\clock.png" />
|
|
||||||
<Content Include="Report\Logo.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Resource Include="Resources\pencil.png" />
|
|
||||||
<Content Include="x64\SQLite.Interop.dll">
|
<Content Include="x64\SQLite.Interop.dll">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@ -1100,6 +839,7 @@
|
|||||||
</Content>
|
</Content>
|
||||||
<None Include="bsmdKey.snk" />
|
<None Include="bsmdKey.snk" />
|
||||||
<None Include="ENI2.licenseheader" />
|
<None Include="ENI2.licenseheader" />
|
||||||
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\app.manifest" />
|
<None Include="Properties\app.manifest" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
@ -1122,9 +862,9 @@
|
|||||||
<Resource Include="Resources\containership.ico" />
|
<Resource Include="Resources\containership.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
|
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
@ -1208,31 +948,15 @@
|
|||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- Find Windows Kit path and then SignTool path for the post-build event -->
|
<PostBuildEvent>"C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool" sign /f $(ProjectDir)\..\misc\codesigning.pfx /p t5bj2dk9ifdIWBPhPra4U $(TargetPath)</PostBuildEvent>
|
||||||
<WindowsKitsRoot>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot10', null, RegistryView.Registry32, RegistryView.Default))</WindowsKitsRoot>
|
|
||||||
<WindowsKitsRoot Condition="'$(WindowsKitsRoot)' == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot81', null, RegistryView.Registry32, RegistryView.Default))</WindowsKitsRoot>
|
|
||||||
<WindowsKitsRoot Condition="'$(WindowsKitsRoot)' == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot', null, RegistryView.Registry32, RegistryView.Default))</WindowsKitsRoot>
|
|
||||||
<SignToolPath Condition="'$(SignToolPath)' == '' And '$(Platform)' == 'AnyCPU' and Exists('$(WindowsKitsRoot)bin\x64\signtool.exe')">$(WindowsKitsRoot)bin\x64\</SignToolPath>
|
|
||||||
<SignToolPath Condition="'$(SignToolPath)' == '' And Exists('$(WindowsKitsRoot)bin\$(Platform)\signtool.exe')">$(WindowsKitsRoot)bin\$(Platform)\</SignToolPath>
|
|
||||||
<SignToolPathBin Condition="'$(SignToolPath)' == ''">$([System.IO.Directory]::GetDirectories('$(WindowsKitsRoot)bin',"10.0.*"))</SignToolPathBin>
|
|
||||||
<SignToolPathLen Condition="'$(SignToolPathBin)' != ''">$(SignToolPathBin.Split(';').Length)</SignToolPathLen>
|
|
||||||
<SignToolPathIndex Condition="'$(SignToolPathLen)' != ''">$([MSBuild]::Add(-1, $(SignToolPathLen)))</SignToolPathIndex>
|
|
||||||
<SignToolPathBase Condition="'$(SignToolPathIndex)' != ''">$(SignToolPathBin.Split(';').GetValue($(SignToolPathIndex)))\</SignToolPathBase>
|
|
||||||
<SignToolPath Condition="'$(SignToolPath)' == '' And '$(SignToolPathBase)' != '' And '$(Platform)' == 'AnyCPU'">$(SignToolPathBase)x64\</SignToolPath>
|
|
||||||
<SignToolPath Condition="'$(SignToolPath)' == '' And '$(SignToolPathBase)' != ''">$(SignToolPathBase)$(Platform)\</SignToolPath>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<Import Project="packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
|
||||||
<PostBuildEvent>"$(SignToolPath)signtool.exe" sign /f $(ProjectDir)\ENI2_7_TemporaryKey.pfx /p FgrMFUWsTVGQeb6L6i0e /fd SHA256 $(TargetPath)</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<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>
|
<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>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
|
<Error Condition="!Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
|
||||||
<Error Condition="!Exists('packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
|
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.ChangePasswordDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Change password" Height="243" Width="400" Loaded="EditWindowBase_Loaded" Background="AliceBlue">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width=".4*" />
|
|
||||||
<ColumnDefinition Width=".6*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="Name" />
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textOldPassword}" />
|
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNewPassword}" />
|
|
||||||
<Label Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textRepeatNewPassword}" />
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" x:Name="textBlockName" VerticalAlignment="Center" FontWeight="DemiBold"/>
|
|
||||||
<PasswordBox Grid.Row="1" Grid.Column="1" x:Name="textBoxOldPassword" Margin="2" VerticalContentAlignment="Center" />
|
|
||||||
<PasswordBox Grid.Row="2" Grid.Column="1" x:Name="textBoxNew1Password" Margin="2" VerticalContentAlignment="Center" />
|
|
||||||
<PasswordBox Grid.Row="3" Grid.Column="1" x:Name="textBoxNew2Password" Margin="2" VerticalContentAlignment="Center" />
|
|
||||||
<Label Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textDefaultDisplay}" />
|
|
||||||
<ComboBox x:Name="comboBoxDefaultDisplay" Grid.Column="1" Grid.Row="4" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="False" />
|
|
||||||
<Button Grid.Row="5" Grid.Column="1" Content="Change" Name="buttonChangePassword" Margin="2" Width="80" HorizontalAlignment="Left" Click="buttonChangePassword_Click"/>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</enictrl:EditWindowBase>
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
|
||||||
// Description: Users may change their password
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ENI2.Controls;
|
|
||||||
using System;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for ChangePasswordDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ChangePasswordDialog : EditWindowBase
|
|
||||||
{
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public ChangePasswordDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public ReportingParty CurrentUser { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region event handler
|
|
||||||
|
|
||||||
private void buttonChangePassword_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
bool success = false;
|
|
||||||
string message = "";
|
|
||||||
if (!textBoxOldPassword.Password.IsNullOrEmpty() || !textBoxNew1Password.Password.IsNullOrEmpty() || !textBoxNew2Password.Password.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
if (!textBoxOldPassword.Password.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
if (CurrentUser.GetHash(textBoxOldPassword.Password).Equals(CurrentUser.PasswordHash))
|
|
||||||
{
|
|
||||||
if (textBoxNew1Password.Password.IsNullOrEmpty() ||
|
|
||||||
textBoxNew2Password.Password.IsNullOrEmpty() ||
|
|
||||||
!textBoxNew1Password.Password.Equals(textBoxNew2Password.Password))
|
|
||||||
{
|
|
||||||
message = "New passwords are empty or do not match";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (textBoxOldPassword.Password.Equals(textBoxNew1Password.Password))
|
|
||||||
{
|
|
||||||
message = "Old and new password are the same";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CurrentUser.SetPassword(textBoxNew1Password.Password);
|
|
||||||
success = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "Old password is not correct";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "Old password empty";
|
|
||||||
}
|
|
||||||
if (!success)
|
|
||||||
MessageBox.Show(message, "Changing password failed", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
else
|
|
||||||
MessageBox.Show("Password successfully changed.", "Password changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
}
|
|
||||||
// user may have changed combobox default display value so we are saving anyway here
|
|
||||||
this.CurrentUser.ShipcallDisplayMode = (ReportingParty.ShipcallDisplayModeEnum)Enum.Parse(typeof(ReportingParty.ShipcallDisplayModeEnum), (string)this.comboBoxDefaultDisplay.SelectedValue);
|
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(CurrentUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.textBlockName.Text = CurrentUser.Logon;
|
|
||||||
this.AddVisible = false;
|
|
||||||
this.OkVisible = false;
|
|
||||||
var cancelButton = (Button)Template.FindName("buttonCancel", this);
|
|
||||||
cancelButton.Content = "Close";
|
|
||||||
this.comboBoxDefaultDisplay.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(ReportingParty.ShipcallDisplayModeEnum));
|
|
||||||
this.comboBoxDefaultDisplay.SelectedValue = this.CurrentUser.ShipcallDisplayMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
<enictrl:StatusWindowBase x:Class="ENI2.EditControls.CompareExcelDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:ENI2.EditControls"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns: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">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="32" />
|
|
||||||
<RowDefinition Height="60" />
|
|
||||||
<RowDefinition Height="60" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" HorizontalAlignment="Center" TextAlignment="Center">Drop your Excel file here</TextBlock>
|
|
||||||
<Label VerticalAlignment="Center" Grid.Row="1" Grid.Column="0">
|
|
||||||
<AccessText TextWrapping="Wrap">
|
|
||||||
First (original) sheet
|
|
||||||
</AccessText>
|
|
||||||
</Label>
|
|
||||||
<Image x:Name="imageSource" Grid.Row="1" Grid.Column="1" Margin="4" Source="../Resources/import2.png" AllowDrop="True" Drop="imageSource_Drop" DragEnter="imageSource_DragEnter"/>
|
|
||||||
<TextBox TextWrapping="Wrap" x:Name="textBoxSource" Grid.Row="1" Grid.Column="2" IsReadOnly="True" Margin="2" Drop="imageSource_Drop" AllowDrop="True" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver" PreviewMouseDown="textBoxSource_PreviewMouseDown"/>
|
|
||||||
|
|
||||||
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0">
|
|
||||||
<AccessText TextWrapping="Wrap">
|
|
||||||
Second (updated) sheet
|
|
||||||
</AccessText>
|
|
||||||
</Label>
|
|
||||||
<Image x:Name="imageTarget" Grid.Row="2" Grid.Column="1" Margin="4" Source="../Resources/import1.png" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter"/>
|
|
||||||
<TextBox TextWrapping="Wrap" x:Name="textBoxTarget" Grid.Row="2" Grid.Column="2" IsReadOnly="True" Margin="2" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver" PreviewMouseDown="textBoxTarget_PreviewMouseDown"/>
|
|
||||||
|
|
||||||
<Button x:Name="buttonCompare" Margin="2" Grid.Row="3" Grid.Column="1" Content="Compare" IsEnabled="False" Click="buttonCompare_Click"/>
|
|
||||||
</Grid>
|
|
||||||
</enictrl:StatusWindowBase>
|
|
||||||
@ -1,246 +0,0 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
|
||||||
// Description: Dialogbox zum Vergleichen zweier Excel via Named cells
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for CompareExcelDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class CompareExcelDialog : Controls.StatusWindowBase
|
|
||||||
{
|
|
||||||
|
|
||||||
#region Fields
|
|
||||||
private string _sourcePath = null;
|
|
||||||
private string _targetPath = null;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public CompareExcelDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Drag&Drop event handler
|
|
||||||
|
|
||||||
private void imageSource_Drop(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
|
|
||||||
if (files != null)
|
|
||||||
{
|
|
||||||
foreach (string file in files)
|
|
||||||
Console.WriteLine(file);
|
|
||||||
if (files.Length > 0)
|
|
||||||
{
|
|
||||||
if (File.Exists(files[0]))
|
|
||||||
{
|
|
||||||
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
|
||||||
{
|
|
||||||
_sourcePath = files[0];
|
|
||||||
textBoxSource.Text = _sourcePath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textBoxSource.Text = null;
|
|
||||||
_sourcePath = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textBoxSource.Text = null;
|
|
||||||
_sourcePath = null;
|
|
||||||
}
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string link = (string)e.Data.GetData(DataFormats.Text);
|
|
||||||
if(link != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
using (var client = new WebClient())
|
|
||||||
{
|
|
||||||
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
|
||||||
client.DownloadFile(link, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
// check if it is really an url, try to download the file and open it
|
|
||||||
if (Uri.TryCreate(link, UriKind.Absolute, out Uri uri))
|
|
||||||
{
|
|
||||||
HttpClient client = new HttpClient();
|
|
||||||
var response = await client.GetAsync(uri);
|
|
||||||
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
|
||||||
using (var fs = new FileStream(fileName, FileMode.CreateNew))
|
|
||||||
{
|
|
||||||
await response.Content.CopyToAsync(fs);
|
|
||||||
textBoxSource.Text = link;
|
|
||||||
_sourcePath = fileName;
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void imageTarget_Drop(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
|
||||||
if (files != null)
|
|
||||||
{
|
|
||||||
foreach (string file in files)
|
|
||||||
Console.WriteLine(file);
|
|
||||||
if (files.Length > 0)
|
|
||||||
{
|
|
||||||
if (File.Exists(files[0]))
|
|
||||||
{
|
|
||||||
if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
|
|
||||||
{
|
|
||||||
_targetPath = files[0];
|
|
||||||
textBoxTarget.Text = _targetPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_targetPath = null;
|
|
||||||
textBoxTarget.Text = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_targetPath = null;
|
|
||||||
textBoxTarget.Text = null;
|
|
||||||
}
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string link = (string)e.Data.GetData(DataFormats.Text);
|
|
||||||
if (link != null)
|
|
||||||
{
|
|
||||||
// check if it is really an url, try to download the file and open it
|
|
||||||
if (Uri.TryCreate(link, UriKind.Absolute, out Uri uri))
|
|
||||||
{
|
|
||||||
HttpClient client = new HttpClient();
|
|
||||||
var response = await client.GetAsync(uri);
|
|
||||||
string fileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx";
|
|
||||||
using (var fs = new FileStream(fileName, FileMode.CreateNew))
|
|
||||||
{
|
|
||||||
await response.Content.CopyToAsync(fs);
|
|
||||||
textBoxTarget.Text = link;
|
|
||||||
_targetPath = fileName;
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void imageSource_DragEnter(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
|
||||||
{
|
|
||||||
e.Effects = DragDropEffects.Copy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSource_PreviewDragOver(object sender, DragEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region private methods
|
|
||||||
|
|
||||||
private void EnableCompareButton()
|
|
||||||
{
|
|
||||||
this.buttonCompare.IsEnabled = (_targetPath != null) && (_sourcePath != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Comparison button handler logic
|
|
||||||
|
|
||||||
private void buttonCompare_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Util.UIHelper.SetBusyState();
|
|
||||||
|
|
||||||
string defaultName = string.Format("{0}.xlsx", Guid.NewGuid().ToString());
|
|
||||||
SaveFileDialog sfd = new SaveFileDialog
|
|
||||||
{
|
|
||||||
Filter = "Excel Files|*.xls;*.xlsx",
|
|
||||||
FileName = defaultName
|
|
||||||
};
|
|
||||||
|
|
||||||
if (sfd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
string resultPath = Excel.ExcelComparer.Compare(_sourcePath, _targetPath, sfd.FileName, out string errorMessage);
|
|
||||||
if (!errorMessage.IsNullOrEmpty()) {
|
|
||||||
MessageBox.Show(errorMessage, "Comparison error", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
}
|
|
||||||
if (File.Exists(resultPath))
|
|
||||||
{
|
|
||||||
if (new FileInfo(resultPath).Length > 0)
|
|
||||||
{
|
|
||||||
Process.Start(resultPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset input values
|
|
||||||
this.textBoxSource.Text = null;
|
|
||||||
this.textBoxTarget.Text = null;
|
|
||||||
this._sourcePath = null;
|
|
||||||
this._targetPath = null;
|
|
||||||
EnableCompareButton();
|
|
||||||
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region click on textboxes opens file selection
|
|
||||||
|
|
||||||
private void textBoxSource_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
OpenFileDialog ofd = new OpenFileDialog
|
|
||||||
{
|
|
||||||
Filter = "Excel Files|*.xls;*.xlsx"
|
|
||||||
};
|
|
||||||
if (ofd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
textBoxSource.Text = ofd.FileName;
|
|
||||||
_sourcePath = ofd.FileName;
|
|
||||||
}
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxTarget_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
OpenFileDialog ofd = new OpenFileDialog
|
|
||||||
{
|
|
||||||
Filter = "Excel Files|*.xls;*.xlsx"
|
|
||||||
};
|
|
||||||
if (ofd.ShowDialog() ?? false)
|
|
||||||
{
|
|
||||||
textBoxTarget.Text = ofd.FileName;
|
|
||||||
_targetPath = ofd.FileName;
|
|
||||||
}
|
|
||||||
EnableCompareButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
mc:Ignorable="d"
|
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 Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -60,7 +60,7 @@
|
|||||||
ButtonSpinnerLocation="Right"
|
ButtonSpinnerLocation="Right"
|
||||||
ParsingNumberStyle="Integer"
|
ParsingNumberStyle="Integer"
|
||||||
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged" TextAlignment="Left"/>
|
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged" TextAlignment="Left"/>
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Width="Auto" x:Name="locodePoC" LocodeSource="OLD" />
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Width="Auto" x:Name="locodePoC" />
|
||||||
<DatePicker Name="datePickerETA" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" SelectedDateChanged="datePickerETA_SelectedDateChanged" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199">
|
<DatePicker Name="datePickerETA" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" SelectedDateChanged="datePickerETA_SelectedDateChanged" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
|||||||
@ -57,7 +57,7 @@ namespace ENI2.EditControls
|
|||||||
isComplete &= imo_OR_eni;
|
isComplete &= imo_OR_eni;
|
||||||
|
|
||||||
string locode = this.locodePoC.LocodeValue;
|
string locode = this.locodePoC.LocodeValue;
|
||||||
bool validLocode = (locode?.Length == 5) && (locode.StartsWith("DE") || locode.StartsWith("DK") || locode.Equals("ZZNOK") || locode.Equals("DEWHV"));
|
bool validLocode = (locode?.Length == 5) && (locode.StartsWith("DE") || locode.StartsWith("DK") || locode.Equals("ZZNOK"));
|
||||||
|
|
||||||
isComplete &= validLocode;
|
isComplete &= validLocode;
|
||||||
|
|
||||||
@ -74,11 +74,10 @@ namespace ENI2.EditControls
|
|||||||
private void CopyDeclarationDialog_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
private void CopyDeclarationDialog_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.OKClicked += VisitIdDialog_OKClicked;
|
this.OKClicked += VisitIdDialog_OKClicked;
|
||||||
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
|
List<KeyValuePair<bsmd.database.Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<bsmd.database.Message.NSWProvider, string>>()
|
||||||
{
|
{
|
||||||
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ),
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH" ),
|
||||||
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DBH_MAERSK, "DBH / Maersk" ),
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
||||||
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
|
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
|
||||||
@ -97,15 +96,6 @@ namespace ENI2.EditControls
|
|||||||
private void LocodePoC_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
private void LocodePoC_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.CheckComplete();
|
this.CheckComplete();
|
||||||
string locode = this.locodePoC.LocodeValue;
|
|
||||||
if ((locode != null) && (locode.Equals("DEBRV") || locode.Equals("DEBRE")))
|
|
||||||
{
|
|
||||||
this.comboBoxInitialHIS.SelectedValue = Message.NSWProvider.DBH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.comboBoxInitialHIS.SelectedValue = Message.NSWProvider.DUDR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doubleUpDownIMO_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
private void doubleUpDownIMO_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
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>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.3*"/>
|
<ColumnDefinition Width="0.3*"/>
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
<ColumnDefinition Width="3*" />
|
<ColumnDefinition Width="3*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="{x:Static p:Resources.textBunkerType}" Grid.Row="0" Grid.Column="0" />
|
<Label Content="{x:Static p:Resources.textBunkerType}" Grid.Row="0" Grid.Column="0" />
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxBunkerType" Margin="2" MaxLength="25" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxBunkerType" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<Label Content="{x:Static p:Resources.textBunkerQuantity}" Grid.Row="1" Grid.Column="0" />
|
<Label Content="{x:Static p:Resources.textBunkerQuantity}" Grid.Row="1" Grid.Column="0" />
|
||||||
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownBunkerQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" TextAlignment="Left" />
|
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownBunkerQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" TextAlignment="Left" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<Label Name="labelNationality" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
|
<Label Name="labelNationality" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
|
||||||
<Label Name="labelDateOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
|
<Label Name="labelDateOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
|
||||||
<Label Name="labelIdDocType" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
|
<Label Name="labelIdDocType" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
|
||||||
<Label Name="labelCountryOfBirth" Grid.Row="4" Grid.Column="1" Content="{x:Static p:Resources.textCountryOfBirth}" Grid.ColumnSpan="2" Margin="263,0,1,0" />
|
<!--<Label Name="labelCountryOfBirth" Grid.Row="4" Grid.Column="1" Content="{x:Static p:Resources.textCountryOfBirth}" Grid.ColumnSpan="2" Margin="263,0,1,0" />--> <!-- XXX : TODO -->
|
||||||
<Label Name="labelIdDocNumber" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
|
<Label Name="labelIdDocNumber" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
|
||||||
<Label Name="labelVisaNumber" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
|
<Label Name="labelVisaNumber" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
|
||||||
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textDocumentIssuingState}" />
|
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textDocumentIssuingState}" />
|
||||||
@ -42,29 +42,27 @@
|
|||||||
<!--Label Name="labelEffects" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEffects}" /-->
|
<!--Label Name="labelEffects" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEffects}" /-->
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
|
||||||
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
|
||||||
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
|
||||||
<DatePicker Grid.Row="6" Grid.Column="1" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
|
||||||
<DatePicker.BlackoutDates>
|
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
|
||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
|
||||||
</DatePicker.BlackoutDates>
|
|
||||||
</DatePicker>
|
|
||||||
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
|
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
<!-- <ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>-->
|
||||||
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
<ComboBox Grid.Row="6" Grid.Column="3" Width="auto" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
<ComboBox Grid.Row="6" Grid.Column="3" Width="auto" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
|
<DatePicker Grid.Row="6" Grid.Column="1" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
|
<DatePicker.BlackoutDates>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
<!--TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEffects" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/-->
|
<!--TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEffects" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
// Description: CREW Bearbeitungsdialog
|
// Description: CREW Bearbeitungsdialog
|
||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -16,7 +15,6 @@ namespace ENI2.EditControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class EditCREWDialog : EditWindowBase
|
public partial class EditCREWDialog : EditWindowBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public EditCREWDialog()
|
public EditCREWDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -32,44 +30,27 @@ namespace ENI2.EditControls
|
|||||||
this.textBoxDuty.Text = this.CREW.CrewMemberDuty;
|
this.textBoxDuty.Text = this.CREW.CrewMemberDuty;
|
||||||
this.textBoxLastName.Text = this.CREW.CrewMemberLastName;
|
this.textBoxLastName.Text = this.CREW.CrewMemberLastName;
|
||||||
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
|
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
|
||||||
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
|
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
|
||||||
this.comboBoxGender.SelectedValue = this.CREW.CrewMemberGender?.ToString();
|
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
|
||||||
|
this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender ?? -1;
|
||||||
|
if (this.CREW.CrewMemberGender == 9)
|
||||||
|
this.comboBoxGender.SelectedIndex = 3;
|
||||||
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
|
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
|
||||||
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
|
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||||
|
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
|
||||||
this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality;
|
this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality;
|
||||||
if (this.CREW.CrewMemberDateOfBirth > CREW.CLAMPMAXDATE)
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = CREW.CLAMPMAXDATE;
|
|
||||||
}
|
|
||||||
else if (this.CREW.CrewMemberDateOfBirth < CREW.CLAMPMINDATE)
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = CREW.CLAMPMINDATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth;
|
this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth;
|
||||||
}
|
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
|
||||||
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
|
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
|
||||||
this.comboBoxIdDocType.SelectedValue = this.CREW.CrewMemberIdentityDocumentType?.ToString();
|
this.comboBoxIdDocType.SelectedIndex = this.CREW.CrewMemberIdentityDocumentType ?? -1;
|
||||||
this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId;
|
this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId;
|
||||||
this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber;
|
this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber;
|
||||||
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;
|
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||||
this.comboBoxIssuingState.SelectedValue = this.CREW.CrewMemberIdentityDocumentIssuingState;
|
this.comboBoxIssuingState.SelectedValue = this.CREW.CrewMemberIdentityDocumentIssuingState;
|
||||||
if (this.CREW.CrewMemberIdentityDocumentExpiryDate > CREW.CLAMPMAXDATE)
|
if(this.CREW.CrewMemberIdentityDocumentExpiryDate.HasValue)
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = CREW.CLAMPMAXDATE;
|
|
||||||
}
|
|
||||||
else if(this.CREW.CrewMemberDateOfBirth < CREW.CLAMPMINDATE)
|
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = CREW.CLAMPMINDATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = this.CREW.CrewMemberIdentityDocumentExpiryDate;
|
this.datePickerExpiryDate.SelectedDate = this.CREW.CrewMemberIdentityDocumentExpiryDate;
|
||||||
}
|
// this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict; // XXX: TODO
|
||||||
|
// this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth;
|
||||||
this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
|
|
||||||
this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth;
|
|
||||||
// this.textBoxEffects.Text = this.CREW.Effects;
|
// this.textBoxEffects.Text = this.CREW.Effects;
|
||||||
this.OKClicked += EditCREWDialog_OKClicked;
|
this.OKClicked += EditCREWDialog_OKClicked;
|
||||||
this.AddVisible = true;
|
this.AddVisible = true;
|
||||||
@ -79,19 +60,19 @@ namespace ENI2.EditControls
|
|||||||
{
|
{
|
||||||
// copy back
|
// copy back
|
||||||
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
|
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
|
||||||
if (this.CREW.CrewMemberDuty.IsNullOrEmpty()) this.CREW.CrewMemberDuty = "unknown";
|
|
||||||
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
|
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
|
||||||
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
|
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
|
||||||
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) byte.Parse((string) this.comboBoxGender.SelectedValue);
|
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) this.comboBoxGender.SelectedIndex;
|
||||||
|
if (this.CREW.CrewMemberGender == 3) this.CREW.CrewMemberGender = 9;
|
||||||
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
||||||
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string) this.comboBoxNationality.SelectedValue;
|
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
||||||
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
||||||
this.CREW.CrewMemberIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?) byte.Parse((string)this.comboBoxIdDocType.SelectedValue);
|
this.CREW.CrewMemberIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
|
||||||
this.CREW.CrewMemberIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
this.CREW.CrewMemberIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
||||||
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
||||||
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string) this.comboBoxIssuingState.SelectedValue;
|
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
|
||||||
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
||||||
this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
// this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
||||||
// this.CREW.Effects = this.textBoxEffects.Text.Trim();
|
// this.CREW.Effects = this.textBoxEffects.Text.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxBulkCargoShippingName" MaxLength="255" Margin="2" />
|
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxBulkCargoShippingName" MaxLength="255" Margin="2" />
|
||||||
<CheckBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="2" Name="checkBoxMaterialHazardous" />
|
<CheckBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="2" Name="checkBoxMaterialHazardous" />
|
||||||
<TextBox Grid.Row="2" Grid.Column="4" Name="textBoxUNNumber" MaxLength="4" Margin="2" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="2" Grid.Column="4" Name="textBoxUNNumber" MaxLength="4" Margin="2" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBoxIMOClass" MaxLength="3" Margin="2" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="3" Grid.Column="1" Name="textBoxIMOClass" MaxLength="4" Margin="2" VerticalContentAlignment="Center" />
|
||||||
<xctk:DoubleUpDown Name="doubleUpDownQuantity" Grid.Row="3" Grid.Column="4" Margin="2" FormatString="N3" ShowButtonSpinner="False" TextAlignment="Left"/>
|
<xctk:DoubleUpDown Name="doubleUpDownQuantity" Grid.Row="3" Grid.Column="4" Margin="2" FormatString="N3" ShowButtonSpinner="False" TextAlignment="Left"/>
|
||||||
<Label Grid.Row="3" Grid.Column="5" Content="kg" />
|
<Label Grid.Row="3" Grid.Column="5" Content="kg" />
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Name="textBoxStowagePosition" MaxLength="24" Margin="2" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="4" Grid.Column="1" Name="textBoxStowagePosition" MaxLength="24" Margin="2" VerticalContentAlignment="Center" />
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Copyright (c) 2017 schick Informatik
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="{x:Static p:Resources.textLadg}" Height="300" Width="900" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
Title="{x:Static p:Resources.textLadg}" Height="246" Width="900" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -19,7 +19,7 @@ Copyright (c) 2017 schick Informatik
|
|||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="28" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*" />
|
<ColumnDefinition Width="1*" />
|
||||||
@ -35,8 +35,6 @@ Copyright (c) 2017 schick Informatik
|
|||||||
<Label Name="labelPortOfLoading" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textCargoPortOfLoading}" />
|
<Label Name="labelPortOfLoading" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textCargoPortOfLoading}" />
|
||||||
<Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textCargoPortOfDischarge}" />
|
<Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textCargoPortOfDischarge}" />
|
||||||
<Label Name="labelCodeNST3" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textCargoCodeNST3}" />
|
<Label Name="labelCodeNST3" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textCargoCodeNST3}" />
|
||||||
<Label Name="labelSearchNST2007" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textSearchNST}" HorizontalAlignment="Right" />
|
|
||||||
|
|
||||||
|
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1" Name="comboBoxHandlingType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
<ComboBox Grid.Row="0" Grid.Column="1" Name="comboBoxHandlingType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
<ComboBox Grid.Row="0" Grid.Column="3" Name="comboBoxLACodes" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
<ComboBox Grid.Row="0" Grid.Column="3" Name="comboBoxLACodes" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
@ -45,26 +43,7 @@ Copyright (c) 2017 schick Informatik
|
|||||||
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="1" Name="integerUpDownNumberOfItems" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="1" Name="integerUpDownNumberOfItems" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownGrossQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N3" TextAlignment="Left"/>
|
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownGrossQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N3" TextAlignment="Left"/>
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="4" Width="Auto" x:Name="locodeControl_PortOfLoading" />
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="4" Width="Auto" x:Name="locodeControl_PortOfLoading" />
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="5" Width="Auto" x:Name="locodeControl_PortOfDischarge" Height="28" VerticalAlignment="Top"/>
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="5" Width="Auto" x:Name="locodeControl_PortOfDischarge" />
|
||||||
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="3" Margin="2" Name="textBoxSearchNSTList" TextChanged="textBoxSearchNSTList_TextChanged" VerticalContentAlignment="Center" />
|
|
||||||
<Grid Grid.Row="4" Grid.Column="3" Grid.RowSpan="2">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="28" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<ListBox Name="listBoxNST2007" Margin="2" Grid.RowSpan="2" DisplayMemberPath="Key" MouseDoubleClick="listBoxNST2007_MouseDoubleClick" />
|
|
||||||
<!--ComboBox Name="comboBoxSelectNST2007ListItem" Margin="2" DisplayMemberPath="Key" Grid.RowSpan="2" /-->
|
|
||||||
<Button Name="buttonSetTemplate" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Apply template" HorizontalContentAlignment="Right" Grid.Column="1">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -2,14 +2,13 @@
|
|||||||
// Description: LADG Bearbeitungsdialog
|
// Description: LADG Bearbeitungsdialog
|
||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using ENI2.Controls;
|
using ENI2.Controls;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
namespace ENI2.EditControls
|
||||||
{
|
{
|
||||||
@ -31,14 +30,10 @@ namespace ENI2.EditControls
|
|||||||
Properties.Resources.textDischarge
|
Properties.Resources.textDischarge
|
||||||
};
|
};
|
||||||
|
|
||||||
private static List<KeyValuePair<string, string>> _nstList = null;
|
|
||||||
|
|
||||||
public EditLADGDialog()
|
public EditLADGDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += EditLADGDialog_Loaded;
|
Loaded += EditLADGDialog_Loaded;
|
||||||
if (_nstList == null)
|
|
||||||
_nstList = LocalizedLookup.GetNST2007List();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LADG LADG { get; set; }
|
public LADG LADG { get; set; }
|
||||||
@ -117,42 +112,5 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region NST2007 list search/select event handler
|
|
||||||
|
|
||||||
private void textBoxSearchNSTList_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (textBoxSearchNSTList.Text.IsNullOrEmpty() || (textBoxSearchNSTList.Text.Length == 1))
|
|
||||||
{
|
|
||||||
this.listBoxNST2007.ItemsSource = null;
|
|
||||||
// this.comboBoxSelectNST2007ListItem.ItemsSource = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var result = _nstList.Where(kvp => kvp.Key.Contains(textBoxSearchNSTList.Text, StringComparison.OrdinalIgnoreCase));
|
|
||||||
this.listBoxNST2007.ItemsSource = result;
|
|
||||||
//this.comboBoxSelectNST2007ListItem.ItemsSource = result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonSetTemplate_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if(this.listBoxNST2007.SelectedItem != null)
|
|
||||||
{
|
|
||||||
KeyValuePair<string, string> selectedTemplate = (KeyValuePair<string, string>) this.listBoxNST2007.SelectedItem;
|
|
||||||
if(selectedTemplate.Value.Length == 3)
|
|
||||||
{
|
|
||||||
this.comboBoxNSTCode.SelectedValue = selectedTemplate.Value.Substring(0, 2);
|
|
||||||
this.comboBoxNST3Code.SelectedValue = selectedTemplate.Value.Substring(2, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listBoxNST2007_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
this.buttonSetTemplate_Click(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<ComboBox Name="comboBoxShipSecurityLevel" Grid.Row="5" Grid.Column="1" Margin="2" />
|
<ComboBox Name="comboBoxShipSecurityLevel" Grid.Row="5" Grid.Column="1" Margin="2" />
|
||||||
<TextBox Name="textBoxGisisCode" Grid.Row="6" Grid.Column="1" Margin="2" MaxLength="4" VerticalContentAlignment="Center" PreviewTextInput="textBoxGisisCode_PreviewTextInput" PreviewKeyDown="textBoxGisisCode_PreviewKeyDown"/>
|
<TextBox Name="textBoxGisisCode" Grid.Row="6" Grid.Column="1" Margin="2" MaxLength="4" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxGisisDescription" Grid.Row="7" Grid.Column="1" Margin="2" IsEnabled="False"/>
|
<TextBox Name="textBoxGisisDescription" Grid.Row="7" Grid.Column="1" Margin="2" IsEnabled="False"/>
|
||||||
<enictrl:LocodeControl x:Name="locodeGISIS" Grid.Row="8" Grid.Column="1" />
|
<enictrl:LocodeControl x:Name="locodeGISIS" Grid.Row="8" Grid.Column="1" />
|
||||||
<TextBox Name="textBoxSecurityMatters" Grid.Row="9" Grid.Column="1" Margin="2" MaxLength="255" />
|
<TextBox Name="textBoxSecurityMatters" Grid.Row="9" Grid.Column="1" Margin="2" MaxLength="255" />
|
||||||
|
|||||||
@ -34,7 +34,7 @@ namespace ENI2.EditControls
|
|||||||
this.comboBoxShipSecurityLevel.ItemsSource = GlobalStructures.ShipSecurityLevels;
|
this.comboBoxShipSecurityLevel.ItemsSource = GlobalStructures.ShipSecurityLevels;
|
||||||
|
|
||||||
if (this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel.HasValue)
|
if (this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel.HasValue)
|
||||||
this.comboBoxShipSecurityLevel.SelectedIndex = this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel.Value - 1;
|
this.comboBoxShipSecurityLevel.SelectedIndex = (this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel.Value - 1);
|
||||||
else
|
else
|
||||||
this.comboBoxShipSecurityLevel.SelectedIndex = -1;
|
this.comboBoxShipSecurityLevel.SelectedIndex = -1;
|
||||||
|
|
||||||
@ -48,33 +48,23 @@ namespace ENI2.EditControls
|
|||||||
public void CopyValuesToEntity()
|
public void CopyValuesToEntity()
|
||||||
{
|
{
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityPortLoCode = this.locodePort.LocodeValue;
|
this.LastTenPortFacilitiesCalled.PortFacilityPortLoCode = this.locodePort.LocodeValue;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityPortName = this.textBoxPortName.Text.Trim();
|
this.LastTenPortFacilitiesCalled.PortFacilityPortName = this.textBoxPortName.Text;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityPortCountry = this.textBoxPortCountry.Text.Trim();
|
this.LastTenPortFacilitiesCalled.PortFacilityPortCountry = this.textBoxPortCountry.Text;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityDateOfArrival = this.datePickerATA.SelectedDate;
|
this.LastTenPortFacilitiesCalled.PortFacilityDateOfArrival = this.datePickerATA.SelectedDate;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityDateOfDeparture = this.datePickerATD.SelectedDate;
|
this.LastTenPortFacilitiesCalled.PortFacilityDateOfDeparture = this.datePickerATD.SelectedDate;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityGISISCode = this.textBoxGisisCode.Text.Trim();
|
this.LastTenPortFacilitiesCalled.PortFacilityGISISCode = this.textBoxGisisCode.Text;
|
||||||
|
|
||||||
if (this.comboBoxShipSecurityLevel.SelectedIndex == -1)
|
if (this.comboBoxShipSecurityLevel.SelectedIndex == -1)
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel = null;
|
this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel = null;
|
||||||
else
|
else
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel = (byte?) (this.comboBoxShipSecurityLevel.SelectedIndex + 1);
|
this.LastTenPortFacilitiesCalled.PortFacilityShipSecurityLevel = (byte?) (this.comboBoxShipSecurityLevel.SelectedIndex + 1);
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilityGISISCodeLocode = this.locodeGISIS.LocodeValue;
|
this.LastTenPortFacilitiesCalled.PortFacilityGISISCodeLocode = this.locodeGISIS.LocodeValue;
|
||||||
this.LastTenPortFacilitiesCalled.PortFacilitySecurityMattersToReport = this.textBoxSecurityMatters.Text.Trim();
|
this.LastTenPortFacilitiesCalled.PortFacilitySecurityMattersToReport = this.textBoxSecurityMatters.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditLast10PortFacilitiesDialog_OKClicked()
|
private void EditLast10PortFacilitiesDialog_OKClicked()
|
||||||
{
|
{
|
||||||
this.CopyValuesToEntity();
|
this.CopyValuesToEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBoxGisisCode_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = !e.Text.IsDigitsOnly();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxGisisCode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if(e.Key == System.Windows.Input.Key.Space) e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<Label Name="labelNationality" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
|
<Label Name="labelNationality" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
|
||||||
<Label Name="labelDateOfBirth" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
|
<Label Name="labelDateOfBirth" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
|
||||||
<Label Name="labelIdDocType" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
|
<Label Name="labelIdDocType" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
|
||||||
<Label Name="labelCountryOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCountryOfBirth}" />
|
<!--<Label Name="labelCountryOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCountryOfBirth}" />-->
|
||||||
<Label Name="labelIdDocNumber" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
|
<Label Name="labelIdDocNumber" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
|
||||||
<Label Name="labelVisaNumber" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
|
<Label Name="labelVisaNumber" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
|
||||||
<Label Name="labelPortOfEmbarkation" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textPortOfEmbarkation}" />
|
<Label Name="labelPortOfEmbarkation" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textPortOfEmbarkation}" />
|
||||||
@ -42,37 +42,35 @@
|
|||||||
<Label Name="labelTransitPassenger" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textTransitPassenger}" />
|
<Label Name="labelTransitPassenger" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textTransitPassenger}" />
|
||||||
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDocumentIssuingState}" />
|
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDocumentIssuingState}" />
|
||||||
<Label Name="labelExpiryDate" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textDocumentExpiryDate}" />
|
<Label Name="labelExpiryDate" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textDocumentExpiryDate}" />
|
||||||
<Label Name="labelEmergencyCare" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyCare}" />
|
<!--<Label Name="labelEmergencyCare" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyCare}" />
|
||||||
<Label Name="labelEmergencyContactNumber" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyContactNumber}" />
|
<Label Name="labelEmergencyContactNumber" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyContactNumber}" />-->
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
|
||||||
<enictrl:LocodeControl x:Name="locodePortOfDisembarkation" Grid.Row="5" Grid.Column="1" />
|
|
||||||
<ComboBox Grid.Row="6" Grid.Column="1" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
|
||||||
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEmergencyCare" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
|
||||||
<TextBox Grid.Row="8" Grid.Column="1" Width="auto" Name="textBoxEmergencyContactNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
|
<!--<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />-->
|
||||||
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<enictrl:LocodeControl x:Name="locodePortOfEmbarkation" Grid.Row="5" Grid.Column="3" />
|
<enictrl:LocodeControl x:Name="locodePortOfEmbarkation" Grid.Row="5" Grid.Column="3" />
|
||||||
|
<enictrl:LocodeControl x:Name="locodePortOfDisembarkation" Grid.Row="5" Grid.Column="1" />
|
||||||
<CheckBox Name="checkBoxTransitPassenger" Grid.Row="6" Grid.Column="3" VerticalAlignment="Center" Margin="2"/>
|
<CheckBox Name="checkBoxTransitPassenger" Grid.Row="6" Grid.Column="3" VerticalAlignment="Center" Margin="2"/>
|
||||||
|
<ComboBox Grid.Row="6" Grid.Column="1" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
<DatePicker Grid.Row="7" Grid.Column="3" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
<DatePicker Grid.Row="7" Grid.Column="3" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
<DatePicker.BlackoutDates>
|
<DatePicker.BlackoutDates>
|
||||||
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
|
||||||
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
</DatePicker.BlackoutDates>
|
</DatePicker.BlackoutDates>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
|
<!--<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEmergencyCare" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="8" Grid.Column="1" Width="auto" Name="textBoxEmergencyContactNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
// Description: PAS Bearbeitungsdialog
|
// Description: PAS Bearbeitungsdialog
|
||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -16,7 +15,6 @@ namespace ENI2.EditControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class EditPASDialog : EditWindowBase
|
public partial class EditPASDialog : EditWindowBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public EditPASDialog()
|
public EditPASDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -31,25 +29,19 @@ namespace ENI2.EditControls
|
|||||||
// copy into fields
|
// copy into fields
|
||||||
this.textBoxLastName.Text = this.PAS.PassengerLastName;
|
this.textBoxLastName.Text = this.PAS.PassengerLastName;
|
||||||
this.textBoxFirstName.Text = this.PAS.PassengerFirstName;
|
this.textBoxFirstName.Text = this.PAS.PassengerFirstName;
|
||||||
this.comboBoxGender.ItemsSource = GlobalStructures.GenderDict;
|
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
|
||||||
this.comboBoxGender.SelectedValue = this.PAS.PassengerGender?.ToString();
|
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
|
||||||
|
this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender ?? -1;
|
||||||
|
if (this.PAS.PassengerGender == 9)
|
||||||
|
this.comboBoxGender.SelectedIndex = 3;
|
||||||
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
|
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
|
||||||
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
|
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||||
|
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
|
||||||
this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality;
|
this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality;
|
||||||
if (this.PAS.PassengerDateOfBirth > CREW.CLAMPMAXDATE)
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = CREW.CLAMPMAXDATE;
|
|
||||||
}
|
|
||||||
else if (this.PAS.PassengerDateOfBirth < CREW.CLAMPMINDATE)
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = CREW.CLAMPMINDATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth;
|
this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth;
|
||||||
}
|
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
|
||||||
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeDict;
|
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
|
||||||
this.comboBoxIdDocType.SelectedValue = this.PAS.PassengerIdentityDocumentType?.ToString();
|
this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType ?? -1;
|
||||||
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
|
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
|
||||||
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
|
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
|
||||||
this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation;
|
this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation;
|
||||||
@ -57,24 +49,13 @@ namespace ENI2.EditControls
|
|||||||
this.checkBoxTransitPassenger.IsChecked = this.PAS.PassengerInTransit;
|
this.checkBoxTransitPassenger.IsChecked = this.PAS.PassengerInTransit;
|
||||||
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;
|
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||||
this.comboBoxIssuingState.SelectedValue = this.PAS.PassengerIdentityDocumentIssuingState;
|
this.comboBoxIssuingState.SelectedValue = this.PAS.PassengerIdentityDocumentIssuingState;
|
||||||
|
if(this.PAS.PassengerIdentityDocumentExpiryDate.HasValue)
|
||||||
if (this.PAS.PassengerIdentityDocumentExpiryDate > CREW.CLAMPMAXDATE)
|
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = CREW.CLAMPMAXDATE;
|
|
||||||
}
|
|
||||||
else if (this.PAS.PassengerIdentityDocumentExpiryDate < CREW.CLAMPMINDATE)
|
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = CREW.CLAMPMINDATE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.datePickerExpiryDate.SelectedDate = this.PAS.PassengerIdentityDocumentExpiryDate;
|
this.datePickerExpiryDate.SelectedDate = this.PAS.PassengerIdentityDocumentExpiryDate;
|
||||||
}
|
// XXX : TODO
|
||||||
|
//this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||||
this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
|
//this.comboBoxCountryOfBirth.SelectedValue = this.PAS.PassengerCountryOfBirth;
|
||||||
this.comboBoxCountryOfBirth.SelectedValue = this.PAS.PassengerCountryOfBirth;
|
//this.textBoxEmergencyCare.Text = this.PAS.EmergencyCare;
|
||||||
this.textBoxEmergencyCare.Text = this.PAS.EmergencyCare;
|
//this.textBoxEmergencyContactNumber.Text = this.PAS.EmergencyContactNumber;
|
||||||
this.textBoxEmergencyContactNumber.Text = this.PAS.EmergencyContactNumber;
|
|
||||||
|
|
||||||
this.OKClicked += EditPasDialog_OKClicked;
|
this.OKClicked += EditPasDialog_OKClicked;
|
||||||
this.AddVisible = true;
|
this.AddVisible = true;
|
||||||
@ -85,11 +66,13 @@ namespace ENI2.EditControls
|
|||||||
// copy back
|
// copy back
|
||||||
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
|
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
|
||||||
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
|
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
|
||||||
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)byte.Parse((string)this.comboBoxGender.SelectedValue);
|
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)this.comboBoxGender.SelectedIndex;
|
||||||
|
if (this.PAS.PassengerGender == 3)
|
||||||
|
this.PAS.PassengerGender = 9;
|
||||||
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
|
||||||
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
|
||||||
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
|
||||||
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?) byte.Parse((string)this.comboBoxIdDocType.SelectedValue);
|
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
|
||||||
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
|
||||||
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
|
||||||
this.PAS.PassengerPortOfEmbarkation = this.locodePortOfEmbarkation.LocodeValue;
|
this.PAS.PassengerPortOfEmbarkation = this.locodePortOfEmbarkation.LocodeValue;
|
||||||
@ -97,10 +80,10 @@ namespace ENI2.EditControls
|
|||||||
this.PAS.PassengerInTransit = this.checkBoxTransitPassenger.IsChecked;
|
this.PAS.PassengerInTransit = this.checkBoxTransitPassenger.IsChecked;
|
||||||
this.PAS.PassengerIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
|
this.PAS.PassengerIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
|
||||||
this.PAS.PassengerIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
this.PAS.PassengerIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
|
||||||
|
// XXX : TODO
|
||||||
this.PAS.PassengerCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
// this.PAS.PassengerCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
|
||||||
this.PAS.EmergencyCare = this.textBoxEmergencyCare.Text.Trim();
|
//this.PAS.EmergencyCare = this.textBoxEmergencyCare.Text.Trim();
|
||||||
this.PAS.EmergencyContactNumber = this.textBoxEmergencyContactNumber.Text.Trim();
|
//this.PAS.EmergencyContactNumber = this.textBoxEmergencyContactNumber.Text.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditPasDialog_OKClicked()
|
private void EditPasDialog_OKClicked()
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="{x:Static p:Resources.textReportingParty}" Height="378" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
Title="{x:Static p:Resources.textReportingParty}" Height="350" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -21,7 +21,6 @@
|
|||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*" />
|
<ColumnDefinition Width="2*" />
|
||||||
@ -47,10 +46,8 @@
|
|||||||
<Label Name="labelUserEMail" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" HorizontalContentAlignment="Right" />
|
<Label Name="labelUserEMail" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" HorizontalContentAlignment="Right" />
|
||||||
<Label Name="labelAdmin" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textAdministrator}" HorizontalContentAlignment="Right" />
|
<Label Name="labelAdmin" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textAdministrator}" HorizontalContentAlignment="Right" />
|
||||||
<Label Name="labelArchived" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textArchived}" HorizontalContentAlignment="Right" />
|
<Label Name="labelArchived" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textArchived}" HorizontalContentAlignment="Right" />
|
||||||
<Label Name="labelEditor" Grid.Row="8" Grid.Column="2" Content="{x:Static p:Resources.textEditor}" HorizontalContentAlignment="Right" />
|
<Label Name="labelCreated" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" HorizontalContentAlignment="Right" />
|
||||||
|
<Label Name="labelChanged" Grid.Row="9" Grid.Column="2" Content="{x:Static p:Resources.textChanged}" HorizontalContentAlignment="Right" />
|
||||||
<Label Name="labelCreated" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" HorizontalContentAlignment="Right" />
|
|
||||||
<Label Name="labelChanged" Grid.Row="10" Grid.Column="2" Content="{x:Static p:Resources.textChanged}" HorizontalContentAlignment="Right" />
|
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
@ -67,10 +64,10 @@
|
|||||||
<PasswordBox Grid.Row="6" Grid.Column="3" Width="auto" Name="passwordBoxPassword" Margin="2" VerticalContentAlignment="Center" />
|
<PasswordBox Grid.Row="6" Grid.Column="3" Width="auto" Name="passwordBoxPassword" Margin="2" VerticalContentAlignment="Center" />
|
||||||
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxUserEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxUserEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
|
||||||
<CheckBox Grid.Row="7" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxAdministrator" Margin="2" />
|
<CheckBox Grid.Row="7" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxAdministrator" Margin="2" />
|
||||||
<CheckBox Grid.Row="8" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxEditor" Margin="2" />
|
|
||||||
<CheckBox Grid.Row="8" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxArchived" Margin="2" />
|
<CheckBox Grid.Row="8" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxArchived" Margin="2" />
|
||||||
<Label Grid.Row="10" Grid.Column="1" Name="dateTimePickerCreated" FontStyle="Italic" />
|
|
||||||
<Label Grid.Row="10" Grid.Column="3" Name="dateTimePickerChanged" FontStyle="Italic" />
|
<Label Grid.Row="9" Grid.Column="1" Name="dateTimePickerCreated" FontStyle="Italic" />
|
||||||
|
<Label Grid.Row="9" Grid.Column="3" Name="dateTimePickerChanged" FontStyle="Italic" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
// Description: Reporting party Bearbeitungsdialog
|
// Description: Reporting party Bearbeitungsdialog
|
||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -25,7 +24,6 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
private void EditReportingPartyDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditReportingPartyDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.textBoxCity.Text = this.ReportingParty.City;
|
this.textBoxCity.Text = this.ReportingParty.City;
|
||||||
this.textBoxCountry.Text = this.ReportingParty.Country;
|
this.textBoxCountry.Text = this.ReportingParty.Country;
|
||||||
this.textBoxEMail.Text = this.ReportingParty.EMail;
|
this.textBoxEMail.Text = this.ReportingParty.EMail;
|
||||||
@ -41,8 +39,6 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin;
|
this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin;
|
||||||
this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived;
|
this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived;
|
||||||
this.checkBoxEditor.IsChecked = this.ReportingParty.IsEditor;
|
|
||||||
|
|
||||||
|
|
||||||
this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : "";
|
this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : "";
|
||||||
this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : "";
|
this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : "";
|
||||||
@ -73,7 +69,6 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
this.ReportingParty.IsAdmin = this.checkBoxAdministrator.IsChecked ?? false;
|
this.ReportingParty.IsAdmin = this.checkBoxAdministrator.IsChecked ?? false;
|
||||||
this.ReportingParty.IsArchived = this.checkBoxArchived.IsChecked ?? false;
|
this.ReportingParty.IsArchived = this.checkBoxArchived.IsChecked ?? false;
|
||||||
this.ReportingParty.IsEditor = this.checkBoxEditor.IsChecked ?? false;
|
|
||||||
|
|
||||||
// save value
|
// save value
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.ReportingParty);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.ReportingParty);
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
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>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32" />
|
<RowDefinition Height="32" />
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2017 schick Informatik
|
// Copyright (c) 2017 schick Informatik
|
||||||
// Description: Edit SERV and SERV_template entities
|
// Description:
|
||||||
//
|
//
|
||||||
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -14,60 +14,24 @@ namespace ENI2.EditControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class EditSERVDialog : EditWindowBase
|
public partial class EditSERVDialog : EditWindowBase
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public EditSERVDialog()
|
public EditSERVDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Loaded += EditSERVDialog_Loaded;
|
Loaded += EditSERVDialog_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public SERV SERV { get; set; }
|
|
||||||
|
|
||||||
public SERV_Template SERV_Template { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region event handler
|
|
||||||
|
|
||||||
private void EditSERVDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditSERVDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.OKClicked += EditSERVDialog_OKClicked;
|
this.OKClicked += EditSERVDialog_OKClicked;
|
||||||
|
|
||||||
// copy into fields
|
// copy into fields
|
||||||
if (this.SERV != null)
|
|
||||||
{
|
|
||||||
this.textBoxServiceName.Text = this.SERV.ServiceName;
|
this.textBoxServiceName.Text = this.SERV.ServiceName;
|
||||||
this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary;
|
this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary;
|
||||||
this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient;
|
this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient;
|
||||||
this.AddVisible = true;
|
this.AddVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.SERV_Template != null)
|
|
||||||
{
|
|
||||||
this.textBoxServiceName.Text = this.SERV_Template.ServiceName;
|
|
||||||
this.textBoxServiceBeneficiary.Text = this.SERV_Template.ServiceBeneficiary;
|
|
||||||
this.textBoxServiceInvoiceRecipient.Text = this.SERV_Template.ServiceInvoiceRecipient;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void EditSERVDialog_OKClicked()
|
|
||||||
{
|
|
||||||
this.CopyValuesToEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region public methods
|
|
||||||
|
|
||||||
public void CopyValuesToEntity()
|
public void CopyValuesToEntity()
|
||||||
{
|
|
||||||
|
|
||||||
if (this.SERV != null)
|
|
||||||
{
|
{
|
||||||
// copy back
|
// copy back
|
||||||
this.SERV.ServiceName = this.textBoxServiceName.Text.Trim();
|
this.SERV.ServiceName = this.textBoxServiceName.Text.Trim();
|
||||||
@ -75,17 +39,11 @@ namespace ENI2.EditControls
|
|||||||
this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
|
this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.SERV_Template != null)
|
private void EditSERVDialog_OKClicked()
|
||||||
{
|
{
|
||||||
// copy back
|
this.CopyValuesToEntity();
|
||||||
this.SERV_Template.ServiceName = this.textBoxServiceName.Text.Trim();
|
|
||||||
this.SERV_Template.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim();
|
|
||||||
this.SERV_Template.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public SERV SERV { get; set; }
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,11 +38,11 @@
|
|||||||
<Label Name="labelWasteCodeText" Grid.Row="0" Grid.Column="2" />
|
<Label Name="labelWasteCodeText" Grid.Row="0" Grid.Column="2" />
|
||||||
<TextBox Name="textBoxDescription" Grid.Row="1" Grid.Column="1" Margin="2" Grid.ColumnSpan="2" Width="auto" MaxLength="99" TextWrapping="Wrap" />
|
<TextBox Name="textBoxDescription" Grid.Row="1" Grid.Column="1" Margin="2" Grid.ColumnSpan="2" Width="auto" MaxLength="99" TextWrapping="Wrap" />
|
||||||
|
|
||||||
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left" Maximum="9999.999" />
|
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left" Maximum="9999.999"/>
|
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left" Maximum="9999.999"/>
|
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
|
||||||
<enictrl:LocodeControl Grid.Row="5" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" LocodeSource="SSN" />
|
<enictrl:LocodeControl Grid.Row="5" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" />
|
||||||
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left" Maximum="9999.999"/>
|
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
|
||||||
|
|
||||||
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "2" Grid.Column="2" />
|
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "2" Grid.Column="2" />
|
||||||
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "3" Grid.Column="2" />
|
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "3" Grid.Column="2" />
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="56" />
|
<RowDefinition Height="56" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -31,48 +30,16 @@
|
|||||||
<Label Name="labelIdentificationNumber" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textIdentificationNumber}" />
|
<Label Name="labelIdentificationNumber" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textIdentificationNumber}" />
|
||||||
<Label Name="labelPortReceptionFacilityName" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortReceptionFacilityName}" />
|
<Label Name="labelPortReceptionFacilityName" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortReceptionFacilityName}" />
|
||||||
<Label Name="labelPortReceptionFacilityProviderName" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textPortReceptionFacilityProviderName}" />
|
<Label Name="labelPortReceptionFacilityProviderName" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textPortReceptionFacilityProviderName}" />
|
||||||
<Label Name="labelTemplate" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textAgentTemplate}" />
|
<Label Name="labelTreatmentFacilityProvider" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textTreatmentFacilityProviderDisplay}" />
|
||||||
<Label Name="labelTreatmentFacilityProvider" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTreatmentFacilityProviderDisplay}" />
|
<Label Name="labelWasteDeliveryDateFrom" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteDeliveryDateFrom}" />
|
||||||
<Label Name="labelWasteDeliveryDateFrom" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textWasteDeliveryDateFrom}" />
|
<Label Name="labelWasteDeliveryDateTo" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textWasteDeliveryDateTo}" />
|
||||||
<Label Name="labelWasteDeliveryDateTo" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textWasteDeliveryDateTo}" />
|
|
||||||
|
|
||||||
<TextBox Name="textIdentificationNumber" Grid.Row="0" Grid.Column="1" Width="auto" MaxLength="20" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textIdentificationNumber" Grid.Row="0" Grid.Column="1" Width="auto" MaxLength="20" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxPortReceptionFacilityName" Grid.Row="1" Grid.Column="1" Width="auto" MaxLength="70" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxPortReceptionFacilityName" Grid.Row="1" Grid.Column="1" Width="auto" MaxLength="70" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Name="textBoxPortReceptionFacilityProviderName" Grid.Row="2" Grid.Column="1" Width="auto" MaxLength="70" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
<TextBox Name="textBoxPortReceptionFacilityProviderName" Grid.Row="2" Grid.Column="1" Width="auto" MaxLength="70" TextWrapping="Wrap" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
<Grid Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="1" Name="gridTemplateControls" Visibility="Visible">
|
<TextBox Name="textBoxTreatmentFacilityProvider" Grid.Row="3" Grid.Column="1" Height="56" VerticalContentAlignment="Top" Margin="2"/>
|
||||||
<Grid.ColumnDefinitions>
|
<xctk:DateTimePicker Grid.Row="4" Grid.Column="1" Name="dateTimePickerWasteDeliveryDateFrom" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<ColumnDefinition Width=".5*"/>
|
<xctk:DateTimePicker Grid.Row="5" Grid.Column="1" Name="dateTimePickerWasteDeliveryDateTo" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
<ColumnDefinition Width=".5*"/>
|
|
||||||
<!-- Name -->
|
|
||||||
<ColumnDefinition Width="26"/>
|
|
||||||
<!-- Save button -->
|
|
||||||
<ColumnDefinition Width="26"/>
|
|
||||||
<!-- Delete button -->
|
|
||||||
<ColumnDefinition Width="52"/>
|
|
||||||
<!-- Undo button -->
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox Grid.Column="0" Name="comboBox_WSDPTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="Remark" SelectionChanged="comboBox_WSDPTemplate_SelectionChanged" />
|
|
||||||
<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">
|
|
||||||
<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">
|
|
||||||
<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">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBox Name="textBoxTreatmentFacilityProvider" Grid.Row="4" Grid.Column="1" Height="56" VerticalContentAlignment="Top" Margin="2"/>
|
|
||||||
<xctk:DateTimePicker Grid.Row="5" Grid.Column="1" Name="dateTimePickerWasteDeliveryDateFrom" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
|
||||||
<xctk:DateTimePicker Grid.Row="6" Grid.Column="1" Name="dateTimePickerWasteDeliveryDateTo" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
|
||||||
|
|
||||||
<!--Button x:Name="buttonAddEntries" Grid.Column="1" Grid.Row="7" Margin="2" Click="buttonAddEntries_Click" Width="170" Content="Add waste received entries" HorizontalAlignment="Left"/-->
|
<!--Button x:Name="buttonAddEntries" Grid.Column="1" Grid.Row="7" Margin="2" Click="buttonAddEntries_Click" Width="170" Content="Add waste received entries" HorizontalAlignment="Left"/-->
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -17,13 +15,6 @@ namespace ENI2.EditControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class EditWasteReceiptDialog : EditWindowBase
|
public partial class EditWasteReceiptDialog : EditWindowBase
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: "unstatic" the templates and take care they are synchronized between controls
|
|
||||||
|
|
||||||
private List<WasteDisposalServiceProvider_Template> _wsdpTemplates = null;
|
|
||||||
private WasteDisposalServiceProvider_Template _currentTemplate;
|
|
||||||
private string _undoTemplate;
|
|
||||||
|
|
||||||
public EditWasteReceiptDialog()
|
public EditWasteReceiptDialog()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -33,7 +24,7 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public WAS_RCPT WAS_RCPT { get; set; }
|
public WAS_RCPT WAS_RCPT { get; set; }
|
||||||
|
|
||||||
private async void EditWasteReceiptDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditWasteReceiptDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textIdentificationNumber.Text = this.WAS_RCPT.IdentificationNumber;
|
this.textIdentificationNumber.Text = this.WAS_RCPT.IdentificationNumber;
|
||||||
this.textBoxPortReceptionFacilityName.Text = this.WAS_RCPT.PortReceptionFacilityName;
|
this.textBoxPortReceptionFacilityName.Text = this.WAS_RCPT.PortReceptionFacilityName;
|
||||||
@ -44,12 +35,6 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
OKClicked += EditWasteReceiptDialog_OKClicked;
|
OKClicked += EditWasteReceiptDialog_OKClicked;
|
||||||
this.AddVisible = true;
|
this.AddVisible = true;
|
||||||
|
|
||||||
_wsdpTemplates = await DBManagerAsync.GetWasteDisposalServiceProviderTemplatesAsync();
|
|
||||||
_wsdpTemplates.Sort();
|
|
||||||
Trace.WriteLine($"{_wsdpTemplates.Count} WSDP templates loaded");
|
|
||||||
|
|
||||||
this.comboBox_WSDPTemplate.ItemsSource = _wsdpTemplates;
|
|
||||||
}
|
}
|
||||||
public void CopyValuesToEntity()
|
public void CopyValuesToEntity()
|
||||||
{
|
{
|
||||||
@ -67,87 +52,10 @@ namespace ENI2.EditControls
|
|||||||
this.CopyValuesToEntity();
|
this.CopyValuesToEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBox_WSDPTemplate_SelectionChanged(object sender, System.Windows.Controls.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.textBoxPortReceptionFacilityProviderName.Text.Trim();
|
|
||||||
this.buttonUndoTemplate.IsEnabled = this._undoTemplate.Length > 0;
|
|
||||||
this.textBoxPortReceptionFacilityProviderName.Text = wdsp_t.WasteDisposalServiceProviderName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void buttonSaveTemplate_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
string currentWSDPProviderName = this.textBoxPortReceptionFacilityProviderName.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.textBoxPortReceptionFacilityProviderName.Text = this._undoTemplate;
|
|
||||||
this.buttonUndoTemplate.IsEnabled = false;
|
|
||||||
this._undoTemplate = null;
|
|
||||||
this.comboBox_WSDPTemplate.SelectedItem = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// private void buttonAddEntries_Click(object sender, RoutedEventArgs e)
|
||||||
|
// {
|
||||||
|
// this.WAS_RCPT.AddMissingWasteReceived();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<ComboBox Name="comboBoxWasteCode" Grid.Row="0" Grid.Column="1" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
|
<ComboBox Name="comboBoxWasteCode" Grid.Row="0" Grid.Column="1" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
|
||||||
<TextBox Name="textBoxDescription" Grid.Row="1" Margin="2" Grid.Column="1" Width="auto" MaxLength="99" TextWrapping="Wrap" />
|
<TextBox Name="textBoxDescription" Grid.Row="1" Margin="2" Grid.Column="1" Width="auto" MaxLength="99" TextWrapping="Wrap" />
|
||||||
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountReceived" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left" Maximum="9999.999"/>
|
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountReceived" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
mc:Ignorable="d"
|
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>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.FixImportDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
||||||
xmlns:local="clr-namespace:ENI2.EditControls"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Fix imported value" Height="200" Width="500" WindowStyle="SingleBorderWindow" Background="AliceBlue" Loaded="EditWindowBase_Loaded">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Label Content="Type" Grid.Row="0" Grid.Column="0" Focusable="False" />
|
|
||||||
<Label Content="Value" Grid.Row="1" Grid.Column="0" Focusable="False" />
|
|
||||||
<Label Content="Selection" Grid.Row="2" Grid.Column="0" Focusable="False"/>
|
|
||||||
|
|
||||||
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockType" Grid.Row="0" Grid.Column="1" Focusable="False">bla</TextBlock>
|
|
||||||
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockValue" Grid.Row="1" Grid.Column="1" Focusable="False">bla</TextBlock>
|
|
||||||
<xctk:WatermarkComboBox Grid.Column="1" Grid.Row="2" x:Name="comboBoxValues" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" Margin="2" IsEditable="True" Watermark="Select an appropriate value" />
|
|
||||||
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" x:Name="locodeControl" Visibility="Hidden" />
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</enictrl:EditWindowBase>
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
|
||||||
// Description: Dialog to confirm values during excel import (e.g. CREW/PAS)
|
|
||||||
//
|
|
||||||
|
|
||||||
using ENI2.Controls;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows;
|
|
||||||
using bsmd.database;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for FixImportDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class FixImportDialog : EditWindowBase
|
|
||||||
{
|
|
||||||
public FixImportDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool LocodeMode
|
|
||||||
{
|
|
||||||
get { return this.locodeControl.Visibility == Visibility.Visible; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.locodeControl.Visibility = value ? Visibility.Visible : Visibility.Hidden;
|
|
||||||
this.comboBoxValues.Visibility = value ? Visibility.Hidden : Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string SelectedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (LocodeMode) return this.locodeControl.LocodeValue;
|
|
||||||
return this.comboBoxValues.SelectedValue as string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Value
|
|
||||||
{
|
|
||||||
get { return this.textBlockValue.Text; }
|
|
||||||
set { this.textBlockValue.Text = value.Trim(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ValueType
|
|
||||||
{
|
|
||||||
get { return this.textBlockType.Text; }
|
|
||||||
set { this.textBlockType.Text = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string, string> SelectionValues { get; set; }
|
|
||||||
|
|
||||||
#region event handler
|
|
||||||
|
|
||||||
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.EnableOK(false);
|
|
||||||
|
|
||||||
if (LocodeMode)
|
|
||||||
{
|
|
||||||
this.locodeControl.SetFocus();
|
|
||||||
this.locodeControl.PropertyChanged += LocodeControl_PropertyChanged;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.comboBoxValues.ItemsSource = this.SelectionValues;
|
|
||||||
this.comboBoxValues.SelectionChanged += ComboBoxValues_SelectionChanged;
|
|
||||||
this.comboBoxValues.Focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ComboBoxValues_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
string val = this.comboBoxValues.SelectedValue as string;
|
|
||||||
this.EnableOK(!val.IsNullOrEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LocodeControl_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
this.EnableOK(!locodeControl.LocodeValue.IsNullOrEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
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>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
|||||||
@ -1,43 +0,0 @@
|
|||||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.NewDGItemDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:ENI2.EditControls"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
|
||||||
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">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="90" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="2*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<Label Content="{x:Static p:Resources.textType}" Grid.Row="0" Grid.Column="0" />
|
|
||||||
<ComboBox Name="comboBoxType" Grid.Column="1" Grid.Row="0" Margin="2" SelectionChanged="comboBoxType_SelectionChanged" />
|
|
||||||
<Label Content="{x:Static p:Resources.textDescription}" Grid.Row="1" Grid.Column="0" />
|
|
||||||
<xctk:WatermarkTextBox Margin="2" Watermark="{x:Static p:Resources.textSearch}" Name="textBoxSearchDescription" Grid.Row="1" Grid.Column="1" TextChanged="textBoxSearchDescription_TextChanged" />
|
|
||||||
<ListBox Name="listBoxDescription" Grid.Column="1" Grid.Row="2" Margin="2" SelectionChanged="listBoxDescription_SelectionChanged" />
|
|
||||||
<Label Content="{x:Static p:Resources.textRemarks}" Grid.Row="5" Grid.Column="0" />
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockDescription" Margin="2" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="5" Grid.RowSpan="2" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockRemarks" Margin="2" Background="LightGray" TextWrapping="Wrap" />
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</enictrl:EditWindowBase>
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
|
||||||
// Description: select a new DG item from a selection of templates
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ENI2.Controls;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for NewDGItemDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class NewDGItemDialog : EditWindowBase
|
|
||||||
{
|
|
||||||
private List<HAZPosTemplate> _data = null;
|
|
||||||
private static readonly object filterLock = new object();
|
|
||||||
|
|
||||||
public NewDGItemDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HAZPosTemplate SelectedTemplate
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.listBoxDescription.SelectedItem as HAZPosTemplate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
// load combo boxes
|
|
||||||
_data = LocalizedLookup.LoadHAZTemplates();
|
|
||||||
this.listBoxDescription.ItemsSource = _data;
|
|
||||||
this.comboBoxType.ItemsSource = Enum.GetValues(typeof(HAZPosTemplate.SublistType));
|
|
||||||
this.OkVisible = false;
|
|
||||||
this.AddVisible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBoxType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
FilterDescriptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listBoxDescription_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.listBoxDescription.SelectedItem is HAZPosTemplate selectedTemplate)
|
|
||||||
{
|
|
||||||
this.textBlockDescription.Text = selectedTemplate.Description;
|
|
||||||
this.textBlockRemarks.Text = selectedTemplate.Comment;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.textBlockDescription.Text = "";
|
|
||||||
this.textBlockRemarks.Text = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSearchDescription_TextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
FilterDescriptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FilterDescriptions()
|
|
||||||
{
|
|
||||||
string searchText = this.textBoxSearchDescription.Text.Trim();
|
|
||||||
|
|
||||||
lock (filterLock)
|
|
||||||
{
|
|
||||||
IEnumerable<HAZPosTemplate> filtered = _data;
|
|
||||||
if (searchText.Length > 0)
|
|
||||||
{
|
|
||||||
filtered = _data.Where(elem => elem.Description.ToUpperInvariant().Contains(searchText.ToUpperInvariant()));
|
|
||||||
}
|
|
||||||
if (this.comboBoxType.SelectedItem != null)
|
|
||||||
{
|
|
||||||
HAZPosTemplate.SublistType sType = (HAZPosTemplate.SublistType)this.comboBoxType.SelectedItem;
|
|
||||||
filtered = filtered.Where(elem => elem.TemplateType == sType);
|
|
||||||
}
|
|
||||||
this.listBoxDescription.ItemsSource = filtered;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
mc:Ignorable="d"
|
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 Margin="4">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|||||||
@ -31,15 +31,11 @@ namespace ENI2.EditControls
|
|||||||
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
|
List<KeyValuePair<Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<Message.NSWProvider, string>>()
|
||||||
{
|
{
|
||||||
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
new KeyValuePair<Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord" ),
|
||||||
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH"),
|
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH, "DBH")
|
||||||
new KeyValuePair<Message.NSWProvider, string>(Message.NSWProvider.DBH_MAERSK, "DBH / Maersk")
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
|
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
|
||||||
this.comboBoxInitialHIS.SelectedIndex = 0;
|
this.comboBoxInitialHIS.SelectedIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ValidId { get; set; }
|
public bool ValidId { get; set; }
|
||||||
@ -57,14 +53,6 @@ namespace ENI2.EditControls
|
|||||||
private void textBoxVisitTransitId_TextChanged(object sender, TextChangedEventArgs e)
|
private void textBoxVisitTransitId_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.CheckComplete();
|
this.CheckComplete();
|
||||||
if(textBoxVisitTransitId.Text.StartsWith("DEBRE") || textBoxVisitTransitId.Text.StartsWith("DEBRV"))
|
|
||||||
{
|
|
||||||
this.comboBoxInitialHIS.SelectedValue = Message.NSWProvider.DBH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.comboBoxInitialHIS.SelectedValue = Message.NSWProvider.DUDR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckComplete()
|
private void CheckComplete()
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectCrewMemberDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:ENI2.EditControls"
|
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="{x:Static p:Resources.textSelectCrewMember}" Height="160" Width="400" Background="AliceBlue">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width=".5*" />
|
|
||||||
<ColumnDefinition Width=".5*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
<RowDefinition Height="28"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" />
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" />
|
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textCrewFunctionOnBoard}" />
|
|
||||||
|
|
||||||
<TextBlock Text="{Binding CrewMemberLastName}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" />
|
|
||||||
<TextBlock Text="{Binding CrewMemberFirstName}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" />
|
|
||||||
<TextBlock Text="{Binding CrewMemberDuty}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" />
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</enictrl:EditWindowBase>
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
// Copyright (c) 2017- schick Informatik
|
|
||||||
// Description:
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ENI2.Controls;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for SelectCrewMemberDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class SelectCrewMemberDialog : EditWindowBase
|
|
||||||
{
|
|
||||||
public SelectCrewMemberDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
Loaded += SelectCrewMemberDialog_Loaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public CREW CREW { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region event handler
|
|
||||||
|
|
||||||
private void SelectCrewMemberDialog_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (CREW != null)
|
|
||||||
{
|
|
||||||
this.DataContext = CREW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -8,14 +8,14 @@
|
|||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:p="clr-namespace:ENI2.Properties"
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
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>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="27" />
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
<RowDefinition Height="27" />
|
<RowDefinition Height="27" />
|
||||||
<RowDefinition Height="27" />
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="1">
|
<Grid Grid.Row="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width=".5*"/>
|
<ColumnDefinition Width=".5*"/>
|
||||||
<ColumnDefinition Width=".5*"/>
|
<ColumnDefinition Width=".5*"/>
|
||||||
@ -23,6 +23,6 @@
|
|||||||
<Button x:Name="buttonAll" Grid.Column="0" Margin="2" Content="{x:Static p:Resources.textSelectAll}" Click="buttonAll_Click" />
|
<Button x:Name="buttonAll" Grid.Column="0" Margin="2" Content="{x:Static p:Resources.textSelectAll}" Click="buttonAll_Click" />
|
||||||
<Button x:Name="buttonNone" Grid.Column="1" Margin="2" Content="{x:Static p:Resources.textSelectNone}" Click="buttonNone_Click"/>
|
<Button x:Name="buttonNone" Grid.Column="1" Margin="2" Content="{x:Static p:Resources.textSelectNone}" Click="buttonNone_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<xctk:CheckListBox x:Name="checkListBoxClasses" Grid.Row="0" Margin="2" VerticalAlignment="Stretch" ValueMemberPath="Class" DisplayMemberPath="Name" SelectedMemberPath="IsSelected" />
|
<xctk:CheckListBox x:Name="checkListBoxClasses" Grid.Row="1" Margin="2" VerticalAlignment="Stretch" ValueMemberPath="Class" DisplayMemberPath="Name" SelectedMemberPath="IsSelected" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
// Copyright (c) 2017-today schick Informatik
|
// 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
|
// Returns: Array of selected classes as property
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
namespace ENI2.EditControls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -16,8 +17,7 @@ namespace ENI2.EditControls
|
|||||||
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
|
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
|
||||||
{
|
{
|
||||||
private readonly List<SelectClass> _selectClasses = new List<SelectClass>();
|
private readonly List<SelectClass> _selectClasses = new List<SelectClass>();
|
||||||
private readonly List<Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
|
private readonly List<bsmd.database.Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
|
||||||
private readonly List<Message.NotificationClass> _preselectedClasses = new List<Message.NotificationClass>();
|
|
||||||
|
|
||||||
public SelectImportClassesDialog()
|
public SelectImportClassesDialog()
|
||||||
{
|
{
|
||||||
@ -25,61 +25,35 @@ namespace ENI2.EditControls
|
|||||||
this.Loaded += SelectImportClassesDialog_Loaded;
|
this.Loaded += SelectImportClassesDialog_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// List of all message classes that are available for selection
|
|
||||||
/// </summary>
|
|
||||||
public List<Message.NotificationClass> SelectedClasses
|
public List<Message.NotificationClass> SelectedClasses
|
||||||
{
|
{
|
||||||
get { return _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>
|
/// <summary>
|
||||||
/// These messages are needed to derive message classes from, already sorted in the right manner
|
/// These messages are needed to derive message classes from, already sorted in the right manner
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Message> Messages { get; set; }
|
public List<Message> Messages { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Flag to reduce selection amount in case of transit
|
|
||||||
/// </summary>
|
|
||||||
public bool IsTransit { get; set; }
|
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)
|
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) ||
|
if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
|
(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.ATA) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.STO) ||
|
||||||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) || // XXX : TODO remove
|
||||||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.PASD)
|
||||||
|
) continue;
|
||||||
|
|
||||||
|
if (IsTransit &&
|
||||||
|
((aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
||||||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
|
||||||
@ -93,13 +67,12 @@ namespace ENI2.EditControls
|
|||||||
)) continue;
|
)) continue;
|
||||||
|
|
||||||
SelectClass sc = new SelectClass();
|
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.Class = aMessage.MessageNotificationClass;
|
||||||
sc.IsSelected = this._preselectedClasses.Contains(sc.Class);
|
sc.IsSelected = false;
|
||||||
_selectClasses.Add(sc);
|
_selectClasses.Add(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
||||||
this.OKClicked += SelectImportClassesDialog_OKClicked;
|
this.OKClicked += SelectImportClassesDialog_OKClicked;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectPortAreaDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
|
||||||
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">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="84" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
<RowDefinition Height="90" />
|
|
||||||
<RowDefinition Height="28" />
|
|
||||||
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="80" />
|
|
||||||
<ColumnDefinition Width="2*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Label Grid.Row="1" Content="Select" />
|
|
||||||
<Label Grid.Row="0" x:Name="labelLocode" Content="ZZUKN" />
|
|
||||||
<ListBox Name="listBoxAreas" Grid.Column="1" Grid.Row="1" Margin="2" SelectionChanged="comboBoxType_SelectionChanged" />
|
|
||||||
<xctk:WatermarkTextBox Margin="2" Watermark="{x:Static p:Resources.textSearch}" Name="textBoxSearchDescription" Grid.Row="0" Grid.Column="1" TextChanged="textBoxSearchDescription_TextChanged" />
|
|
||||||
<Label Grid.Row="2" Content="Agency" />
|
|
||||||
<Label Grid.Row="3" Content="Ships" />
|
|
||||||
<Label Grid.Row="4" Content="Berth" />
|
|
||||||
<Label Grid.Row="5" Content="PortArea" />
|
|
||||||
<Label Grid.Row="6" Content="Remark" />
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="2" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockAgency" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockShips" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="4" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockBerth" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="5" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockPortArea" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<Border BorderThickness="1" Grid.Column="1" Grid.Row="6" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
|
||||||
<TextBlock Name="textBlockRemarks" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</enictrl:EditWindowBase>
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
// Copyright (c) 2023- schick Informatik
|
|
||||||
// Description: Helper search window to
|
|
||||||
//
|
|
||||||
|
|
||||||
using bsmd.database;
|
|
||||||
using ENI2.Controls;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace ENI2.EditControls
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for SelectPortAreaDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class SelectPortAreaDialog : EditWindowBase
|
|
||||||
{
|
|
||||||
|
|
||||||
#region Fields
|
|
||||||
|
|
||||||
private readonly string _poc = null;
|
|
||||||
private List<PortAreaInfo> _portAreas;
|
|
||||||
private static readonly object filterLock = new object();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Construction
|
|
||||||
|
|
||||||
public SelectPortAreaDialog(string poc)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
_poc = poc;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
public string SelectedArea { get; private set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region event handler
|
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if(LocalizedLookup.getPortAreaInfos().ContainsKey(this._poc))
|
|
||||||
_portAreas = LocalizedLookup.getPortAreaInfos()[this._poc];
|
|
||||||
this.labelLocode.Content = this._poc;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBoxType_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.listBoxAreas.SelectedItem is PortAreaInfo pai)
|
|
||||||
{
|
|
||||||
this.textBlockAgency.Text = pai.Agency;
|
|
||||||
this.textBlockBerth.Text = pai.Berth;
|
|
||||||
this.textBlockPortArea.Text = pai.PortArea;
|
|
||||||
this.textBlockShips.Text = pai.Ships;
|
|
||||||
this.textBlockRemarks.Text = pai.Remark;
|
|
||||||
this.SelectedArea = pai.PortAreaCode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSearchDescription_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
string searchText = this.textBoxSearchDescription.Text.Trim();
|
|
||||||
if (_portAreas == null) return;
|
|
||||||
lock (filterLock)
|
|
||||||
{
|
|
||||||
IEnumerable<PortAreaInfo> filtered = _portAreas;
|
|
||||||
if (searchText.Length > 0)
|
|
||||||
{
|
|
||||||
filtered = _portAreas.Where(elem => (elem.Remark != null && elem.Remark.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
|
||||||
(elem.Agency != null && elem.Agency.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
|
||||||
(elem.Berth != null && elem.Berth.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
|
||||||
(elem.PortArea != null && elem.PortArea.ToUpperInvariant().Contains(searchText.ToUpperInvariant())));
|
|
||||||
}
|
|
||||||
this.listBoxAreas.ItemsSource = filtered;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user