Merge branch 'release/eni_7.2.7'
This commit is contained in:
commit
63d44fc926
@ -1,20 +1,8 @@
|
|||||||
// 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
|
||||||
{
|
{
|
||||||
@ -43,10 +31,9 @@ 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +50,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
if((this.MessageCoreSelected != null) && (aMessageCore != null))
|
if((this.MessageCoreSelected != null) && (aMessageCore != null))
|
||||||
{
|
{
|
||||||
this.MessageCoreSelected(aMessageCore);
|
this.MessageCoreSelected(aMessageCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
<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.5.2"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
</startup>
|
</startup>
|
||||||
<applicationSettings>
|
<applicationSettings>
|
||||||
<ENI2.Properties.Settings>
|
<ENI2.Properties.Settings>
|
||||||
@ -26,17 +26,17 @@
|
|||||||
<value>1000</value>
|
<value>1000</value>
|
||||||
</setting>
|
</setting>
|
||||||
<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="ConnectionString" serializeAs="String">
|
<setting name="ConnectionString" serializeAs="String">
|
||||||
<value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
|
<value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
|
||||||
</setting>
|
</setting>
|
||||||
</ENI2.Properties.Settings>
|
</ENI2.Properties.Settings>
|
||||||
</applicationSettings>
|
</applicationSettings>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
<ENI2.Properties.Settings>
|
<ENI2.Properties.Settings>
|
||||||
<setting name="MainWindowPlacement" serializeAs="String">
|
<setting name="MainWindowPlacement" serializeAs="String">
|
||||||
<value/>
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
</ENI2.Properties.Settings>
|
</ENI2.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
@ -60,6 +60,10 @@
|
|||||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||||
|
|||||||
@ -35,7 +35,7 @@ namespace ENI2
|
|||||||
private ManualResetEvent ResetSplashCreated;
|
private ManualResetEvent ResetSplashCreated;
|
||||||
private Thread _splashThread;
|
private Thread _splashThread;
|
||||||
|
|
||||||
private ILog _log = LogManager.GetLogger(typeof(App).Name);
|
private readonly ILog _log = LogManager.GetLogger(typeof(App).Name);
|
||||||
|
|
||||||
public App() : base()
|
public App() : base()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -290,24 +290,10 @@ namespace ENI2.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.TimeFilterItemSource();
|
this.TimeFilterItemSource();
|
||||||
// this.SortItemSource();
|
|
||||||
this.dataGridPOCores.SelectedItem = null;
|
this.dataGridPOCores.SelectedItem = null;
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ReadFieldAsString(IExcelDataReader reader, int fieldNum)
|
|
||||||
{
|
|
||||||
if (fieldNum >= reader.FieldCount) return null;
|
|
||||||
if (reader.GetFieldType(fieldNum) == typeof(string))
|
|
||||||
return reader.GetString(fieldNum).Clean();
|
|
||||||
if (reader.GetFieldType(fieldNum) == typeof(DateTime))
|
|
||||||
return reader.GetDateTime(fieldNum).ToString();
|
|
||||||
if (reader.GetFieldType(fieldNum) == typeof(int))
|
|
||||||
return reader.GetInt32(fieldNum).ToString();
|
|
||||||
if (reader.GetFieldType(fieldNum) == typeof(double))
|
|
||||||
return ((int) reader.GetDouble(fieldNum)).ToString();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TimeFilterItemSource()
|
private void TimeFilterItemSource()
|
||||||
{
|
{
|
||||||
@ -330,16 +316,7 @@ namespace ENI2.Controls
|
|||||||
|
|
||||||
foreach (MaerskData md in removeList)
|
foreach (MaerskData md in removeList)
|
||||||
this.maerskDataList.Remove(md);
|
this.maerskDataList.Remove(md);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SortItemSource()
|
|
||||||
{
|
|
||||||
ObservableCollection<MaerskData> temp;
|
|
||||||
temp = new ObservableCollection<MaerskData>(this.maerskDataList.OrderBy(p => p.ColA));
|
|
||||||
this.maerskDataList.Clear();
|
|
||||||
foreach (MaerskData md in temp)
|
|
||||||
this.maerskDataList.Add(md);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -409,28 +386,28 @@ namespace ENI2.Controls
|
|||||||
if (DateTime.TryParse(md.ColA, out DateTime aDateTime))
|
if (DateTime.TryParse(md.ColA, out DateTime aDateTime))
|
||||||
md.ETA = aDateTime;
|
md.ETA = aDateTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!reader.IsDBNull(1)) md.ColB = ReadFieldAsString(reader, 1);
|
if (!reader.IsDBNull(1)) md.ColB = reader.ReadAsString(1);
|
||||||
if (!reader.IsDBNull(2)) md.ColC = ReadFieldAsString(reader, 2);
|
if (!reader.IsDBNull(2)) md.ColC = reader.ReadAsString(2);
|
||||||
if (!reader.IsDBNull(3)) md.ColD = ReadFieldAsString(reader, 3);
|
if (!reader.IsDBNull(3)) md.ColD = reader.ReadAsString(3);
|
||||||
if (!reader.IsDBNull(4)) md.ColE = ReadFieldAsString(reader, 4);
|
if (!reader.IsDBNull(4)) md.ColE = reader.ReadAsString(4);
|
||||||
if (!reader.IsDBNull(5)) md.ColF = ReadFieldAsString(reader, 5);
|
if (!reader.IsDBNull(5)) md.ColF = reader.ReadAsString(5);
|
||||||
if (!reader.IsDBNull(6)) md.ColG = ReadFieldAsString(reader, 6);
|
if (!reader.IsDBNull(6)) md.ColG = reader.ReadAsString(6);
|
||||||
if (!reader.IsDBNull(7)) md.ColH = ReadFieldAsString(reader, 7);
|
if (!reader.IsDBNull(7)) md.ColH = reader.ReadAsString(7);
|
||||||
if (!reader.IsDBNull(8)) md.ColI = ReadFieldAsString(reader, 8);
|
if (!reader.IsDBNull(8)) md.ColI = reader.ReadAsString(8);
|
||||||
if (md.ColI != null)
|
if (md.ColI != null)
|
||||||
{
|
{
|
||||||
if ((md.ColI.Contains("bremerhaven", StringComparison.OrdinalIgnoreCase) && this.PortLocode.Equals("DEWVN")) ||
|
if ((md.ColI.Contains("bremerhaven", StringComparison.OrdinalIgnoreCase) && this.PortLocode.Equals("DEWVN")) ||
|
||||||
(md.ColI.Contains("eurogate", StringComparison.OrdinalIgnoreCase) && this.PortLocode.Equals("DEBRV")))
|
(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");
|
throw new InvalidOperationException($"{md.ColI} found in import to {PortLocode}, this is probably an error. Aborting import");
|
||||||
}
|
}
|
||||||
if (!reader.IsDBNull(9)) md.ColJ = ReadFieldAsString(reader, 9);
|
if (!reader.IsDBNull(9)) md.ColJ = reader.ReadAsString(9);
|
||||||
if (md.ColJ == null) continue;
|
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 (!(md.ColJ.Equals("msk", StringComparison.OrdinalIgnoreCase) || md.ColJ.Equals("sgl", StringComparison.OrdinalIgnoreCase))) continue; // skip operator we are not interested in
|
||||||
if (!reader.IsDBNull(10)) md.ColK = ReadFieldAsString(reader, 10);
|
if (!reader.IsDBNull(10)) md.ColK = reader.ReadAsString(10);
|
||||||
if (!reader.IsDBNull(11)) md.ColL = ReadFieldAsString(reader, 11);
|
if (!reader.IsDBNull(11)) md.ColL = reader.ReadAsString(11);
|
||||||
if (!reader.IsDBNull(12)) md.ColM = ReadFieldAsString(reader, 12);
|
if (!reader.IsDBNull(12)) md.ColM = reader.ReadAsString(12);
|
||||||
if (!reader.IsDBNull(13)) md.Remark = ReadFieldAsString(reader, 13);
|
if (!reader.IsDBNull(13)) md.Remark = reader.ReadAsString(13);
|
||||||
|
|
||||||
if(!md.ColF.IsNullOrEmpty())
|
if(!md.ColF.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
@ -515,8 +492,7 @@ namespace ENI2.Controls
|
|||||||
maerskDataList.Add(md);
|
maerskDataList.Add(md);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.TimeFilterItemSource();
|
this.TimeFilterItemSource();
|
||||||
// this.SortItemSource();
|
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
||||||
|
|
||||||
this.dataGridPOCores.Items.Refresh();
|
this.dataGridPOCores.Items.Refresh();
|
||||||
@ -631,7 +607,7 @@ namespace ENI2.Controls
|
|||||||
MaerskData md = grid.SelectedItem as MaerskData;
|
MaerskData md = grid.SelectedItem as MaerskData;
|
||||||
if(md.MessageCore != null) {
|
if(md.MessageCore != null) {
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
this.MessageCoreSelected?.Invoke(md.MessageCore);
|
this.MessageCoreSelected?.Invoke(md.MessageCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,6 +185,17 @@ 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)
|
||||||
@ -338,9 +349,7 @@ namespace ENI2
|
|||||||
GlobalStructures.FilterCombobox(cmb, e.Key);
|
GlobalStructures.FilterCombobox(cmb, e.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IHighlightControlContainer implementation
|
#region IHighlightControlContainer implementation
|
||||||
|
|
||||||
|
|||||||
@ -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="Ship e-mail:" VerticalContentAlignment="Center" />
|
<Label Margin="10,0,0,0" Content="{x:Static p:Resources.textShipEmail}" 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">
|
||||||
|
|||||||
@ -15,8 +15,8 @@ using ENI2.Util;
|
|||||||
|
|
||||||
using ENI2.EditControls;
|
using ENI2.EditControls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Microsoft.Office.Interop.Excel;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using ENI2.SheetDisplayControls;
|
||||||
|
|
||||||
namespace ENI2
|
namespace ENI2
|
||||||
{
|
{
|
||||||
@ -43,7 +43,7 @@ namespace ENI2
|
|||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public MessageCore Core { get; private set; }
|
public MessageCore Core { get; private set; }
|
||||||
|
|
||||||
public bool LockedByOtherUser { get; set; }
|
public bool LockedByOtherUser { get; set; }
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ namespace ENI2
|
|||||||
|
|
||||||
#region Construction
|
#region Construction
|
||||||
|
|
||||||
public DetailRootControl(MessageCore aCore)
|
public DetailRootControl(MessageCore aCore, ReportingParty.ShipcallDisplayModeEnum displayMode)
|
||||||
{
|
{
|
||||||
Core = aCore;
|
Core = aCore;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -154,23 +154,42 @@ namespace ENI2
|
|||||||
shipEMailLabel.Text = aCore.HerbergEmailContactReportingVessel;
|
shipEMailLabel.Text = aCore.HerbergEmailContactReportingVessel;
|
||||||
displayIdLabel.Text = aCore.DisplayId;
|
displayIdLabel.Text = aCore.DisplayId;
|
||||||
|
|
||||||
|
// Unterscheidung in welchem Darstellungs-Mode der Anlauf dargestellt wird (Classic oder Formblatt)
|
||||||
|
|
||||||
// Listbox befüllen
|
if (displayMode == ReportingParty.ShipcallDisplayModeEnum.CLASSIC)
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textOverview, MessageGroupControlType = typeof(OverViewDetailControl), ImagePath = "Resources/documents.png" });
|
{
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortCall, MessageGroupControlType = typeof(PortCallDetailControl), ImagePath = "Resources/eye_blue.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textOverview, MessageGroupControlType = typeof(OverViewDetailControl), ImagePath = "Resources/documents.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortNotification, MessageGroupControlType = typeof(PortNotificationDetailControl), ImagePath = "Resources/anchor.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortCall, MessageGroupControlType = typeof(PortCallDetailControl), ImagePath = "Resources/eye_blue.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textWaste, MessageGroupControlType = typeof(WasteDetailControl), ImagePath = "Resources/garbage.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPortNotification, MessageGroupControlType = typeof(PortNotificationDetailControl), ImagePath = "Resources/anchor.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textArrivalNotification, MessageGroupControlType = typeof(ArrivalNotificationDetailControl), ImagePath = "Resources/arrow_down_right_red.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textWaste, MessageGroupControlType = typeof(WasteDetailControl), ImagePath = "Resources/garbage.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textSecurity, MessageGroupControlType = typeof(SecurityDetailControl), ImagePath = "Resources/shield_yellow.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textArrivalNotification, MessageGroupControlType = typeof(ArrivalNotificationDetailControl), ImagePath = "Resources/arrow_down_right_red.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPSC72h, MessageGroupControlType = typeof(PSC72hDetailControl), ImagePath = "Resources/alarmclock.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textSecurity, MessageGroupControlType = typeof(SecurityDetailControl), ImagePath = "Resources/shield_yellow.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textMDH, MessageGroupControlType = typeof(MaritimeHealthDeclarationDetailControl), ImagePath = "Resources/medical_bag.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPSC72h, MessageGroupControlType = typeof(PSC72hDetailControl), ImagePath = "Resources/alarmclock.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDepartureNotification, MessageGroupControlType = typeof(DepartureNotificationDetailControl), ImagePath = "Resources/arrow_up_right_green.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textMDH, MessageGroupControlType = typeof(MaritimeHealthDeclarationDetailControl), ImagePath = "Resources/medical_bag.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDepartureNotification, MessageGroupControlType = typeof(DepartureNotificationDetailControl), ImagePath = "Resources/arrow_up_right_green.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGArrival, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGDeparture, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGArrival, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
||||||
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" });
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGDeparture, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textOverview, MessageGroupControlType = typeof(OverViewDetailControl), ImagePath = "Resources/documents.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text1Voyage, MessageGroupControlType = typeof(VoyageControl), ImagePath = "Resources/ship2.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text2PortCall, MessageGroupControlType = typeof(PortControl), ImagePath = "Resources/anchor.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text3PreArrival, MessageGroupControlType = typeof(PreArrivalControl), ImagePath = "Resources/arrow_down_right_red.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text4PreDeparture, MessageGroupControlType = typeof(PreDepartureControl), ImagePath = "Resources/arrow_up_right_green.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text5ShipData, MessageGroupControlType = typeof(ShipDataControl), ImagePath = "Resources/containership.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text6CrewDataOnArrival, MessageGroupControlType = typeof(CrewPreArrivalControl), ImagePath = "Resources/arrival_worker.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text7CrewDeparture, MessageGroupControlType = typeof(CrewDepartureControl), ImagePath = "Resources/departure_worker.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text8PassengerArrival, MessageGroupControlType = typeof(PassengerPreArrivalControl), ImagePath = "Resources/arrival_user.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text9PassengerDeparture, MessageGroupControlType = typeof(PassengerDepartureControl), ImagePath = "Resources/departure_user.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text10DangerousCargoArrival, MessageGroupControlType = typeof(DangerousCargoControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text11DangerousCargoDeparture, MessageGroupControlType = typeof(DangerousCargoControl), ImagePath = "Resources/sign_warning_radiation.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text12ATAATD, MessageGroupControlType = typeof(ATAControl), ImagePath = "Resources/clock.png" });
|
||||||
|
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text13WasteReceipts, MessageGroupControlType = typeof(WasteReceiptsControl), ImagePath = "Resources/garbage.png" });
|
||||||
|
}
|
||||||
|
|
||||||
this.listBoxMessages.ItemsSource = this._listBoxList;
|
this.listBoxMessages.ItemsSource = this._listBoxList;
|
||||||
|
|
||||||
@ -252,6 +271,8 @@ namespace ENI2
|
|||||||
// Spezial-Balkon für die Wiederverwendung von HAZD / HAZA als ein Control (es tut mir leid :D)
|
// Spezial-Balkon für die Wiederverwendung von HAZD / HAZA als ein Control (es tut mir leid :D)
|
||||||
if (mg.MessageGroupName.Equals(Properties.Resources.textDGDeparture))
|
if (mg.MessageGroupName.Equals(Properties.Resources.textDGDeparture))
|
||||||
((DangerousGoodsDetailControl)detailControl).IsDeparture = true;
|
((DangerousGoodsDetailControl)detailControl).IsDeparture = true;
|
||||||
|
if (mg.MessageGroupName.Equals(Properties.Resources.text11DangerousCargoDeparture))
|
||||||
|
((DangerousCargoControl)detailControl).IsDeparture = true;
|
||||||
detailControl.Core = Core;
|
detailControl.Core = Core;
|
||||||
detailControl.Messages = _messages;
|
detailControl.Messages = _messages;
|
||||||
detailControl.LockedByOtherUser = this.LockedByOtherUser;
|
detailControl.LockedByOtherUser = this.LockedByOtherUser;
|
||||||
@ -464,6 +485,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
|
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
|
int currentMainTabIndex = -1;
|
||||||
|
|
||||||
if (this.detailView.Children[0] is DetailBaseControl currentControl)
|
if (this.detailView.Children[0] is DetailBaseControl currentControl)
|
||||||
{
|
{
|
||||||
@ -478,10 +500,24 @@ namespace ENI2
|
|||||||
// ggf. hat sich die Ticketnr geändert..
|
// ggf. hat sich die Ticketnr geändert..
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.DetailControl_RequestReload(this.Core.Id.Value);
|
currentMainTabIndex = currentControl.SelectedTabIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.DetailControl_RequestReload(this.Core.Id.Value);
|
||||||
|
|
||||||
|
System.Action<int> SetTabAction = (int x) =>
|
||||||
|
{
|
||||||
|
// this hopefully happens *after* the view was completely reloaded
|
||||||
|
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
||||||
|
{
|
||||||
|
currentNewControl.SelectedTabIndex = x;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (currentMainTabIndex >= 0)
|
||||||
|
Dispatcher.BeginInvoke(SetTabAction, currentMainTabIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveMessage(Message message)
|
private void SaveMessage(Message message)
|
||||||
@ -532,6 +568,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
|
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
|
int currentMainTabIndex = -1;
|
||||||
|
|
||||||
foreach (Message message in this._messages)
|
foreach (Message message in this._messages)
|
||||||
{
|
{
|
||||||
@ -542,13 +579,30 @@ namespace ENI2
|
|||||||
if (currentControl is OverViewDetailControl)
|
if (currentControl is OverViewDetailControl)
|
||||||
{
|
{
|
||||||
// ggf. hat sich die Ticketnr geändert..
|
// ggf. hat sich die Ticketnr geändert..
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core);
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentMainTabIndex = currentControl.SelectedTabIndex;
|
||||||
|
Trace.WriteLine($"Last selected tab index: {currentMainTabIndex}");
|
||||||
|
|
||||||
this.buttonSaveAll.Visibility = Visibility.Hidden;
|
this.buttonSaveAll.Visibility = Visibility.Hidden;
|
||||||
this.buttonSave.Visibility = Visibility.Hidden;
|
this.buttonSave.Visibility = Visibility.Hidden;
|
||||||
|
|
||||||
|
this.DetailControl_RequestReload(this.Core.Id.Value);
|
||||||
|
|
||||||
|
System.Action<int> SetTabAction = (int x) =>
|
||||||
|
{
|
||||||
|
// this hopefully happens *after* the view was completely reloaded
|
||||||
|
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
||||||
|
{
|
||||||
|
currentNewControl.SelectedTabIndex = x;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if(currentMainTabIndex >= 0)
|
||||||
|
Dispatcher.BeginInvoke(SetTabAction, currentMainTabIndex);
|
||||||
}
|
}
|
||||||
this.DetailControl_RequestReload(this.Core.Id.Value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DetailControl_NotificationClassChanged(Message.NotificationClass? notificationClass)
|
private void DetailControl_NotificationClassChanged(Message.NotificationClass? notificationClass)
|
||||||
@ -623,12 +677,15 @@ namespace ENI2
|
|||||||
this.detailView.Children.Clear();
|
this.detailView.Children.Clear();
|
||||||
this.controlCache.Clear();
|
this.controlCache.Clear();
|
||||||
|
|
||||||
// return to "new" overviewdan
|
int currentIndex = this.listBoxMessages.SelectedIndex;
|
||||||
|
|
||||||
|
// return to "new" overview
|
||||||
Dispatcher.BeginInvoke((System.Action)(() =>
|
Dispatcher.BeginInvoke((System.Action)(() =>
|
||||||
{
|
{
|
||||||
this.listBoxMessages_SelectionChanged(this, null);
|
this.listBoxMessages_SelectionChanged(this, null);
|
||||||
shipNameLabel.Text = this.Core.Shipname;
|
shipNameLabel.Text = this.Core.Shipname;
|
||||||
shipEMailLabel.Text = this.Core.HerbergEmailContactReportingVessel;
|
shipEMailLabel.Text = this.Core.HerbergEmailContactReportingVessel;
|
||||||
|
this.listBoxMessages.SelectedIndex = currentIndex;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@ -288,18 +288,7 @@ namespace ENI2.DetailViewControls
|
|||||||
if (this._tiefaMessage.HasViolations) this.tiefaGroupBox.BorderBrush = Brushes.Yellow;
|
if (this._tiefaMessage.HasViolations) this.tiefaGroupBox.BorderBrush = Brushes.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
#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)
|
||||||
|
|
||||||
|
|||||||
@ -239,12 +239,18 @@ namespace ENI2.DetailViewControls
|
|||||||
MenuItem copyPASDItem = new MenuItem();
|
MenuItem copyPASDItem = new MenuItem();
|
||||||
copyPASDItem.Header = Properties.Resources.textCopyToPASA;
|
copyPASDItem.Header = Properties.Resources.textCopyToPASA;
|
||||||
copyPASDItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
copyPASDItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
copyPASDItem.Click += CopyPASDItem_Click; ;
|
copyPASDItem.Click += CopyPASDItem_Click;
|
||||||
this.dataGridPassengerListDeparture.ContextMenu.Items.Add(copyPASDItem);
|
this.dataGridPassengerListDeparture.ContextMenu.Items.Add(copyPASDItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int SelectedTabIndex
|
||||||
|
{
|
||||||
|
get { return this.mainFrame.SelectedIndex; }
|
||||||
|
set { this.mainFrame.SelectedIndex = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#region Grid copy handlers
|
#region Grid copy handlers
|
||||||
|
|
||||||
@ -678,7 +684,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this._pasdMessage.Elements.Add(epd.PAS);
|
this._pasdMessage.Elements.Add(epd.PAS);
|
||||||
this.CheckPASD();
|
this.CheckPASD();
|
||||||
}
|
}
|
||||||
this.dataGridPassengerList.Items.Refresh();
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
epd.PAS = new PASD
|
epd.PAS = new PASD
|
||||||
{
|
{
|
||||||
IsDeparture = true,
|
IsDeparture = true,
|
||||||
@ -732,7 +738,7 @@ namespace ENI2.DetailViewControls
|
|||||||
_pasMessage.Elements.Add(epd.PAS);
|
_pasMessage.Elements.Add(epd.PAS);
|
||||||
this.CheckPASD();
|
this.CheckPASD();
|
||||||
}
|
}
|
||||||
this.dataGridPassengerList.Items.Refresh();
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
epd.PAS = new PASD
|
epd.PAS = new PASD
|
||||||
{
|
{
|
||||||
IsDeparture = true,
|
IsDeparture = true,
|
||||||
@ -1033,18 +1039,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Excel import
|
#region Excel import
|
||||||
|
|
||||||
private string getValueAsString(IExcelDataReader reader, int index)
|
|
||||||
{
|
|
||||||
Type fieldType = reader.GetFieldType(index);
|
|
||||||
if (fieldType == null) return null;
|
|
||||||
if (fieldType == typeof(double))
|
|
||||||
return reader.GetDouble(index).ToString();
|
|
||||||
if (fieldType == typeof(int))
|
|
||||||
return reader.GetInt32(index).ToString();
|
|
||||||
return reader.GetString(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e)
|
private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
@ -1091,10 +1086,10 @@ namespace ENI2.DetailViewControls
|
|||||||
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||||
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 9).Clean();
|
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = reader.ReadAsString(9).Clean();
|
||||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||||
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 12).Clean();
|
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = reader.ReadAsString(12).Clean();
|
||||||
|
|
||||||
crew.MessageHeader = this._crewMessage;
|
crew.MessageHeader = this._crewMessage;
|
||||||
crew.IsDirty = true;
|
crew.IsDirty = true;
|
||||||
@ -1168,12 +1163,12 @@ namespace ENI2.DetailViewControls
|
|||||||
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||||
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 9);
|
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = reader.ReadAsString(9);
|
||||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||||
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 12);
|
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = reader.ReadAsString(12);
|
||||||
|
|
||||||
crew.MessageHeader = this._crewMessage;
|
crew.MessageHeader = this._crewdMessage;
|
||||||
crew.IsDirty = true;
|
crew.IsDirty = true;
|
||||||
crew.Identifier = CREWD.GetNewIdentifier(this._crewdMessage.Elements);
|
crew.Identifier = CREWD.GetNewIdentifier(this._crewdMessage.Elements);
|
||||||
this._crewdMessage.Elements.Add(crew);
|
this._crewdMessage.Elements.Add(crew);
|
||||||
@ -1250,12 +1245,12 @@ namespace ENI2.DetailViewControls
|
|||||||
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper().Clean();
|
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper().Clean();
|
||||||
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||||
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 11).Clean();
|
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = reader.ReadAsString(11).Clean();
|
||||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||||
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = this.getValueAsString(reader, 14).Clean();
|
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = reader.ReadAsString(14).Clean();
|
||||||
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15).Clean();
|
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15).Clean();
|
||||||
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = this.getValueAsString(reader, 16).Clean();
|
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = reader.ReadAsString(16).Clean();
|
||||||
|
|
||||||
pas.MessageHeader = this._pasMessage;
|
pas.MessageHeader = this._pasMessage;
|
||||||
pas.IsDirty = true;
|
pas.IsDirty = true;
|
||||||
@ -1333,12 +1328,12 @@ namespace ENI2.DetailViewControls
|
|||||||
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||||
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 11);
|
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = reader.ReadAsString(11);
|
||||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||||
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = this.getValueAsString(reader, 14);
|
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = reader.ReadAsString(14);
|
||||||
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15);
|
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15);
|
||||||
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = this.getValueAsString(reader, 16);
|
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = reader.ReadAsString(16);
|
||||||
|
|
||||||
pas.MessageHeader = this._pasMessage;
|
pas.MessageHeader = this._pasMessage;
|
||||||
pas.IsDirty = true;
|
pas.IsDirty = true;
|
||||||
@ -1388,18 +1383,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.groupBoxPassengerList, HighlightService.HighlightStyle.VIOLATION, this._pasMessage);
|
HighlightService.HighlightControl(this.groupBoxPassengerList, HighlightService.HighlightStyle.VIOLATION, this._pasMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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 Schengen/PAX checkboxes changed event handler
|
#region Schengen/PAX checkboxes changed event handler
|
||||||
|
|
||||||
|
|||||||
@ -197,6 +197,12 @@ namespace ENI2.DetailViewControls
|
|||||||
this._initialized = true;
|
this._initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int SelectedTabIndex
|
||||||
|
{
|
||||||
|
get { return this.tabControlPositions.SelectedIndex; }
|
||||||
|
set { this.tabControlPositions.SelectedIndex = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#region SetEnabled
|
#region SetEnabled
|
||||||
|
|
||||||
public override void SetEnabled(bool enabled)
|
public override void SetEnabled(bool enabled)
|
||||||
@ -324,24 +330,7 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region MARPOL datagrid handlers
|
#region MARPOL datagrid handlers
|
||||||
|
|
||||||
@ -898,5 +887,26 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
#endregion
|
#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
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ 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.OnNotificationClassChanged(Message.NotificationClass.BKRD); };
|
this.dataGridBKRD.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.BKRD); };
|
||||||
startupComplete = true;
|
startupComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,18 +298,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.bkrdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._bkrdMessage);
|
HighlightService.HighlightControl(this.bkrdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._bkrdMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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)
|
||||||
|
|
||||||
|
|||||||
@ -130,6 +130,12 @@ 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)
|
||||||
@ -601,18 +607,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.mdhGroupBox, HighlightService.HighlightStyle.VIOLATION, this._mdhMessage);
|
HighlightService.HighlightControl(this.mdhGroupBox, HighlightService.HighlightStyle.VIOLATION, this._mdhMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -808,18 +808,7 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region mouse wheel
|
|
||||||
|
|
||||||
private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
|
||||||
{
|
|
||||||
ScrollViewer scv = (ScrollViewer)sender;
|
|
||||||
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,13 +18,13 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private Message _pre72hMessage;
|
private Message _pre72hMessage;
|
||||||
|
|
||||||
private static string[] hullConfiguration = {
|
private static readonly string[] hullConfiguration = {
|
||||||
Properties.Resources.textSingleHull,
|
Properties.Resources.textSingleHull,
|
||||||
Properties.Resources.textSingleHullBallast,
|
Properties.Resources.textSingleHullBallast,
|
||||||
Properties.Resources.textDoubleHull
|
Properties.Resources.textDoubleHull
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string[] conditionCargoTanks =
|
private static readonly string[] conditionCargoTanks =
|
||||||
{
|
{
|
||||||
Properties.Resources.textFull,
|
Properties.Resources.textFull,
|
||||||
Properties.Resources.textEmpty,
|
Properties.Resources.textEmpty,
|
||||||
@ -116,18 +116,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.groupBoxPre72H, HighlightService.HighlightStyle.VIOLATION, this._pre72hMessage);
|
HighlightService.HighlightControl(this.groupBoxPre72H, HighlightService.HighlightStyle.VIOLATION, this._pre72hMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -240,18 +240,7 @@ 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
|
||||||
|
|
||||||
|
|||||||
@ -363,18 +363,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.ladgGroupBox, HighlightService.HighlightStyle.VIOLATION, this._ladgMessage);
|
HighlightService.HighlightControl(this.ladgGroupBox, HighlightService.HighlightStyle.VIOLATION, this._ladgMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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 Spezialbalkon für die Gruppenauswahl im Core (Maersk BHV / Seago usw.)
|
#region Spezialbalkon für die Gruppenauswahl im Core (Maersk BHV / Seago usw.)
|
||||||
|
|
||||||
@ -416,7 +405,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private void CheckServiceEntryMaerskBHV()
|
private void CheckServiceEntryMaerskBHV()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach(SERV serv in this._servMessage.Elements)
|
foreach(SERV serv in _servMessage.Elements.Cast<SERV>())
|
||||||
{
|
{
|
||||||
if (serv.ServiceBeneficiary.Equals("Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655"))
|
if (serv.ServiceBeneficiary.Equals("Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655"))
|
||||||
found = true;
|
found = true;
|
||||||
@ -439,7 +428,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private void CheckServiceEntrySeaGoBHV()
|
private void CheckServiceEntrySeaGoBHV()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (SERV serv in this._servMessage.Elements)
|
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
|
||||||
{
|
{
|
||||||
if (serv.ServiceBeneficiary.Equals("Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655"))
|
if (serv.ServiceBeneficiary.Equals("Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655"))
|
||||||
found = true;
|
found = true;
|
||||||
@ -462,7 +451,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private void CheckServiceEntryHoegh()
|
private void CheckServiceEntryHoegh()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (SERV serv in this._servMessage.Elements)
|
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
|
||||||
{
|
{
|
||||||
if (serv.ServiceBeneficiary.Equals("Höegh Autoliners AS, Oslo, Norway"))
|
if (serv.ServiceBeneficiary.Equals("Höegh Autoliners AS, Oslo, Norway"))
|
||||||
found = true;
|
found = true;
|
||||||
@ -485,7 +474,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private void CheckServiceEntryFctJunge()
|
private void CheckServiceEntryFctJunge()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (SERV serv in this._servMessage.Elements)
|
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
|
||||||
{
|
{
|
||||||
if (serv.ServiceName.Equals("Fct Junge - Hamburg"))
|
if (serv.ServiceName.Equals("Fct Junge - Hamburg"))
|
||||||
found = true;
|
found = true;
|
||||||
@ -508,7 +497,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private void CheckServiceEntryElbeBulk()
|
private void CheckServiceEntryElbeBulk()
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (SERV serv in this._servMessage.Elements)
|
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
|
||||||
{
|
{
|
||||||
if (serv.ServiceName.Equals("Elbe Bulk Schiffe - Hamburg"))
|
if (serv.ServiceName.Equals("Elbe Bulk Schiffe - Hamburg"))
|
||||||
found = true;
|
found = true;
|
||||||
|
|||||||
@ -116,6 +116,12 @@ 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)
|
||||||
@ -502,18 +508,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.VIOLATION, this._secMessage);
|
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.VIOLATION, this._secMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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,10 +5,8 @@
|
|||||||
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,18 +102,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.shipDataGroupBox, HighlightService.HighlightStyle.VIOLATION, this._statMessage);
|
HighlightService.HighlightControl(this.shipDataGroupBox, HighlightService.HighlightStyle.VIOLATION, this._statMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void copyItemToTOWA(object sender, RoutedEventArgs e)
|
private void copyItemToTOWA(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// aus dem aktuell selektierten TOWA Element ein neues TOWD Element machen
|
// aus dem aktuell selektierten TOWD Element ein neues TOWA Element machen
|
||||||
if (this.dataGridTowageOnDeparture.SelectedItems != null)
|
if (this.dataGridTowageOnDeparture.SelectedItems != null)
|
||||||
{
|
{
|
||||||
foreach (TOWD selectedTOWD in this.dataGridTowageOnDeparture.SelectedItems)
|
foreach (TOWD selectedTOWD in this.dataGridTowageOnDeparture.SelectedItems)
|
||||||
@ -166,8 +166,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
TOWD towd = obj as TOWD;
|
if (obj is TOWD 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);
|
||||||
@ -245,8 +244,7 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
||||||
{
|
{
|
||||||
TOWA towa = obj as TOWA;
|
if (obj is TOWA 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,18 +308,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.groupBoxTowageOnDeparture, HighlightService.HighlightStyle.VIOLATION, this._towdMessage);
|
HighlightService.HighlightControl(this.groupBoxTowageOnDeparture, HighlightService.HighlightStyle.VIOLATION, this._towdMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,6 +187,12 @@ 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 async void DataGridWasteReceipt_CreateRequested()
|
private async void DataGridWasteReceipt_CreateRequested()
|
||||||
@ -477,18 +483,7 @@ namespace ENI2.DetailViewControls
|
|||||||
HighlightService.HighlightControl(this.wasGroupBox, HighlightService.HighlightStyle.VIOLATION, this._wasMessage);
|
HighlightService.HighlightControl(this.wasGroupBox, HighlightService.HighlightStyle.VIOLATION, this._wasMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#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
|
||||||
|
|
||||||
@ -596,8 +591,7 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Waste disposal Service Provider templates event handler
|
#region Waste disposal Service Provider templates event handler
|
||||||
|
|
||||||
|
|||||||
148
ENI2/ENI2.csproj
148
ENI2/ENI2.csproj
@ -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>4</ApplicationRevision>
|
<ApplicationRevision>7</ApplicationRevision>
|
||||||
<ApplicationVersion>7.2.6.4</ApplicationVersion>
|
<ApplicationVersion>7.2.7.7</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
@ -140,26 +140,26 @@
|
|||||||
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
|
<HintPath>packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.DependencyInjection.9.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.2\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.Logging, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.Logging.9.0.2\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.Logging.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.9.0.2\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.Options, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Options, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.Options.9.0.2\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.Options.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.2, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Extensions.Primitives.9.0.2\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
|
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
|
||||||
@ -193,8 +193,8 @@
|
|||||||
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\PdfSharp.WPFonts.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\PdfSharp.WPFonts.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Buffers.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
@ -202,27 +202,27 @@
|
|||||||
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.2\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Memory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Numerics" />
|
<Reference Include="System.Numerics" />
|
||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Numerics.Vectors.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<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.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.ValueTuple.dll</HintPath>
|
<HintPath>packages\PDFsharp-MigraDoc-GDI.6.1.1\lib\net472\System.ValueTuple.dll</HintPath>
|
||||||
@ -493,6 +493,42 @@
|
|||||||
<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>
|
||||||
@ -507,6 +543,7 @@
|
|||||||
<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" />
|
||||||
@ -802,6 +839,54 @@
|
|||||||
<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>
|
||||||
@ -852,6 +937,7 @@
|
|||||||
<None Include="ENI2_5_TemporaryKey.pfx" />
|
<None Include="ENI2_5_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_6_TemporaryKey.pfx" />
|
<None Include="ENI2_6_TemporaryKey.pfx" />
|
||||||
<None Include="ENI2_7_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>
|
||||||
@ -934,6 +1020,11 @@
|
|||||||
<Resource Include="Resources\document_plain_new.png" />
|
<Resource Include="Resources\document_plain_new.png" />
|
||||||
<Resource Include="Resources\exit.png" />
|
<Resource Include="Resources\exit.png" />
|
||||||
<Resource Include="Resources\document_exchange.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" />
|
||||||
<Resource Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
<Resource Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||||
<Content Include="x64\SQLite.Interop.dll">
|
<Content Include="x64\SQLite.Interop.dll">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
@ -961,7 +1052,6 @@
|
|||||||
</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>
|
||||||
|
|||||||
@ -3,9 +3,10 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Change password" Height="215" Width="400" Loaded="EditWindowBase_Loaded" Background="AliceBlue">
|
Title="Change password" Height="243" Width="400" Loaded="EditWindowBase_Loaded" Background="AliceBlue">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -13,6 +14,7 @@
|
|||||||
<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=".4*" />
|
<ColumnDefinition Width=".4*" />
|
||||||
@ -20,14 +22,16 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="Name" />
|
<Label Grid.Row="0" Grid.Column="0" Content="Name" />
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="Old password" />
|
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textOldPassword}" />
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="New password" />
|
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNewPassword}" />
|
||||||
<Label Grid.Row="3" Grid.Column="0" Content="Repeat new password" />
|
<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"/>
|
<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="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="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" />
|
<PasswordBox Grid.Row="3" Grid.Column="1" x:Name="textBoxNew2Password" Margin="2" VerticalContentAlignment="Center" />
|
||||||
<Button Grid.Row="4" Grid.Column="1" Content="Change" Name="buttonChangePassword" Margin="2" Width="80" HorizontalAlignment="Left" Click="buttonChangePassword_Click"/>
|
<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>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
using ENI2.Controls;
|
using ENI2.Controls;
|
||||||
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
@ -36,43 +37,48 @@ namespace ENI2.EditControls
|
|||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
string message = "";
|
string message = "";
|
||||||
if(!textBoxOldPassword.Password.IsNullOrEmpty())
|
if (!textBoxOldPassword.Password.IsNullOrEmpty() || !textBoxNew1Password.Password.IsNullOrEmpty() || !textBoxNew2Password.Password.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
if(CurrentUser.GetHash(textBoxOldPassword.Password).Equals(CurrentUser.PasswordHash))
|
if (!textBoxOldPassword.Password.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
if(textBoxNew1Password.Password.IsNullOrEmpty() ||
|
if (CurrentUser.GetHash(textBoxOldPassword.Password).Equals(CurrentUser.PasswordHash))
|
||||||
textBoxNew2Password.Password.IsNullOrEmpty() ||
|
|
||||||
!textBoxNew1Password.Password.Equals(textBoxNew2Password.Password))
|
|
||||||
{
|
{
|
||||||
message = "New passwords are empty or do not match";
|
if (textBoxNew1Password.Password.IsNullOrEmpty() ||
|
||||||
}
|
textBoxNew2Password.Password.IsNullOrEmpty() ||
|
||||||
else
|
!textBoxNew1Password.Password.Equals(textBoxNew2Password.Password))
|
||||||
{
|
|
||||||
if (textBoxOldPassword.Password.Equals(textBoxNew1Password.Password))
|
|
||||||
{
|
{
|
||||||
message = "Old and new password are the same";
|
message = "New passwords are empty or do not match";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CurrentUser.SetPassword(textBoxNew1Password.Password);
|
if (textBoxOldPassword.Password.Equals(textBoxNew1Password.Password))
|
||||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(CurrentUser);
|
{
|
||||||
success = true;
|
message = "Old and new password are the same";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurrentUser.SetPassword(textBoxNew1Password.Password);
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
message = "Old password is not correct";
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message = "Old password is not correct";
|
message = "Old password empty";
|
||||||
}
|
}
|
||||||
}
|
if (!success)
|
||||||
else
|
MessageBox.Show(message, "Changing password failed", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
{
|
else
|
||||||
message = "Old password empty";
|
MessageBox.Show("Password successfully changed.", "Password changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
if (!success)
|
// user may have changed combobox default display value so we are saving anyway here
|
||||||
MessageBox.Show(message, "Changing password failed", MessageBoxButton.OK, MessageBoxImage.Error);
|
this.CurrentUser.ShipcallDisplayMode = (ReportingParty.ShipcallDisplayModeEnum)Enum.Parse(typeof(ReportingParty.ShipcallDisplayModeEnum), (string)this.comboBoxDefaultDisplay.SelectedValue);
|
||||||
else
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(CurrentUser);
|
||||||
MessageBox.Show("Password successfully changed.", "Password changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
|
||||||
@ -82,6 +88,8 @@ namespace ENI2.EditControls
|
|||||||
this.OkVisible = false;
|
this.OkVisible = false;
|
||||||
var cancelButton = (Button)Template.FindName("buttonCancel", this);
|
var cancelButton = (Button)Template.FindName("buttonCancel", this);
|
||||||
cancelButton.Content = "Close";
|
cancelButton.Content = "Close";
|
||||||
|
this.comboBoxDefaultDisplay.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(ReportingParty.ShipcallDisplayModeEnum));
|
||||||
|
this.comboBoxDefaultDisplay.SelectedValue = this.CurrentUser.ShipcallDisplayMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -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="350" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
Title="{x:Static p:Resources.textReportingParty}" Height="378" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="28" />
|
<RowDefinition Height="28" />
|
||||||
@ -21,6 +21,7 @@
|
|||||||
<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*" />
|
||||||
@ -46,9 +47,10 @@
|
|||||||
<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="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="labelEditor" Grid.Row="8" Grid.Column="2" Content="{x:Static p:Resources.textEditor}" HorizontalContentAlignment="Right" />
|
<Label Name="labelEditor" Grid.Row="8" Grid.Column="2" Content="{x:Static p:Resources.textEditor}" 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,9 +69,8 @@
|
|||||||
<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="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="9" Grid.Column="1" Name="dateTimePickerCreated" FontStyle="Italic" />
|
<Label Grid.Row="10" Grid.Column="3" Name="dateTimePickerChanged" FontStyle="Italic" />
|
||||||
<Label Grid.Row="9" Grid.Column="3" Name="dateTimePickerChanged" FontStyle="Italic" />
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</enictrl:EditWindowBase>
|
</enictrl:EditWindowBase>
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// Description: Reporting party Bearbeitungsdialog
|
// Description: Reporting party Bearbeitungsdialog
|
||||||
//
|
//
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using bsmd.database;
|
using bsmd.database;
|
||||||
@ -24,6 +25,7 @@ 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;
|
||||||
@ -40,6 +42,7 @@ 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.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() : "";
|
||||||
@ -61,7 +64,7 @@ namespace ENI2.EditControls
|
|||||||
this.ReportingParty.PostalCode = this.textBoxPostalCode.Text.Trim();
|
this.ReportingParty.PostalCode = this.textBoxPostalCode.Text.Trim();
|
||||||
this.ReportingParty.StreetAndNumber = this.textBoxStreetNumber.Text.Trim();
|
this.ReportingParty.StreetAndNumber = this.textBoxStreetNumber.Text.Trim();
|
||||||
this.ReportingParty.UserEMail = this.textBoxUserEMail.Text.Trim();
|
this.ReportingParty.UserEMail = this.textBoxUserEMail.Text.Trim();
|
||||||
this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim();
|
this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim();
|
||||||
|
|
||||||
if(!this.passwordBoxPassword.Password.IsNullOrEmpty())
|
if(!this.passwordBoxPassword.Password.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -65,7 +65,7 @@ namespace ENI2.EditControls
|
|||||||
private void textBoxSearchDescription_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
private void textBoxSearchDescription_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
string searchText = this.textBoxSearchDescription.Text.Trim();
|
string searchText = this.textBoxSearchDescription.Text.Trim();
|
||||||
|
if (_portAreas == null) return;
|
||||||
lock (filterLock)
|
lock (filterLock)
|
||||||
{
|
{
|
||||||
IEnumerable<PortAreaInfo> filtered = _portAreas;
|
IEnumerable<PortAreaInfo> filtered = _portAreas;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ namespace ENI2
|
|||||||
|
|
||||||
#region Search related event handler
|
#region Search related event handler
|
||||||
|
|
||||||
private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore)
|
private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode = ReportingParty.ShipcallDisplayModeEnum.CLASSIC)
|
||||||
{
|
{
|
||||||
if(aMessageCore != null)
|
if(aMessageCore != null)
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ namespace ENI2
|
|||||||
iDidLockIt);
|
iDidLockIt);
|
||||||
searchResultItem.IsCancelled = aMessageCore.Cancelled ?? false;
|
searchResultItem.IsCancelled = aMessageCore.Cancelled ?? false;
|
||||||
|
|
||||||
DetailRootControl drc = new DetailRootControl(aMessageCore);
|
DetailRootControl drc = new DetailRootControl(aMessageCore, displayMode);
|
||||||
drc.LockedByOtherUser = !iDidLockIt;
|
drc.LockedByOtherUser = !iDidLockIt;
|
||||||
|
|
||||||
if (!(aMessageCore.Cancelled ?? false))
|
if (!(aMessageCore.Cancelled ?? false))
|
||||||
@ -135,7 +135,7 @@ namespace ENI2
|
|||||||
this._dbWatchDog.Register(aMessageCore);
|
this._dbWatchDog.Register(aMessageCore);
|
||||||
|
|
||||||
drc.HighlightReset += Drc_HighlightReset;
|
drc.HighlightReset += Drc_HighlightReset;
|
||||||
drc.OpenNewCoreRequested += (core) => this.AnmeldungenControl_MessageCoreSelected(core);
|
drc.OpenNewCoreRequested += (core) => this.AnmeldungenControl_MessageCoreSelected(core, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
drc.ReloadCoreRequested += Drc_ReloadCoreRequested;
|
drc.ReloadCoreRequested += Drc_ReloadCoreRequested;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ namespace ENI2
|
|||||||
if (((ShowIdDialog)sid).OpenCore)
|
if (((ShowIdDialog)sid).OpenCore)
|
||||||
{
|
{
|
||||||
Dispatcher.BeginInvoke((Action)(() => {
|
Dispatcher.BeginInvoke((Action)(() => {
|
||||||
this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
|
this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode); // in einem neuen Reiter öffnen
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ namespace ENI2
|
|||||||
|
|
||||||
// Meldeklassen für neuen Anlauf erzeugen:
|
// Meldeklassen für neuen Anlauf erzeugen:
|
||||||
bsmd.database.Util.CreateMessagesForCore(newCore, null, userEntity);
|
bsmd.database.Util.CreateMessagesForCore(newCore, null, userEntity);
|
||||||
this.AnmeldungenControl_MessageCoreSelected(newCore); // in einem neuen Reiter öffnen
|
this.AnmeldungenControl_MessageCoreSelected(newCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode); // in einem neuen Reiter öffnen
|
||||||
|
|
||||||
// watchdog registrieren, damit die "grüne" Markierung erscheint, sobald die Anmeldung durch den Excel-Prozess gelaufen ist.
|
// watchdog registrieren, damit die "grüne" Markierung erscheint, sobald die Anmeldung durch den Excel-Prozess gelaufen ist.
|
||||||
this._dbWatchDog.Register(newCore);
|
this._dbWatchDog.Register(newCore);
|
||||||
@ -612,7 +612,7 @@ namespace ENI2
|
|||||||
showIdDialog.Closed += (sid, showIdArgs) =>
|
showIdDialog.Closed += (sid, showIdArgs) =>
|
||||||
{
|
{
|
||||||
if (((ShowIdDialog)sid).OpenCore)
|
if (((ShowIdDialog)sid).OpenCore)
|
||||||
this.AnmeldungenControl_MessageCoreSelected(changedCore);
|
this.AnmeldungenControl_MessageCoreSelected(changedCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
};
|
};
|
||||||
showIdDialog.Show();
|
showIdDialog.Show();
|
||||||
showIdDialog.Activate();
|
showIdDialog.Activate();
|
||||||
|
|||||||
968
ENI2/Properties/Resources.Designer.cs
generated
968
ENI2/Properties/Resources.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -586,6 +586,18 @@
|
|||||||
<data name="user_edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="user_edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="user_edit4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="user_edit3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="user_edit2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="user_edit1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\user_edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
<data name="textSave" xml:space="preserve">
|
<data name="textSave" xml:space="preserve">
|
||||||
<value>Save</value>
|
<value>Save</value>
|
||||||
</data>
|
</data>
|
||||||
@ -1172,7 +1184,7 @@
|
|||||||
<value>Category</value>
|
<value>Category</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="textColumsOfIBC" xml:space="preserve">
|
<data name="textColumsOfIBC" xml:space="preserve">
|
||||||
<value>Columns "o" of OBC Code (value 15.19)</value>
|
<value>Columns "o" of IBC Code (value 15.19)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="textContainerNo" xml:space="preserve">
|
<data name="textContainerNo" xml:space="preserve">
|
||||||
<value>Container No.</value>
|
<value>Container No.</value>
|
||||||
@ -1912,4 +1924,313 @@
|
|||||||
<data name="textConfimDeleteAllEntries" xml:space="preserve">
|
<data name="textConfimDeleteAllEntries" xml:space="preserve">
|
||||||
<value>This will delete all entries. Are you sure?</value>
|
<value>This will delete all entries. Are you sure?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textVoyage" xml:space="preserve">
|
||||||
|
<value>1. Voyage</value>
|
||||||
|
</data>
|
||||||
|
<data name="text11PreviousPort" xml:space="preserve">
|
||||||
|
<value>1.1 Previous port</value>
|
||||||
|
</data>
|
||||||
|
<data name="text12IncomingVoyage" xml:space="preserve">
|
||||||
|
<value>1.2 Incoming voyage</value>
|
||||||
|
</data>
|
||||||
|
<data name="text13RelevantPortcall" xml:space="preserve">
|
||||||
|
<value>1.3 Relevant Portcall (port of call) / Kiel-Canal-Transit</value>
|
||||||
|
</data>
|
||||||
|
<data name="text14OutgoingVoyage" xml:space="preserve">
|
||||||
|
<value>1.4 Outgoing voyage</value>
|
||||||
|
</data>
|
||||||
|
<data name="text15NextPort" xml:space="preserve">
|
||||||
|
<value>1.5 Next port</value>
|
||||||
|
</data>
|
||||||
|
<data name="text16Voyage" xml:space="preserve">
|
||||||
|
<value>1.5 Voyage</value>
|
||||||
|
</data>
|
||||||
|
<data name="text17Last10PortFacilitiesCalled" xml:space="preserve">
|
||||||
|
<value>1.7 Last 10 port facilities called</value>
|
||||||
|
</data>
|
||||||
|
<data name="text18ShipToShip" xml:space="preserve">
|
||||||
|
<value>1.8 Ship to ship activities during last 10 port facilities called</value>
|
||||||
|
</data>
|
||||||
|
<data name="text19PortsCalled30days" xml:space="preserve">
|
||||||
|
<value>1.9 Ports called during the last 30 days</value>
|
||||||
|
</data>
|
||||||
|
<data name="text110MaritimeHealthData" xml:space="preserve">
|
||||||
|
<value>1.10 Maritime health data</value>
|
||||||
|
</data>
|
||||||
|
<data name="text111PortOfItinerary" xml:space="preserve">
|
||||||
|
<value>1.11 Port of itinerary</value>
|
||||||
|
</data>
|
||||||
|
<data name="textDefaultDisplay" xml:space="preserve">
|
||||||
|
<value>Default display</value>
|
||||||
|
</data>
|
||||||
|
<data name="textOpenClassic" xml:space="preserve">
|
||||||
|
<value>Open in classic display mode</value>
|
||||||
|
</data>
|
||||||
|
<data name="textOpenFormsheet" xml:space="preserve">
|
||||||
|
<value>Open in form sheet display mode</value>
|
||||||
|
</data>
|
||||||
|
<data name="text1Voyage" xml:space="preserve">
|
||||||
|
<value>1. Voyage</value>
|
||||||
|
</data>
|
||||||
|
<data name="text2PortCall" xml:space="preserve">
|
||||||
|
<value>2. Port call</value>
|
||||||
|
</data>
|
||||||
|
<data name="text21ReferenceNumbers" xml:space="preserve">
|
||||||
|
<value>2.1 Reference numbers</value>
|
||||||
|
</data>
|
||||||
|
<data name="text22PortOperations" xml:space="preserve">
|
||||||
|
<value>2.2 Port operations</value>
|
||||||
|
</data>
|
||||||
|
<data name="text23Agency" xml:space="preserve">
|
||||||
|
<value>2.3 Agency</value>
|
||||||
|
</data>
|
||||||
|
<data name="text24Invoice" xml:space="preserve">
|
||||||
|
<value>2.4 Invoice (concerning mooring fees, disposal costs etc.)</value>
|
||||||
|
</data>
|
||||||
|
<data name="text25CargeOnBoard" xml:space="preserve">
|
||||||
|
<value>2.5 Cargo on board related to incoming journey</value>
|
||||||
|
</data>
|
||||||
|
<data name="text26CargoPort" xml:space="preserve">
|
||||||
|
<value>2.6 Cargo handled in port of call (cargo to discharge / load / transiting)</value>
|
||||||
|
</data>
|
||||||
|
<data name="text27Waste" xml:space="preserve">
|
||||||
|
<value>2.7 Waste (MARPOL) data</value>
|
||||||
|
</data>
|
||||||
|
<data name="text28Store" xml:space="preserve">
|
||||||
|
<value>2.8 Store information</value>
|
||||||
|
</data>
|
||||||
|
<data name="text29CrewEffects" xml:space="preserve">
|
||||||
|
<value>2.9 IMO crew effects declaration (IMO FAL form 4)</value>
|
||||||
|
</data>
|
||||||
|
<data name="textStore" xml:space="preserve">
|
||||||
|
<value>Store</value>
|
||||||
|
</data>
|
||||||
|
<data name="textQuantityUnit" xml:space="preserve">
|
||||||
|
<value>Quantity unit</value>
|
||||||
|
</data>
|
||||||
|
<data name="textLocationOnBoard" xml:space="preserve">
|
||||||
|
<value>Location on board</value>
|
||||||
|
</data>
|
||||||
|
<data name="textOfficialUse" xml:space="preserve">
|
||||||
|
<value>Official use</value>
|
||||||
|
</data>
|
||||||
|
<data name="text3PreArrival" xml:space="preserve">
|
||||||
|
<value>3. Pre-arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text31General" xml:space="preserve">
|
||||||
|
<value>3.1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="text32PersonsOnBoard" xml:space="preserve">
|
||||||
|
<value>3.2 Persons on board on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text33BunkerOnArrival" xml:space="preserve">
|
||||||
|
<value>3.3 Bunker on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text34DangerousCargo" xml:space="preserve">
|
||||||
|
<value>3.4 Dangerous cargo on board on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text36TowOnArrival" xml:space="preserve">
|
||||||
|
<value>3.5 Tow (barge, pontoon, etc.) on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="textAreMatterToReport" xml:space="preserve">
|
||||||
|
<value>Are any security-related matters to report?</value>
|
||||||
|
</data>
|
||||||
|
<data name="textMatterToReport" xml:space="preserve">
|
||||||
|
<value>if yes, description of matters to report</value>
|
||||||
|
</data>
|
||||||
|
<data name="text4PreDeparture" xml:space="preserve">
|
||||||
|
<value>4. Pre-departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text42PersonsOnBoard" xml:space="preserve">
|
||||||
|
<value>4.2 Persons on board on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text43BunkerOnDeparture" xml:space="preserve">
|
||||||
|
<value>4.3 Bunker on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text44DangerousCargo" xml:space="preserve">
|
||||||
|
<value>4.4 Dangerous cargo on board on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text45TowOnDeparture" xml:space="preserve">
|
||||||
|
<value>4.5 Tow (barge, pontoon etc.) on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text41General" xml:space="preserve">
|
||||||
|
<value>4.1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="text5ShipData" xml:space="preserve">
|
||||||
|
<value>5. Ship data</value>
|
||||||
|
</data>
|
||||||
|
<data name="text51General" xml:space="preserve">
|
||||||
|
<value>5.1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="text52SSCEC" xml:space="preserve">
|
||||||
|
<value>5.2 SSCEC</value>
|
||||||
|
</data>
|
||||||
|
<data name="text53ISPS" xml:space="preserve">
|
||||||
|
<value>5.3 ISPS</value>
|
||||||
|
</data>
|
||||||
|
<data name="text54TankerDetails" xml:space="preserve">
|
||||||
|
<value>5.4 Tanker details</value>
|
||||||
|
</data>
|
||||||
|
<data name="textNetTonnage" xml:space="preserve">
|
||||||
|
<value>Net tonnage</value>
|
||||||
|
</data>
|
||||||
|
<data name="textRegistryDate" xml:space="preserve">
|
||||||
|
<value>Registry date</value>
|
||||||
|
</data>
|
||||||
|
<data name="textCertificateOfRegistryNumber" xml:space="preserve">
|
||||||
|
<value>Certificate of registry number</value>
|
||||||
|
</data>
|
||||||
|
<data name="textIsDueToInspection" xml:space="preserve">
|
||||||
|
<value>Is due to inspection?</value>
|
||||||
|
</data>
|
||||||
|
<data name="textPossibleAnchorage" xml:space="preserve">
|
||||||
|
<value>Possible anchorage?</value>
|
||||||
|
</data>
|
||||||
|
<data name="textShipEmail" xml:space="preserve">
|
||||||
|
<value>Ship e-mail</value>
|
||||||
|
</data>
|
||||||
|
<data name="text6CrewDataOnArrival" xml:space="preserve">
|
||||||
|
<value>6. Crew data on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text7CrewDeparture" xml:space="preserve">
|
||||||
|
<value>7. Crew data on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text8PassengerArrival" xml:space="preserve">
|
||||||
|
<value>8. Passenger data on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text9PassengerDeparture" xml:space="preserve">
|
||||||
|
<value>9. Passenger data on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text10DangerousCargoArrival" xml:space="preserve">
|
||||||
|
<value>10. Dangerous cargo data on arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text11DangerousCargoDeparture" xml:space="preserve">
|
||||||
|
<value>11. Dangerous cargo data on departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text12ATAATD" xml:space="preserve">
|
||||||
|
<value>12. Actual time of arrival / departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text13WasteReceipts" xml:space="preserve">
|
||||||
|
<value>13. Waste receipts</value>
|
||||||
|
</data>
|
||||||
|
<data name="textDGContactFamilyName" xml:space="preserve">
|
||||||
|
<value>DG manifest contact - family name</value>
|
||||||
|
</data>
|
||||||
|
<data name="textDGContactPhone" xml:space="preserve">
|
||||||
|
<value>DG manifest contact - phone</value>
|
||||||
|
</data>
|
||||||
|
<data name="text102IBCData" xml:space="preserve">
|
||||||
|
<value>10.2 IBC data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text10.3IGCData" xml:space="preserve">
|
||||||
|
<value>10.3 IGC data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text104IMSBCData" xml:space="preserve">
|
||||||
|
<value>10.4 IMSBC data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text103IGCData" xml:space="preserve">
|
||||||
|
<value>10.3 IGC data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text105MARPOLData" xml:space="preserve">
|
||||||
|
<value>10.5 MARPOL I data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text106IMDGData" xml:space="preserve">
|
||||||
|
<value>10.6 IMDG data (on arrival), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text101General" xml:space="preserve">
|
||||||
|
<value>10.1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="text111General" xml:space="preserve">
|
||||||
|
<value>11.1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="text112IBCData" xml:space="preserve">
|
||||||
|
<value>11.2 IBC data (on departure), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text113IGCData" xml:space="preserve">
|
||||||
|
<value>11.3 IGC data (on departure), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text114IMSBCData" xml:space="preserve">
|
||||||
|
<value>11.4 IMSBC data (on departure), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text115MARPOLData" xml:space="preserve">
|
||||||
|
<value>11.5 MARPOL I data (on departure), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text116IMDGData" xml:space="preserve">
|
||||||
|
<value>11.6 IMDG data (on departure), if applicable</value>
|
||||||
|
</data>
|
||||||
|
<data name="text121ATA" xml:space="preserve">
|
||||||
|
<value>12.1 Actual time of arrival</value>
|
||||||
|
</data>
|
||||||
|
<data name="text122ATD" xml:space="preserve">
|
||||||
|
<value>12.2 Actual time of departure</value>
|
||||||
|
</data>
|
||||||
|
<data name="text131WasteReceipt" xml:space="preserve">
|
||||||
|
<value>13.1 Waste receipt</value>
|
||||||
|
</data>
|
||||||
|
<data name="clock" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\clock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="text102" xml:space="preserve">
|
||||||
|
<value>2 IBC</value>
|
||||||
|
</data>
|
||||||
|
<data name="text103" xml:space="preserve">
|
||||||
|
<value>3 IGC</value>
|
||||||
|
</data>
|
||||||
|
<data name="text104" xml:space="preserve">
|
||||||
|
<value>4 IMSBC</value>
|
||||||
|
</data>
|
||||||
|
<data name="text105" xml:space="preserve">
|
||||||
|
<value>5 MARPOL I</value>
|
||||||
|
</data>
|
||||||
|
<data name="text106" xml:space="preserve">
|
||||||
|
<value>6 IMDG</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab11" xml:space="preserve">
|
||||||
|
<value>1-6 Actual</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab12" xml:space="preserve">
|
||||||
|
<value>7-9 Tables</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab13" xml:space="preserve">
|
||||||
|
<value>10 MDH</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab14" xml:space="preserve">
|
||||||
|
<value>11 Cruise</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab21" xml:space="preserve">
|
||||||
|
<value>1-2 Berth</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab22" xml:space="preserve">
|
||||||
|
<value>3-4 Contact</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab23" xml:space="preserve">
|
||||||
|
<value>5-6 Cargo</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab24" xml:space="preserve">
|
||||||
|
<value>7 Waste</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab51" xml:space="preserve">
|
||||||
|
<value>1 General</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab52" xml:space="preserve">
|
||||||
|
<value>2-3 MDH / SEC</value>
|
||||||
|
</data>
|
||||||
|
<data name="textTab53" xml:space="preserve">
|
||||||
|
<value>4 Tanker</value>
|
||||||
|
</data>
|
||||||
|
<data name="textNewPassword" xml:space="preserve">
|
||||||
|
<value>New password</value>
|
||||||
|
</data>
|
||||||
|
<data name="textOldPassword" xml:space="preserve">
|
||||||
|
<value>Old password</value>
|
||||||
|
</data>
|
||||||
|
<data name="textRepeatNewPassword" xml:space="preserve">
|
||||||
|
<value>Repeat new password</value>
|
||||||
|
</data>
|
||||||
|
<data name="textMDHSimplification" xml:space="preserve">
|
||||||
|
<value>MDH simplification available</value>
|
||||||
|
</data>
|
||||||
|
<data name="textSECSimplification" xml:space="preserve">
|
||||||
|
<value>SEC simplification available</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
BIN
ENI2/Resources/arrival_user.png
Normal file
BIN
ENI2/Resources/arrival_user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
BIN
ENI2/Resources/arrival_worker.png
Normal file
BIN
ENI2/Resources/arrival_worker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
ENI2/Resources/clock.png
Normal file
BIN
ENI2/Resources/clock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
ENI2/Resources/departure_user.png
Normal file
BIN
ENI2/Resources/departure_user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
ENI2/Resources/departure_worker.png
Normal file
BIN
ENI2/Resources/departure_worker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
46
ENI2/SheetDisplayControls/ATAControl.xaml
Normal file
46
ENI2/SheetDisplayControls/ATAControl.xaml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.ATAControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="600" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.text12ATAATD}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text121ATA}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<Label Content="ATA" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp" ValueChanged="dateTimePickerATA_ValueChanged" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text122ATD}" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<Label Content="ATD" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" 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" PreviewKeyUp="DateTimePicker_PreviewKeyUp" ValueChanged="dateTimePickerATD_ValueChanged"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
113
ENI2/SheetDisplayControls/ATAControl.xaml.cs
Normal file
113
ENI2/SheetDisplayControls/ATAControl.xaml.cs
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
// Copyright (c) 2025- schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 12. ATA ATD
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for ATAControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class ATAControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
ATA _ata;
|
||||||
|
ATD _atd;
|
||||||
|
bool startupComplete = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
public ATAControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += ATAControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public overrides
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
|
||||||
|
{
|
||||||
|
this.ControlMessages.Add(aMessage);
|
||||||
|
if (aMessage.Elements.Count > 0)
|
||||||
|
_ata = aMessage.Elements[0] as ATA;
|
||||||
|
if (_ata == null)
|
||||||
|
{
|
||||||
|
_ata = new ATA();
|
||||||
|
_ata.MessageCore = this.Core;
|
||||||
|
_ata.MessageHeader = aMessage;
|
||||||
|
aMessage.Elements.Add(_ata);
|
||||||
|
}
|
||||||
|
this.dateTimePickerATA.DataContext = _ata;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATD)
|
||||||
|
{
|
||||||
|
this.ControlMessages.Add(aMessage);
|
||||||
|
if (aMessage.Elements.Count > 0)
|
||||||
|
_atd = aMessage.Elements[0] as ATD;
|
||||||
|
if (_atd == null)
|
||||||
|
{
|
||||||
|
_atd = new ATD();
|
||||||
|
_atd.MessageCore = this.Core;
|
||||||
|
_atd.MessageHeader = aMessage;
|
||||||
|
aMessage.Elements.Add(_atd);
|
||||||
|
}
|
||||||
|
this.dateTimePickerATD.DataContext = _atd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.portCallGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
private void ATAControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA);
|
||||||
|
this.RegisterDateTimePickerChange(this.dateTimePickerATD, Message.NotificationClass.ATD);
|
||||||
|
startupComplete = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dateTimePickerATD_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
{
|
||||||
|
if (startupComplete && this.dateTimePickerATD.Value.HasValue)
|
||||||
|
{
|
||||||
|
DateTime setTime = this.dateTimePickerATD.Value.Value;
|
||||||
|
if ((setTime > DateTime.Now.AddDays(14)) || (setTime < DateTime.Now.AddDays(-14)))
|
||||||
|
MessageBox.Show("ATD value may be invalid", "Date implausible", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dateTimePickerATA_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
|
{
|
||||||
|
if (startupComplete && this.dateTimePickerATA.Value.HasValue)
|
||||||
|
{
|
||||||
|
DateTime setTime = this.dateTimePickerATA.Value.Value;
|
||||||
|
if ((setTime > DateTime.Now.AddDays(14)) || (setTime < DateTime.Now.AddDays(-14)))
|
||||||
|
MessageBox.Show("ATA value may be invalid", "Date implausible", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
64
ENI2/SheetDisplayControls/CrewDepartureControl.xaml
Normal file
64
ENI2/SheetDisplayControls/CrewDepartureControl.xaml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.CrewDepartureControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1450" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="crewDepartureGroupBox" Header="{x:Static p:Resources.text7CrewDeparture}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="640" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||||
|
<CheckBox Name="checkBoxCrewNotificationSchengenDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengenDeparture_Click" Grid.Row="0" Grid.Column="1"/>
|
||||||
|
<Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||||
|
<CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click" Grid.Row="1" Grid.Column="1" />
|
||||||
|
|
||||||
|
<Button Grid.Row="3" Grid.Column="0" Name="buttonImportExcelCrewDeparture" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrewDeparture_Click" />
|
||||||
|
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
||||||
|
<Label Name="labelCrewEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
<Button Name="buttonDeleteAllCrewD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewD_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridCrewListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" 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.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.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.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding CrewMemberIdentityDocumentIssuingState, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding CrewMemberIdentityDocumentExpiryDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
381
ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs
Normal file
381
ENI2/SheetDisplayControls/CrewDepartureControl.xaml.cs
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 7. Crew data departure
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for CrewDepartureControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class CrewDepartureControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private Message _crewaMessage;
|
||||||
|
private Message _crewdMessage;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public CrewDepartureControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public overrides
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) { this._crewdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region init CREWD
|
||||||
|
|
||||||
|
if (this._crewdMessage == null)
|
||||||
|
{
|
||||||
|
this._crewdMessage = this.Core.CreateMessage(Message.NotificationClass.CREWD);
|
||||||
|
this.Messages.Add(this._crewdMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataGridCrewListDeparture.Initialize();
|
||||||
|
this.dataGridCrewListDeparture.ItemsSource = this._crewdMessage.Elements;
|
||||||
|
this.dataGridCrewListDeparture.AddingNewItem += DataGridCrewListDeparture_AddingNewItem;
|
||||||
|
this.dataGridCrewListDeparture.EditRequested += DataGridCrewListDeparture_EditRequested;
|
||||||
|
this.dataGridCrewListDeparture.DeleteRequested += DataGridCrewListDeparture_DeleteRequested;
|
||||||
|
this.dataGridCrewListDeparture.CreateRequested += DataGridCrewListDeparture_CreateRequested;
|
||||||
|
this.dataGridCrewListDeparture.RefreshGrid += DataGridCrewListDeparture_RefreshGrid;
|
||||||
|
this.dataGridCrewListDeparture.MultiEditRequested += DataGridCrewListDeparture_MultiEditRequested;
|
||||||
|
|
||||||
|
if (this._crewdMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
this.checkBoxCrewNotificationSchengenDeparture.IsChecked = ((CREWD)this._crewdMessage.Elements[0]).NotificationSchengen;
|
||||||
|
this.checkBoxCrewNotificationPAXDeparture.IsChecked = ((CREWD)this._crewdMessage.Elements[0]).NotificationPAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textBlockNumCrewEntriesDeparture.DataContext = this._crewdMessage;
|
||||||
|
|
||||||
|
// extra menu copy to CREWA
|
||||||
|
{
|
||||||
|
this.dataGridCrewListDeparture.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyCREWDItem = new MenuItem();
|
||||||
|
copyCREWDItem.Header = Properties.Resources.textCopyToCREWA;
|
||||||
|
copyCREWDItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyCREWDItem.Click += CopyCREWDItem_Click; ;
|
||||||
|
this.dataGridCrewListDeparture.ContextMenu.Items.Add(copyCREWDItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.crewDepartureGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void checkBoxCrewNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (CREWD crewd in _crewdMessage.Elements.Cast<CREWD>())
|
||||||
|
{
|
||||||
|
crewd.NotificationSchengen = checkBoxCrewNotificationSchengenDeparture.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxCrewNotificationPAXDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (CREWD crewd in _crewdMessage.Elements.Cast<CREWD>())
|
||||||
|
{
|
||||||
|
crewd.NotificationSchengen = checkBoxCrewNotificationSchengenDeparture.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonImportExcelCrewDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (IExcelDataReader reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<CREWD> importCrew = new List<CREWD>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (reader.FieldCount < 13)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 13 columns of data");
|
||||||
|
}
|
||||||
|
CREWD crew = new CREWD();
|
||||||
|
crew.IsDeparture = true;
|
||||||
|
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
|
||||||
|
if (crew.CrewMemberLastName.Equals("Family Name") || (crew.CrewMemberLastName.Trim().Length == 0)) continue;
|
||||||
|
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||||
|
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||||
|
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3).Clean();
|
||||||
|
if (!reader.IsDBNull(4)) crew.CrewMemberNationality = reader.GetString(4).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||||
|
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||||
|
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||||
|
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = reader.ReadAsString(9);
|
||||||
|
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||||
|
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = reader.ReadAsString(12);
|
||||||
|
|
||||||
|
crew.MessageHeader = this._crewdMessage;
|
||||||
|
crew.IsDirty = true;
|
||||||
|
crew.Identifier = CREWD.GetNewIdentifier(this._crewdMessage.Elements);
|
||||||
|
this._crewdMessage.Elements.Add(crew);
|
||||||
|
importCrew.Add(crew);
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importCrew.Count > 0)
|
||||||
|
{
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
MessageBox.Show(String.Format(Properties.Resources.textCrewImported, importCrew.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void buttonDeleteAllCrewD_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (CREWD crewd in this._crewdMessage.Elements.Cast<CREWD>())
|
||||||
|
{
|
||||||
|
await DBManagerAsync.DeleteAsync(crewd);
|
||||||
|
}
|
||||||
|
this._crewdMessage.Elements.Clear();
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyCREWDItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridCrewListDeparture.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (CREWD crewd in this.dataGridCrewListDeparture.SelectedItems)
|
||||||
|
{
|
||||||
|
CREW crewa = new CREW();
|
||||||
|
crewa.MessageHeader = this._crewaMessage;
|
||||||
|
crewa.CopyFromCREW(crewd);
|
||||||
|
crewa.IsDeparture = false;
|
||||||
|
crewa.Identifier = DatabaseEntity.GetNewIdentifier(this._crewaMessage.Elements);
|
||||||
|
this._crewaMessage.Elements.Add(crewa);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region crew grid departure
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_CreateRequested()
|
||||||
|
{
|
||||||
|
EditCREWDialog ecd = new EditCREWDialog
|
||||||
|
{
|
||||||
|
CREW = new CREWD()
|
||||||
|
};
|
||||||
|
ecd.CREW.IsDeparture = true;
|
||||||
|
ecd.CREW.Identifier = CREWD.GetNewIdentifier(_crewdMessage.Elements);
|
||||||
|
ecd.CREW.MessageHeader = this._crewdMessage;
|
||||||
|
|
||||||
|
ecd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ecd.CopyValuesToEntity();
|
||||||
|
if (!this._crewdMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
this._crewdMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWD();
|
||||||
|
}
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
ecd.CREW = new CREWD
|
||||||
|
{
|
||||||
|
IsDeparture = true,
|
||||||
|
MessageHeader = this._crewdMessage,
|
||||||
|
Identifier = CREWD.GetNewIdentifier(_crewdMessage.Elements)
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ecd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._crewdMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewdMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWD();
|
||||||
|
}
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is CREWD crewd)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_crewdMessage.Elements.Remove(crewd);
|
||||||
|
DBManager.Instance.Delete(crewd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_RefreshGrid()
|
||||||
|
{
|
||||||
|
DatabaseEntity.ResetIdentifiers(_crewdMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditCREWDialog ecd = new EditCREWDialog
|
||||||
|
{
|
||||||
|
CREW = obj as CREWD
|
||||||
|
};
|
||||||
|
|
||||||
|
ecd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ecd.CopyValuesToEntity();
|
||||||
|
if (!_crewdMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewdMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWD();
|
||||||
|
}
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
ecd.CREW = new CREWD
|
||||||
|
{
|
||||||
|
IsDeparture = true,
|
||||||
|
Identifier = CREWD.GetNewIdentifier(_crewdMessage.Elements),
|
||||||
|
MessageHeader = _crewdMessage
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ecd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_crewdMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewdMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWD();
|
||||||
|
}
|
||||||
|
ecd.CREW.IsDirty = true;
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridCrewListDeparture_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewListDeparture_MultiEditRequested(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
List<CREW> crewList = new List<CREW>();
|
||||||
|
foreach (CREW acrew in databaseEntities.Cast<CREW>())
|
||||||
|
crewList.Add(acrew);
|
||||||
|
|
||||||
|
// write common values of all CREW entities to template entity
|
||||||
|
CREW crew = CREW.CreateCommon(crewList);
|
||||||
|
|
||||||
|
EditCREWDialog dialog = new EditCREWDialog();
|
||||||
|
dialog.CREW = crew;
|
||||||
|
dialog.AddVisible = false;
|
||||||
|
if (dialog.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
// write back changed values from crew to all entities and mark them as changed
|
||||||
|
CREW.WriteTemplateToList(crew, crewList);
|
||||||
|
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
this.dataGridCrewListDeparture.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private methods
|
||||||
|
|
||||||
|
private void CheckCREWD()
|
||||||
|
{
|
||||||
|
if (this._crewdMessage.Elements.Count == 0) return;
|
||||||
|
CREWD firstCREW = this._crewdMessage.Elements[0] as CREWD;
|
||||||
|
if (this._crewdMessage.Elements.Count == 1)
|
||||||
|
{
|
||||||
|
firstCREW.NotificationSchengen = true;
|
||||||
|
this.checkBoxCrewNotificationSchengenDeparture.IsChecked = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 1; i < this._crewdMessage.Elements.Count; i++)
|
||||||
|
{
|
||||||
|
((CREWD)this._crewdMessage.Elements[i]).NotificationSchengen = firstCREW.NotificationSchengen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
67
ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml
Normal file
67
ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.CrewPreArrivalControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1450" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="crewPreArrivalGroupBox" Header="{x:Static p:Resources.text6CrewDataOnArrival}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="640" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||||
|
<CheckBox Name="checkBoxCrewNotificationSchengen" Grid.Row="1" Grid.Column="1" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
|
||||||
|
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" />
|
||||||
|
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click" Grid.Row="2" Grid.Column="1"/>
|
||||||
|
|
||||||
|
<Button Name="buttonImportExcelCrew" Grid.Row="4" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2,2,10,2" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
|
||||||
|
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<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}" />
|
||||||
|
<Button Name="buttonDeleteAllCrewA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewA_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" 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.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.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.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding CrewMemberIdentityDocumentIssuingState, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding CrewMemberIdentityDocumentExpiryDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<!--<DataGridTextColumn Header="{x:Static p:Resources.textEffects}" Binding="{Binding Effects, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />-->
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
385
ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs
Normal file
385
ENI2/SheetDisplayControls/CrewPreArrivalControl.xaml.cs
Normal file
@ -0,0 +1,385 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 6. Crew data arrival
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for CrewPreArrivalControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class CrewPreArrivalControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private NAME _name;
|
||||||
|
private Message _crewaMessage;
|
||||||
|
private Message _crewdMessage;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public CrewPreArrivalControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.Loaded += CrewPreArrivalControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.NAME) { this._name = aMessage.Elements[0] as NAME; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) { this._crewdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textBox_NameMaster.DataContext = _name;
|
||||||
|
this.textBlockNumCrewEntries.DataContext = _crewaMessage;
|
||||||
|
|
||||||
|
#region init CREWA
|
||||||
|
|
||||||
|
if (this._crewaMessage == null)
|
||||||
|
{
|
||||||
|
this._crewaMessage = this.Core.CreateMessage(Message.NotificationClass.CREWA);
|
||||||
|
this.Messages.Add(this._crewaMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataGridCrewList.Initialize();
|
||||||
|
this.dataGridCrewList.ItemsSource = this._crewaMessage.Elements;
|
||||||
|
this.dataGridCrewList.AddingNewItem += DataGridCrewList_AddingNewItem;
|
||||||
|
this.dataGridCrewList.EditRequested += DataGridCrewList_EditRequested;
|
||||||
|
this.dataGridCrewList.DeleteRequested += DataGridCrewList_DeleteRequested;
|
||||||
|
this.dataGridCrewList.CreateRequested += DataGridCrewList_CreateRequested;
|
||||||
|
this.dataGridCrewList.RefreshGrid += DataGridCrewList_RefreshGrid;
|
||||||
|
this.dataGridCrewList.MultiEditRequested += DataGridCrewList_MultiEditRequested;
|
||||||
|
|
||||||
|
if (this._crewaMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
this.checkBoxCrewNotificationSchengen.IsChecked = ((CREW)this._crewaMessage.Elements[0]).NotificationSchengen;
|
||||||
|
this.checkBoxCrewNotificationPAX.IsChecked = ((CREW)this._crewaMessage.Elements[0]).NotificationPAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
// extra menu copy to CREWD
|
||||||
|
{
|
||||||
|
this.dataGridCrewList.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyCREWAItem = new MenuItem();
|
||||||
|
copyCREWAItem.Header = Properties.Resources.textCopyToCREWD;
|
||||||
|
copyCREWAItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyCREWAItem.Click += CopyCREWAItem_Click;
|
||||||
|
this.dataGridCrewList.ContextMenu.Items.Add(copyCREWAItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.crewPreArrivalGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void CopyCREWAItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridCrewList.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (CREW crewa in this.dataGridCrewList.SelectedItems)
|
||||||
|
{
|
||||||
|
CREWD crewd = new CREWD();
|
||||||
|
crewd.MessageHeader = this._crewdMessage;
|
||||||
|
crewd.CopyFromCREW(crewa);
|
||||||
|
crewd.IsDeparture = true;
|
||||||
|
crewd.Identifier = DatabaseEntity.GetNewIdentifier(this._crewdMessage.Elements);
|
||||||
|
this._crewdMessage.Elements.Add(crewd);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CrewPreArrivalControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.RegisterTextboxChange(this.textBox_NameMaster, Message.NotificationClass.NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void buttonDeleteAllCrewA_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (CREW crewa in this._crewaMessage.Elements.Cast<CREW>())
|
||||||
|
{
|
||||||
|
await DBManagerAsync.DeleteAsync(crewa);
|
||||||
|
}
|
||||||
|
this._crewaMessage.Elements.Clear();
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxCrewNotificationSchengen_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (CREW crew in _crewaMessage.Elements.Cast<CREW>())
|
||||||
|
{
|
||||||
|
crew.NotificationSchengen = checkBoxCrewNotificationSchengen.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxCrewNotificationPAX_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (CREW crew in _crewaMessage.Elements.Cast<CREW>())
|
||||||
|
{
|
||||||
|
crew.NotificationPAX = checkBoxCrewNotificationPAX.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (IExcelDataReader reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<CREW> importCrew = new List<CREW>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (reader.FieldCount < 13)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 13 columns of data");
|
||||||
|
}
|
||||||
|
CREW crew = new CREW();
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0).Clean();
|
||||||
|
if (crew.CrewMemberLastName.Equals("Family Name") || (crew.CrewMemberLastName.Trim().Length == 0)) continue;
|
||||||
|
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1).Clean();
|
||||||
|
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||||
|
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3).Clean();
|
||||||
|
if (!reader.IsDBNull(4)) crew.CrewMemberNationality = reader.GetString(4).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5).Clean();
|
||||||
|
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||||
|
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||||
|
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = reader.ReadAsString(9).Clean();
|
||||||
|
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||||
|
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = reader.ReadAsString(12).Clean();
|
||||||
|
|
||||||
|
crew.MessageHeader = this._crewaMessage;
|
||||||
|
crew.IsDirty = true;
|
||||||
|
crew.Identifier = CREW.GetNewIdentifier(this._crewaMessage.Elements);
|
||||||
|
this._crewaMessage.Elements.Add(crew);
|
||||||
|
importCrew.Add(crew);
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importCrew.Count > 0)
|
||||||
|
{
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
MessageBox.Show(String.Format(Properties.Resources.textCrewImported, importCrew.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region crew grid arrival
|
||||||
|
|
||||||
|
private void DataGridCrewList_CreateRequested()
|
||||||
|
{
|
||||||
|
EditCREWDialog ecd = new EditCREWDialog
|
||||||
|
{
|
||||||
|
CREW = new CREW()
|
||||||
|
};
|
||||||
|
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewaMessage.Elements);
|
||||||
|
ecd.CREW.MessageHeader = this._crewaMessage;
|
||||||
|
|
||||||
|
ecd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ecd.CopyValuesToEntity();
|
||||||
|
if (!this._crewaMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
this._crewaMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWA();
|
||||||
|
}
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
ecd.CREW = new CREW
|
||||||
|
{
|
||||||
|
MessageHeader = this._crewaMessage,
|
||||||
|
Identifier = CREW.GetNewIdentifier(_crewaMessage.Elements)
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ecd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._crewaMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewaMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWA();
|
||||||
|
}
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewList_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is CREW crew)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_crewaMessage.Elements.Remove(crew);
|
||||||
|
DBManager.Instance.Delete(crew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewList_RefreshGrid()
|
||||||
|
{
|
||||||
|
DatabaseEntity.ResetIdentifiers(_crewaMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewList_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditCREWDialog ecd = new EditCREWDialog
|
||||||
|
{
|
||||||
|
CREW = obj as CREW
|
||||||
|
};
|
||||||
|
|
||||||
|
ecd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ecd.CopyValuesToEntity();
|
||||||
|
if (!_crewaMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewaMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWA();
|
||||||
|
}
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
ecd.CREW = new CREW
|
||||||
|
{
|
||||||
|
Identifier = CREW.GetNewIdentifier(_crewaMessage.Elements),
|
||||||
|
MessageHeader = _crewaMessage
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ecd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_crewaMessage.Elements.Contains(ecd.CREW))
|
||||||
|
{
|
||||||
|
_crewaMessage.Elements.Add(ecd.CREW);
|
||||||
|
this.CheckCREWA();
|
||||||
|
}
|
||||||
|
ecd.CREW.IsDirty = true;
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewList_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridCrewList_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridCrewList_MultiEditRequested(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
List<CREW> crewList = new List<CREW>();
|
||||||
|
foreach (CREW acrew in databaseEntities.Cast<CREW>())
|
||||||
|
crewList.Add(acrew);
|
||||||
|
|
||||||
|
// write common values of all CREW entities to template entity
|
||||||
|
CREW crew = CREW.CreateCommon(crewList);
|
||||||
|
|
||||||
|
EditCREWDialog dialog = new EditCREWDialog();
|
||||||
|
dialog.CREW = crew;
|
||||||
|
dialog.AddVisible = false;
|
||||||
|
if (dialog.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
// write back changed values from crew to all entities and mark them as changed
|
||||||
|
CREW.WriteTemplateToList(crew, crewList);
|
||||||
|
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||||
|
this.dataGridCrewList.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private methods
|
||||||
|
|
||||||
|
private void CheckCREWA()
|
||||||
|
{
|
||||||
|
if (this._crewaMessage.Elements.Count == 0) return;
|
||||||
|
CREW firstCREW = this._crewaMessage.Elements[0] as CREW;
|
||||||
|
if (this._crewaMessage.Elements.Count == 1)
|
||||||
|
{
|
||||||
|
firstCREW.NotificationSchengen = true;
|
||||||
|
this.checkBoxCrewNotificationSchengen.IsChecked = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 1; i < this._crewaMessage.Elements.Count; i++)
|
||||||
|
{
|
||||||
|
((CREW)this._crewaMessage.Elements[i]).NotificationSchengen = firstCREW.NotificationSchengen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
209
ENI2/SheetDisplayControls/DangerousCargoControl.xaml
Normal file
209
ENI2/SheetDisplayControls/DangerousCargoControl.xaml
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.DangerousCargoControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1550" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="dangerousCargoGroupBox" Header="{x:Static p:Resources.text10DangerousCargoArrival}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="290"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock x:Name="textBlock101" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text101General}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<Label Content="{x:Static p:Resources.textDGManifestOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textDGContactFamilyName}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textDGContactPhone}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textMoUBalticRoRo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textVesselClass}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
|
||||||
|
<CheckBox Name="checkBoxDGManifestOnBoard" IsChecked="{Binding DPGManifestOnBoardOnArrival}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
|
||||||
|
<TextBox Grid.Row="2" Grid.Column="1" Name="textBoxDGManifestContactFamilyName" MaxLength="99" Margin="2" Text="{Binding DPGContactFamilyName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1" Name="textBoxDGManifestContactPhone" MaxLength="99" Margin="2" Text="{Binding DPGContactPhone, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||||
|
<CheckBox Name="checkBoxMoUBaltic" IsChecked="{Binding MOUBaltic}" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2"/>
|
||||||
|
<ComboBox x:Name="comboBoxVesselClass" Grid.Row="5" Grid.Column="1" Margin="2" SelectedIndex="{Binding INFShipClass, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
|
||||||
|
<TextBlock Name="textBlockMessageClass" FontWeight="DemiBold" Grid.Row="6" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||||
|
<Button Content="{x:Static p:Resources.textNewDGItem}" Name="buttonNewItem" Margin="2" Click="buttonNewItem_Click" Grid.Row="6" Grid.Column="1" Background="Transparent" />
|
||||||
|
<TabControl Grid.Row="7" Grid.ColumnSpan="3">
|
||||||
|
<TabItem Header="{x:Static p:Resources.text102}" x:Name="tabIBCItems">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock x:Name="textBlock102" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text102IBCData}" Grid.Column="0" Grid.Row="0"/>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridIBCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textProductName}" Binding="{Binding ProductName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPollutionCategory}" Binding="{Binding PollutionCategoryDisplay}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRisks}" Binding="{Binding HazardsDisplay}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textColumsOfIBC}" Binding="{Binding SpecRef15_19}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpointInformation}" Binding="{Binding FlashpointInformationDisplay}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpoint}" Binding="{Binding Flashpoint_CEL}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantity}" Binding="{Binding Quantity_KGM, StringFormat={}{0:N3}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.text103}" x:Name="tabIGCItems">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock x:Name="textBlock103" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text103IGCData}" Grid.Row="0" />
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridIGCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textProductName}" Binding="{Binding ProductName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIMOClassSubclass}" Binding="{Binding IMOClass}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantity}" Binding="{Binding Quantity_KGM, StringFormat={}{0:N3}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.text104}" x:Name="tabIMSBCItems">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock x:Name="textBlock104" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text104IMSBCData}" Grid.Row="0" />
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridIMSBCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textBulkCargoShippingName}" Binding="{Binding BulkCargoShippingName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textMaterialHazard}" Binding="{Binding MHB}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIMOClassSubclass}" Binding="{Binding IMOClass}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantity}" Binding="{Binding Quantity_KGM, StringFormat={}{0:N3}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridComboBoxColumn Header="{x:Static p:Resources.textIMOHazardClass}" ItemsSource="{x:Static util:GlobalStructures.imoHazardClasses}" IsReadOnly="True" Width="auto">
|
||||||
|
<DataGridComboBoxColumn.ElementStyle>
|
||||||
|
<Style TargetType="ComboBox">
|
||||||
|
<Setter Property="SelectedIndex" Value="{Binding IMOHazardClass, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
</Style>
|
||||||
|
</DataGridComboBoxColumn.ElementStyle>
|
||||||
|
</DataGridComboBoxColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.text105}" x:Name="tabMARPOLItems">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock x:Name="textBlock105" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text105MARPOLData}" Grid.Row="0" />
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridMARPOLItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding Name}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpointInformation}" Binding="{Binding FlashpointInformationDisplay}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpoint}" Binding="{Binding Flashpoint_CEL}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantity}" Binding="{Binding Quantity_KGM, StringFormat={}{0:N3}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.text106}" x:Name="tabIMDGItems">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36"/>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock x:Name="textBlock106" FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text106IMDGData}" Grid.Row="0"/>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridIMDGItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="1" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridComboBoxColumn Header="{x:Static p:Resources.textPackingGroup}" ItemsSource="{x:Static util:GlobalStructures.PackingGroups}" IsReadOnly="True" Width="auto">
|
||||||
|
<DataGridComboBoxColumn.ElementStyle>
|
||||||
|
<Style TargetType="ComboBox">
|
||||||
|
<Setter Property="SelectedIndex" Value="{Binding PackingGroup, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
</Style>
|
||||||
|
</DataGridComboBoxColumn.ElementStyle>
|
||||||
|
</DataGridComboBoxColumn>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textProperShippingName}" Binding="{Binding ProperShippingName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIMOClassDivision}" Binding="{Binding IMOClass}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textTechnicalName}" Binding="{Binding TechnicalName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textNetExplosiveMass}" Binding="{Binding NetExplosiveMass_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpoint}" Binding="{Binding Flashpoint_CEL}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRadioNuclideName}" Binding="{Binding Class7NuclideName}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textMaxActivity}" Binding="{Binding Class7MaxActivity_BQL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCategory}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textTransportIndex}" Binding="{Binding Class7TransportIndex}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCriticalSafetyIndex}" Binding="{Binding Class7CSI}" 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.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" />
|
||||||
|
<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" />
|
||||||
|
<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" />
|
||||||
|
<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.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" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textVehicleLicensePlate}" Binding="{Binding VehicleLicenseNumber}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionBay}" Binding="{Binding Bay}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionRow}" Binding="{Binding Row}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionTier}" Binding="{Binding Tier}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
|
||||||
|
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
882
ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs
Normal file
882
ENI2/SheetDisplayControls/DangerousCargoControl.xaml.cs
Normal file
@ -0,0 +1,882 @@
|
|||||||
|
// Copyright (c) 2025- schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 10. Dangerous cargo arrival
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Util;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for DangerousCargoArrivalControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class DangerousCargoControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private HAZ haza;
|
||||||
|
private HAZ hazd;
|
||||||
|
|
||||||
|
private NewDGItemDialog newDGDialog = null;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public DangerousCargoControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += DangerousCargoArrivalControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD)
|
||||||
|
{
|
||||||
|
this.hazd = aMessage.Elements[0] as HAZ;
|
||||||
|
this.ControlMessages.Add(aMessage);
|
||||||
|
}
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA)
|
||||||
|
{
|
||||||
|
this.haza = aMessage.Elements[0] as HAZ;
|
||||||
|
this.ControlMessages.Add(aMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textBlockMessageClass.Text = IsDeparture ? "HAZD" : "HAZA";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.comboBoxVesselClass.ItemsSource = GlobalStructures.vesselClasses;
|
||||||
|
|
||||||
|
this.checkBoxDGManifestOnBoard.DataContext = this.IsDeparture ? hazd : haza;
|
||||||
|
this.textBoxDGManifestContactFamilyName.DataContext = this.IsDeparture ? hazd : haza;
|
||||||
|
this.textBoxDGManifestContactPhone.DataContext = this.IsDeparture ? hazd : haza;
|
||||||
|
this.checkBoxMoUBaltic.DataContext = this.IsDeparture ? hazd : haza;
|
||||||
|
this.comboBoxVesselClass.DataContext = this.IsDeparture ? hazd : haza;
|
||||||
|
|
||||||
|
#region init grids
|
||||||
|
|
||||||
|
this.dataGridIMDGItems.Initialize();
|
||||||
|
this.dataGridIMDGItems.ItemsSource = this.IsDeparture ? this.hazd.IMDGPositions : this.haza.IMDGPositions;
|
||||||
|
CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMDGItems.Items);
|
||||||
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
|
this.dataGridIMDGItems.CreateRequested += DataGridIMDGItems_CreateRequested;
|
||||||
|
this.dataGridIMDGItems.AddingNewItem += DataGridIMDGItems_AddingNewItem;
|
||||||
|
this.dataGridIMDGItems.EditRequested += DataGridIMDGItems_EditRequested;
|
||||||
|
this.dataGridIMDGItems.DeleteRequested += DataGridIMDGItems_DeleteRequested;
|
||||||
|
|
||||||
|
this.dataGridIBCItems.Initialize();
|
||||||
|
this.dataGridIBCItems.ItemsSource = this.IsDeparture ? this.hazd.IBCPositions : this.haza.IBCPositions;
|
||||||
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIBCItems.Items);
|
||||||
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
|
this.dataGridIBCItems.CreateRequested += DataGridIBCItems_CreateRequested;
|
||||||
|
this.dataGridIBCItems.AddingNewItem += DataGridIBCItems_AddingNewItem;
|
||||||
|
this.dataGridIBCItems.EditRequested += DataGridIBCItems_EditRequested;
|
||||||
|
this.dataGridIBCItems.DeleteRequested += DataGridIBCItems_DeleteRequested;
|
||||||
|
|
||||||
|
this.dataGridIGCItems.Initialize();
|
||||||
|
this.dataGridIGCItems.ItemsSource = this.IsDeparture ? this.hazd.IGCPositions : this.haza.IGCPositions;
|
||||||
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
|
this.dataGridIGCItems.CreateRequested += DataGridIGCItems_CreateRequested;
|
||||||
|
this.dataGridIGCItems.CreateRequested += DataGridIGCItems_CreateRequested;
|
||||||
|
this.dataGridIGCItems.AddingNewItem += DataGridIGCItems_AddingNewItem;
|
||||||
|
this.dataGridIGCItems.EditRequested += DataGridIGCItems_EditRequested;
|
||||||
|
this.dataGridIGCItems.DeleteRequested += DataGridIGCItems_DeleteRequested;
|
||||||
|
|
||||||
|
this.dataGridIMSBCItems.Initialize();
|
||||||
|
this.dataGridIMSBCItems.ItemsSource = this.IsDeparture ? this.hazd.IMSBCPositions : this.haza.IMSBCPositions;
|
||||||
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMSBCItems.Items);
|
||||||
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
|
this.dataGridIMSBCItems.CreateRequested += DataGridIMSBCItems_CreateRequested;
|
||||||
|
this.dataGridIMSBCItems.AddingNewItem += DataGridIMSBCItems_AddingNewItem;
|
||||||
|
this.dataGridIMSBCItems.EditRequested += DataGridIMSBCItems_EditRequested;
|
||||||
|
this.dataGridIMSBCItems.DeleteRequested += DataGridIMSBCItems_DeleteRequested;
|
||||||
|
|
||||||
|
this.dataGridMARPOLItems.Initialize();
|
||||||
|
this.dataGridMARPOLItems.ItemsSource = this.IsDeparture ? this.hazd.MARPOLPositions : this.haza.MARPOLPositions;
|
||||||
|
myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridMARPOLItems.Items);
|
||||||
|
((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
|
||||||
|
this.dataGridMARPOLItems.CreateRequested += DataGridMARPOLItems_CreateRequested;
|
||||||
|
this.dataGridMARPOLItems.AddingNewItem += DataGridMARPOLItems_AddingNewItem;
|
||||||
|
this.dataGridMARPOLItems.EditRequested += DataGridMARPOLItems_EditRequested;
|
||||||
|
this.dataGridMARPOLItems.DeleteRequested += DataGridMARPOLItems_DeleteRequested;
|
||||||
|
|
||||||
|
this.RefreshTabHeaders();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Extra Menüpunkte um Positionen zwischen HAZA / HAZD zu kopieren
|
||||||
|
|
||||||
|
this.dataGridIBCItems.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyIBCItem = new MenuItem();
|
||||||
|
copyIBCItem.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
||||||
|
copyIBCItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyIBCItem.Click += new RoutedEventHandler(this.copyIBC);
|
||||||
|
this.dataGridIBCItems.ContextMenu.Items.Add(copyIBCItem);
|
||||||
|
|
||||||
|
this.dataGridIGCItems.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyItemIGC = new MenuItem();
|
||||||
|
copyItemIGC.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
||||||
|
copyItemIGC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyItemIGC.Click += new RoutedEventHandler(this.copyIGC);
|
||||||
|
this.dataGridIGCItems.ContextMenu.Items.Add(copyItemIGC);
|
||||||
|
|
||||||
|
this.dataGridIMDGItems.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyItemIMDG = new MenuItem();
|
||||||
|
copyItemIMDG.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
||||||
|
copyItemIMDG.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyItemIMDG.Click += new RoutedEventHandler(this.copyIMDG);
|
||||||
|
this.dataGridIMDGItems.ContextMenu.Items.Add(copyItemIMDG);
|
||||||
|
|
||||||
|
this.dataGridIMSBCItems.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyItemIMSBC = new MenuItem();
|
||||||
|
copyItemIMSBC.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
||||||
|
copyItemIMSBC.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyItemIMSBC.Click += new RoutedEventHandler(this.copyIMSBC);
|
||||||
|
this.dataGridIMSBCItems.ContextMenu.Items.Add(copyItemIMSBC);
|
||||||
|
|
||||||
|
this.dataGridMARPOLItems.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyItemMARPOL = new MenuItem();
|
||||||
|
copyItemMARPOL.Header = string.Format(Properties.Resources.textCopyTo, this.IsDeparture ? "HAZA" : "HAZD");
|
||||||
|
copyItemMARPOL.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyItemMARPOL.Click += new RoutedEventHandler(this.copyMARPOL);
|
||||||
|
this.dataGridMARPOLItems.ContextMenu.Items.Add(copyItemMARPOL);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
this._initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region SetEnabled
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
this.dangerousCargoGroupBox.IsEnabled = enabled;
|
||||||
|
this.dataGridIBCItems.IsEnabled = enabled;
|
||||||
|
// this.checkBoxDangerousGoodsOnBoard.IsEnabled = enabled;
|
||||||
|
this.checkBoxDGManifestOnBoard.IsEnabled = enabled;
|
||||||
|
this.checkBoxMoUBaltic.IsEnabled = enabled;
|
||||||
|
this.dataGridIBCItems.IsEnabled = enabled;
|
||||||
|
this.dataGridIMDGItems.IsEnabled = enabled;
|
||||||
|
this.dataGridIGCItems.IsEnabled = enabled;
|
||||||
|
this.dataGridIMSBCItems.IsEnabled = enabled;
|
||||||
|
this.dataGridMARPOLItems.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public bool IsDeparture { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void DangerousCargoArrivalControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxDGManifestOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxMoUBaltic, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.RegisterTextboxChange(this.textBoxDGManifestContactFamilyName, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.RegisterTextboxChange(this.textBoxDGManifestContactPhone, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
|
||||||
|
if(this.IsDeparture)
|
||||||
|
{
|
||||||
|
this.dangerousCargoGroupBox.Header = Properties.Resources.text11DangerousCargoDeparture;
|
||||||
|
this.textBlock101.Text = Properties.Resources.text111General;
|
||||||
|
this.textBlock102.Text = Properties.Resources.text112IBCData;
|
||||||
|
this.textBlock103.Text = Properties.Resources.text113IGCData;
|
||||||
|
this.textBlock104.Text = Properties.Resources.text114IMSBCData;
|
||||||
|
this.textBlock105.Text = Properties.Resources.text115MARPOLData;
|
||||||
|
this.textBlock106.Text = Properties.Resources.text116IMDGData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DangerousGoodsDetailControl_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
this.RefreshTabHeaders();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Copy event handler
|
||||||
|
|
||||||
|
private void copyMARPOL(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren
|
||||||
|
if (this.dataGridMARPOLItems.SelectedItems != null)
|
||||||
|
{
|
||||||
|
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
||||||
|
foreach (MARPOL_Annex_I_Position selectedMARPOL in this.dataGridMARPOLItems.SelectedItems)
|
||||||
|
{
|
||||||
|
MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position();
|
||||||
|
copyMARPOL.MessageHeader = target_haz.MessageHeader;
|
||||||
|
copyMARPOL.HAZ = target_haz;
|
||||||
|
copyMARPOL.CopyFromMARPOL(selectedMARPOL);
|
||||||
|
copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.MARPOLPositions, "MARPOL-");
|
||||||
|
target_haz.MARPOLPositions.Add(copyMARPOL);
|
||||||
|
target_haz.NoDPGOnBoardOnArrival = false;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
||||||
|
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyIMSBC(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren
|
||||||
|
if (this.dataGridIMSBCItems.SelectedItems != null)
|
||||||
|
{
|
||||||
|
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
||||||
|
foreach (IMSBCPosition selectedIMSBC in this.dataGridIMSBCItems.SelectedItems)
|
||||||
|
{
|
||||||
|
IMSBCPosition copyIMSBC = new IMSBCPosition();
|
||||||
|
copyIMSBC.MessageHeader = target_haz.MessageHeader;
|
||||||
|
copyIMSBC.HAZ = target_haz;
|
||||||
|
copyIMSBC.CopyFromIMSBC(selectedIMSBC);
|
||||||
|
copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IMSBCPositions, "IMSBC-");
|
||||||
|
target_haz.IMSBCPositions.Add(copyIMSBC);
|
||||||
|
target_haz.NoDPGOnBoardOnArrival = false;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
||||||
|
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyIMDG(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren
|
||||||
|
if (this.dataGridIMDGItems.SelectedItems != null)
|
||||||
|
{
|
||||||
|
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
||||||
|
foreach (IMDGPosition selectedIMDG in this.dataGridIMDGItems.SelectedItems)
|
||||||
|
{
|
||||||
|
IMDGPosition copyIMDG = new IMDGPosition();
|
||||||
|
copyIMDG.MessageHeader = target_haz.MessageHeader;
|
||||||
|
copyIMDG.HAZ = target_haz;
|
||||||
|
copyIMDG.CopyFromIMDG(selectedIMDG);
|
||||||
|
copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IMDGPositions, "IMDG-");
|
||||||
|
target_haz.IMDGPositions.Add(copyIMDG);
|
||||||
|
target_haz.NoDPGOnBoardOnArrival = false;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
||||||
|
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyIGC(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren
|
||||||
|
if (this.dataGridIGCItems.SelectedItems != null)
|
||||||
|
{
|
||||||
|
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
||||||
|
foreach (IGCPosition selectedIGC in this.dataGridIGCItems.SelectedItems)
|
||||||
|
{
|
||||||
|
IGCPosition copyIGC = new IGCPosition();
|
||||||
|
copyIGC.MessageHeader = target_haz.MessageHeader;
|
||||||
|
copyIGC.HAZ = target_haz;
|
||||||
|
copyIGC.CopyFromIGC(selectedIGC);
|
||||||
|
copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IGCPositions, "IGC-");
|
||||||
|
target_haz.IGCPositions.Add(copyIGC);
|
||||||
|
target_haz.NoDPGOnBoardOnArrival = false;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
||||||
|
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyIBC(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
|
||||||
|
if (this.dataGridIBCItems.SelectedItems != null)
|
||||||
|
{
|
||||||
|
HAZ target_haz = this.IsDeparture ? this.haza : this.hazd;
|
||||||
|
foreach (IBCPosition selectedIBC in this.dataGridIBCItems.SelectedItems)
|
||||||
|
{
|
||||||
|
if (selectedIBC != null)
|
||||||
|
{
|
||||||
|
IBCPosition copyIBC = new IBCPosition();
|
||||||
|
copyIBC.MessageHeader = target_haz.MessageHeader;
|
||||||
|
copyIBC.HAZ = target_haz;
|
||||||
|
copyIBC.CopyFromIBC(selectedIBC);
|
||||||
|
copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(target_haz.IBCPositions, "IBC-");
|
||||||
|
target_haz.IBCPositions.Add(copyIBC);
|
||||||
|
target_haz.NoDPGOnBoardOnArrival = false;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
|
||||||
|
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#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:
|
||||||
|
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:
|
||||||
|
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:
|
||||||
|
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:
|
||||||
|
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 MARPOL datagrid handlers
|
||||||
|
|
||||||
|
private void DataGridMARPOLItems_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (obj is MARPOL_Annex_I_Position marpol)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(marpol);
|
||||||
|
haz.MARPOLPositions.Remove(marpol);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.MARPOLPositions));
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridMARPOLItems_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditMarpolDialog eld = new EditMarpolDialog();
|
||||||
|
eld.MARPOL = obj as MARPOL_Annex_I_Position;
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!haz.MARPOLPositions.Contains(eld.MARPOL))
|
||||||
|
haz.MARPOLPositions.Add(eld.MARPOL);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
eld.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
|
eld.MARPOL.HAZ = haz;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.MARPOLPositions.Contains(eld.MARPOL))
|
||||||
|
haz.MARPOLPositions.Add(eld.MARPOL);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridMARPOLItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridMARPOLItems_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridMARPOLItems_CreateRequested()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditMarpolDialog ebd = new EditMarpolDialog();
|
||||||
|
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
|
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
|
ebd.MARPOL.HAZ = haz;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!haz.MARPOLPositions.Contains(ebd.MARPOL))
|
||||||
|
haz.MARPOLPositions.Add(ebd.MARPOL);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
|
ebd.MARPOL.HAZ = haz;
|
||||||
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.MARPOLPositions.Contains(ebd.MARPOL))
|
||||||
|
haz.MARPOLPositions.Add(ebd.MARPOL);
|
||||||
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IMSBC datagrid handlers
|
||||||
|
|
||||||
|
private void DataGridIMSBCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (obj is IMSBCPosition imsbc)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imsbc);
|
||||||
|
haz.IMSBCPositions.Remove(imsbc);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMSBCPositions));
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMSBCItems_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIMSBCDialog eld = new EditIMSBCDialog();
|
||||||
|
eld.IMSBC = obj as IMSBCPosition;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!haz.IMSBCPositions.Contains(eld.IMSBC))
|
||||||
|
haz.IMSBCPositions.Add(eld.IMSBC);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
eld.IMSBC = new IMSBCPosition();
|
||||||
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
||||||
|
eld.IMSBC.HAZ = haz;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IMSBCPositions.Contains(eld.IMSBC))
|
||||||
|
haz.IMSBCPositions.Add(eld.IMSBC);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMSBCItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridIMSBCItems_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMSBCItems_CreateRequested()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIMSBCDialog ebd = new EditIMSBCDialog();
|
||||||
|
ebd.IMSBC = new IMSBCPosition();
|
||||||
|
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
||||||
|
ebd.IMSBC.HAZ = haz;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
|
||||||
|
haz.IMSBCPositions.Add(ebd.IMSBC);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
ebd.IMSBC = new IMSBCPosition();
|
||||||
|
ebd.IMSBC.HAZ = haz;
|
||||||
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMSBCPositions, "IMSBC-");
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
|
||||||
|
haz.IMSBCPositions.Add(ebd.IMSBC);
|
||||||
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IGC datagrid handlers
|
||||||
|
|
||||||
|
private void DataGridIGCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (obj is IGCPosition igc)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(igc);
|
||||||
|
haz.IGCPositions.Remove(igc);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IGCPositions));
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIGCItems_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIGCDialog eld = new EditIGCDialog();
|
||||||
|
eld.IGC = obj as IGCPosition;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!haz.IGCPositions.Contains(eld.IGC))
|
||||||
|
haz.IGCPositions.Add(eld.IGC);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
eld.IGC = new IGCPosition();
|
||||||
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
||||||
|
eld.IGC.HAZ = haz;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IGCPositions.Contains(eld.IGC))
|
||||||
|
haz.IGCPositions.Add(eld.IGC);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIGCItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridIGCItems_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIGCItems_CreateRequested()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIGCDialog ebd = new EditIGCDialog();
|
||||||
|
ebd.IGC = new IGCPosition();
|
||||||
|
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
||||||
|
ebd.IGC.HAZ = haz;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!haz.IGCPositions.Contains(ebd.IGC))
|
||||||
|
haz.IGCPositions.Add(ebd.IGC);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
ebd.IGC = new IGCPosition();
|
||||||
|
ebd.IGC.HAZ = haz;
|
||||||
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IGCPositions, "IGC-");
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IGCPositions.Contains(ebd.IGC))
|
||||||
|
haz.IGCPositions.Add(ebd.IGC);
|
||||||
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBC datagrid handlers
|
||||||
|
|
||||||
|
private void DataGridIBCItems_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (obj is IBCPosition ibc)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ibc);
|
||||||
|
haz.IBCPositions.Remove(ibc);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IBCPositions));
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIBCItems_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIBCDialog eld = new EditIBCDialog();
|
||||||
|
eld.IBC = obj as IBCPosition;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!haz.IBCPositions.Contains(eld.IBC))
|
||||||
|
haz.IBCPositions.Add(eld.IBC);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
eld.IBC = new IBCPosition();
|
||||||
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
||||||
|
eld.IBC.HAZ = haz;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IBCPositions.Contains(eld.IBC))
|
||||||
|
haz.IBCPositions.Add(eld.IBC);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIBCItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridIBCItems_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIBCItems_CreateRequested()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIBCDialog ebd = new EditIBCDialog();
|
||||||
|
ebd.IBC = new IBCPosition();
|
||||||
|
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
||||||
|
ebd.IBC.HAZ = haz;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!haz.IBCPositions.Contains(ebd.IBC))
|
||||||
|
haz.IBCPositions.Add(ebd.IBC);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
ebd.IBC = new IBCPosition();
|
||||||
|
ebd.IBC.HAZ = haz;
|
||||||
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IBCPositions, "IBC-");
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IBCPositions.Contains(ebd.IBC))
|
||||||
|
haz.IBCPositions.Add(ebd.IBC);
|
||||||
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IMDG datagrid handlers
|
||||||
|
|
||||||
|
private void DataGridIMDGItems_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (obj is IMDGPosition imdg)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imdg);
|
||||||
|
haz.IMDGPositions.Remove(imdg);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(haz.IMDGPositions));
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMDGItems_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIMDGDialog eld = new EditIMDGDialog();
|
||||||
|
eld.IMDG = obj as IMDGPosition;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!haz.IMDGPositions.Contains(eld.IMDG))
|
||||||
|
haz.IMDGPositions.Add(eld.IMDG);
|
||||||
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
|
eld.IMDG = new IMDGPosition();
|
||||||
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
||||||
|
eld.IMDG.HAZ = haz;
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IMDGPositions.Contains(eld.IMDG))
|
||||||
|
haz.IMDGPositions.Add(eld.IMDG);
|
||||||
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
this.SetHAZGlobalFlags();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMDGItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridIMDGItems_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridIMDGItems_CreateRequested()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
EditIMDGDialog ebd = new EditIMDGDialog();
|
||||||
|
ebd.IMDG = new IMDGPosition();
|
||||||
|
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
||||||
|
ebd.IMDG.HAZ = haz;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!haz.IMDGPositions.Contains(ebd.IMDG))
|
||||||
|
haz.IMDGPositions.Add(ebd.IMDG);
|
||||||
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
|
ebd.IMDG = new IMDGPosition();
|
||||||
|
ebd.IMDG.HAZ = haz;
|
||||||
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(haz.IMDGPositions, "IMDG-");
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!haz.IMDGPositions.Contains(ebd.IMDG))
|
||||||
|
haz.IMDGPositions.Add(ebd.IMDG);
|
||||||
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The tab headers include an info on how many DG items there are
|
||||||
|
/// </summary>
|
||||||
|
private void RefreshTabHeaders()
|
||||||
|
{
|
||||||
|
HAZ haz = this.IsDeparture ? hazd : haza;
|
||||||
|
if (haz.IMDGPositions.Count > 0)
|
||||||
|
this.tabIMDGItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMDGItems, haz.IMDGPositions.Count);
|
||||||
|
else
|
||||||
|
this.tabIMDGItems.Header = Properties.Resources.textIMDGItems;
|
||||||
|
|
||||||
|
if (haz.IBCPositions.Count > 0)
|
||||||
|
this.tabIBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIBCItems, haz.IBCPositions.Count);
|
||||||
|
else
|
||||||
|
this.tabIBCItems.Header = Properties.Resources.textIBCItems;
|
||||||
|
|
||||||
|
if (haz.IGCPositions.Count > 0)
|
||||||
|
this.tabIGCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIGCItems, haz.IGCPositions.Count);
|
||||||
|
else
|
||||||
|
this.tabIGCItems.Header = Properties.Resources.textIGCItems;
|
||||||
|
|
||||||
|
if (haz.IMSBCPositions.Count > 0)
|
||||||
|
this.tabIMSBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMSBCItems, haz.IMSBCPositions.Count);
|
||||||
|
else
|
||||||
|
this.tabIMSBCItems.Header = Properties.Resources.textIMSBCItems;
|
||||||
|
|
||||||
|
if (haz.MARPOLPositions.Count > 0)
|
||||||
|
this.tabMARPOLItems.Header = string.Format("{0} ({1})", Properties.Resources.textMARPOLItems, haz.MARPOLPositions.Count);
|
||||||
|
else
|
||||||
|
this.tabMARPOLItems.Header = Properties.Resources.textMARPOLItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
70
ENI2/SheetDisplayControls/PassengerDepartureControl.xaml
Normal file
70
ENI2/SheetDisplayControls/PassengerDepartureControl.xaml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.PassengerDepartureControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1450" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="passengerDepartureGroupBox" Header="{x:Static p:Resources.text9PassengerDeparture}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="640" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Label Grid.Row="0" Grid.Column="0" Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" HorizontalAlignment="Right" />
|
||||||
|
<CheckBox Grid.Row="0" Grid.Column="1" Name="checkBoxPasNotificationSchengenDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengenDeparture_Click"/>
|
||||||
|
<Label Grid.Row="1" Grid.Column="0" Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" HorizontalAlignment="Right"/>
|
||||||
|
<CheckBox Grid.Row="1" Grid.Column="1" Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/>
|
||||||
|
|
||||||
|
<Button Name="buttonImportExcelPassengerDeparture" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassengerDeparture_Click" />
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntriesDeparture" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
|
||||||
|
<Label Name="labelPasEntryCountDeparture" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
<Button Name="buttonDeleteAllPasD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasD_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfEmbarkation}" Binding="{Binding PassengerPortOfEmbarkation}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDisembarkation}" Binding="{Binding PassengerPortOfDisembarkation}" 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.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.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.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.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.textEmergencyCare}" Binding="{Binding EmergencyCare, 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>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
387
ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs
Normal file
387
ENI2/SheetDisplayControls/PassengerDepartureControl.xaml.cs
Normal file
@ -0,0 +1,387 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 9. Pas data departure
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Locode;
|
||||||
|
using ENI2.Util;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for PassengerDepartureControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class PassengerDepartureControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private Message _pasMessage;
|
||||||
|
private Message _pasdMessage;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public PassengerDepartureControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASA) { this._pasMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASD) { this._pasdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region init PASD
|
||||||
|
|
||||||
|
if (this._pasdMessage == null)
|
||||||
|
{
|
||||||
|
this._pasdMessage = this.Core.CreateMessage(Message.NotificationClass.PASD);
|
||||||
|
this.Messages.Add(this._pasdMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataGridPassengerListDeparture.Initialize();
|
||||||
|
this.dataGridPassengerListDeparture.ItemsSource = this._pasdMessage.Elements;
|
||||||
|
this.dataGridPassengerListDeparture.AddingNewItem += DataGridPassengerListDeparture_AddingNewItem;
|
||||||
|
this.dataGridPassengerListDeparture.EditRequested += DataGridPassengerListDeparture_EditRequested;
|
||||||
|
this.dataGridPassengerListDeparture.DeleteRequested += DataGridPassengerListDeparture_DeleteRequested;
|
||||||
|
this.dataGridPassengerListDeparture.CreateRequested += DataGridPassengerListDeparture_CreateRequested;
|
||||||
|
this.dataGridPassengerListDeparture.RefreshGrid += DataGridPassengerListDeparture_RefreshGrid;
|
||||||
|
this.dataGridPassengerListDeparture.MultiEditRequested += DataGridPassengerListDeparture_MultiEditRequested;
|
||||||
|
|
||||||
|
if (this._pasdMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
this.checkBoxPasNotificationSchengenDeparture.IsChecked = ((PASD)this._pasdMessage.Elements[0]).NotificationSchengen;
|
||||||
|
this.checkBoxPasNotificationPAXDeparture.IsChecked = ((PASD)this._pasdMessage.Elements[0]).NotificationPAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textBlockNumPasEntriesDeparture.DataContext = this._pasdMessage;
|
||||||
|
|
||||||
|
// extra menu copy to PASA
|
||||||
|
{
|
||||||
|
this.dataGridPassengerListDeparture.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyPASDItem = new MenuItem();
|
||||||
|
copyPASDItem.Header = Properties.Resources.textCopyToPASA;
|
||||||
|
copyPASDItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyPASDItem.Click += CopyPASDItem_Click;
|
||||||
|
this.dataGridPassengerListDeparture.ContextMenu.Items.Add(copyPASDItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.passengerDepartureGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void CopyPASDItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridPassengerListDeparture.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (PASD pasd in this.dataGridPassengerListDeparture.SelectedItems)
|
||||||
|
{
|
||||||
|
PAS pasa = new PAS();
|
||||||
|
pasa.MessageHeader = this._pasMessage;
|
||||||
|
pasa.CopyFromPAS(pasd);
|
||||||
|
pasa.IsDeparture = false;
|
||||||
|
pasa.Identifier = DatabaseEntity.GetNewIdentifier(this._pasMessage.Elements);
|
||||||
|
this._pasMessage.Elements.Add(pasa);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxPasNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (PASD pasd in _pasdMessage.Elements.Cast<PASD>())
|
||||||
|
{
|
||||||
|
pasd.NotificationSchengen = checkBoxPasNotificationSchengenDeparture.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxPasNotificationPAXDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (PASD pasd in _pasdMessage.Elements.Cast<PASD>())
|
||||||
|
{
|
||||||
|
pasd.NotificationPAX = checkBoxPasNotificationPAXDeparture.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonImportExcelPassengerDeparture_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<PASD> importPassenger = new List<PASD>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (((IExcelDataReader)reader).FieldCount < 17)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 17 columns of data");
|
||||||
|
}
|
||||||
|
|
||||||
|
PASD pas = new PASD();
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetValue(0).ToString();
|
||||||
|
if (pas.PassengerLastName.Equals("Family Name") || (pas.PassengerLastName.Trim().Length == 0)) continue;
|
||||||
|
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetValue(1).ToString();
|
||||||
|
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||||
|
if (!reader.IsDBNull(3)) pas.PassengerPortOfEmbarkation = reader.GetString(3);
|
||||||
|
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||||
|
pas.PassengerPortOfEmbarkation = null;
|
||||||
|
if (!reader.IsDBNull(4)) pas.PassengerPortOfDisembarkation = reader.GetString(4);
|
||||||
|
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||||
|
pas.PassengerPortOfDisembarkation = null;
|
||||||
|
if (!reader.IsDBNull(5)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(5));
|
||||||
|
if (!reader.IsDBNull(6)) pas.PassengerNationality = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
|
||||||
|
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||||
|
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||||
|
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = reader.ReadAsString( 11);
|
||||||
|
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||||
|
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = reader.ReadAsString(14);
|
||||||
|
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15);
|
||||||
|
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = reader.ReadAsString(16);
|
||||||
|
|
||||||
|
pas.MessageHeader = this._pasMessage;
|
||||||
|
pas.IsDirty = true;
|
||||||
|
pas.Identifier = PASD.GetNewIdentifier(this._pasdMessage.Elements);
|
||||||
|
this._pasdMessage.Elements.Add(pas);
|
||||||
|
importPassenger.Add(pas);
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importPassenger.Count > 0)
|
||||||
|
{
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
MessageBox.Show(String.Format(Properties.Resources.textPassengerImported, importPassenger.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void buttonDeleteAllPasD_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (PASD pasd in this._pasdMessage.Elements.Cast<PASD>())
|
||||||
|
{
|
||||||
|
await DBManagerAsync.DeleteAsync(pasd);
|
||||||
|
}
|
||||||
|
this._pasdMessage.Elements.Clear();
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region passenger grid departure
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_CreateRequested()
|
||||||
|
{
|
||||||
|
EditPASDialog epd = new EditPASDialog
|
||||||
|
{
|
||||||
|
PAS = new PASD()
|
||||||
|
};
|
||||||
|
epd.PAS.IsDeparture = true;
|
||||||
|
epd.PAS.Identifier = PASD.GetNewIdentifier(_pasdMessage.Elements);
|
||||||
|
epd.PAS.MessageHeader = this._pasdMessage;
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!this._pasdMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
this._pasdMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASD();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
epd.PAS = new PASD
|
||||||
|
{
|
||||||
|
IsDeparture = true,
|
||||||
|
MessageHeader = this._pasdMessage,
|
||||||
|
Identifier = PASD.GetNewIdentifier(_pasdMessage.Elements)
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._pasdMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasdMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASD();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is PASD pasd)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_pasdMessage.Elements.Remove(pasd);
|
||||||
|
DBManager.Instance.Delete(pasd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_RefreshGrid()
|
||||||
|
{
|
||||||
|
DatabaseEntity.ResetIdentifiers(_pasdMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditPASDialog epd = new EditPASDialog
|
||||||
|
{
|
||||||
|
PAS = obj as PASD
|
||||||
|
};
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!_pasMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASD();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
epd.PAS = new PASD
|
||||||
|
{
|
||||||
|
IsDeparture = true,
|
||||||
|
Identifier = PASD.GetNewIdentifier(_pasdMessage.Elements),
|
||||||
|
MessageHeader = _pasdMessage
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_pasdMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasdMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASD();
|
||||||
|
}
|
||||||
|
epd.PAS.IsDirty = true;
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridPassengerListDeparture_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerListDeparture_MultiEditRequested(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
List<PAS> pasList = new List<PAS>();
|
||||||
|
foreach (PAS apas in databaseEntities.Cast<PAS>())
|
||||||
|
pasList.Add(apas);
|
||||||
|
|
||||||
|
// write common values of all PAS entities to template entity
|
||||||
|
PAS pas = PAS.CreateCommon(pasList);
|
||||||
|
|
||||||
|
EditPASDialog dialog = new EditPASDialog();
|
||||||
|
dialog.PAS = pas;
|
||||||
|
dialog.AddVisible = false;
|
||||||
|
if (dialog.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
// write back changed values from pas to all entities and mark them as changed
|
||||||
|
PAS.WriteTemplateToList(pas, pasList);
|
||||||
|
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
this.dataGridPassengerListDeparture.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private methods
|
||||||
|
|
||||||
|
private void CheckPASD()
|
||||||
|
{
|
||||||
|
if (this._pasdMessage.Elements.Count == 0) return;
|
||||||
|
PASD firstPAS = this._pasdMessage.Elements[0] as PASD;
|
||||||
|
if (this._pasdMessage.Elements.Count == 1)
|
||||||
|
{
|
||||||
|
firstPAS.NotificationSchengen = true;
|
||||||
|
this.checkBoxPasNotificationSchengenDeparture.IsChecked = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 1; i < this._pasdMessage.Elements.Count; i++)
|
||||||
|
{
|
||||||
|
((PASD)this._pasdMessage.Elements[i]).NotificationSchengen = firstPAS.NotificationSchengen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
69
ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml
Normal file
69
ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.PassengerPreArrivalControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1450" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="passengerArrivalGroupBox" Header="{x:Static p:Resources.text8PassengerArrival}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="640" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<CheckBox Grid.Column="1" Name="checkBoxPasNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click" />
|
||||||
|
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" HorizontalAlignment="Right" />
|
||||||
|
<CheckBox Grid.Column="1" Grid.Row="1" Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
|
||||||
|
<Label Grid.Column="0" Grid.Row="1" Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" HorizontalAlignment="Right" />
|
||||||
|
<Button Grid.Column="0" Grid.Row="3" Name="buttonImportExcelPassenger" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
|
||||||
|
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<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}" />
|
||||||
|
<Button Name="buttonDeleteAllPasA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasA_Click"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfEmbarkation}" Binding="{Binding PassengerPortOfEmbarkation}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDisembarkation}" Binding="{Binding PassengerPortOfDisembarkation}" 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.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.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.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.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.textEmergencyCare}" Binding="{Binding EmergencyCare, 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>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
384
ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs
Normal file
384
ENI2/SheetDisplayControls/PassengerPreArrivalControl.xaml.cs
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 8. Pas data arrival
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using ENI2.Locode;
|
||||||
|
using ENI2.Util;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for PassengerPreArrivalControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class PassengerPreArrivalControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private Message _pasMessage;
|
||||||
|
private Message _pasdMessage;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public PassengerPreArrivalControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public overrides
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASA) { this._pasMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASD) { this._pasdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region init PASA
|
||||||
|
|
||||||
|
if (this._pasMessage == null)
|
||||||
|
{
|
||||||
|
this._pasMessage = this.Core.CreateMessage(Message.NotificationClass.PASA);
|
||||||
|
this.Messages.Add(this._pasMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textBlockNumPasEntries.DataContext = this._pasMessage;
|
||||||
|
|
||||||
|
this.dataGridPassengerList.Initialize();
|
||||||
|
this.dataGridPassengerList.ItemsSource = this._pasMessage.Elements;
|
||||||
|
this.dataGridPassengerList.AddingNewItem += DataGridPassengerList_AddingNewItem;
|
||||||
|
this.dataGridPassengerList.EditRequested += DataGridPassengerList_EditRequested;
|
||||||
|
this.dataGridPassengerList.DeleteRequested += DataGridPassengerList_DeleteRequested;
|
||||||
|
this.dataGridPassengerList.CreateRequested += DataGridPassengerList_CreateRequested;
|
||||||
|
this.dataGridPassengerList.RefreshGrid += DataGridPassengerList_RefreshGrid;
|
||||||
|
this.dataGridPassengerList.MultiEditRequested += DataGridPassengerList_MultiEditRequested;
|
||||||
|
|
||||||
|
if (this._pasMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
this.checkBoxPasNotificationSchengen.IsChecked = ((PAS)this._pasMessage.Elements[0]).NotificationSchengen;
|
||||||
|
this.checkBoxPasNotificationPAX.IsChecked = ((PAS)this._pasMessage.Elements[0]).NotificationPAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
// extra menu copy to PASD
|
||||||
|
{
|
||||||
|
this.dataGridPassengerList.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyPASAItem = new MenuItem();
|
||||||
|
copyPASAItem.Header = Properties.Resources.textCopyToPASD;
|
||||||
|
copyPASAItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyPASAItem.Click += CopyPASAItem_Click; ;
|
||||||
|
this.dataGridPassengerList.ContextMenu.Items.Add(copyPASAItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.passengerArrivalGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void CopyPASAItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridPassengerList.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (PAS pasa in this.dataGridPassengerList.SelectedItems)
|
||||||
|
{
|
||||||
|
PASD pasd = new PASD();
|
||||||
|
pasd.MessageHeader = this._pasdMessage;
|
||||||
|
pasd.CopyFromPAS(pasa);
|
||||||
|
pasd.IsDeparture = true;
|
||||||
|
pasd.Identifier = DatabaseEntity.GetNewIdentifier(this._pasdMessage.Elements);
|
||||||
|
this._pasdMessage.Elements.Add(pasd);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonImportExcelPassenger_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||||
|
{
|
||||||
|
List<PAS> importPassenger = new List<PAS>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
if (((IExcelDataReader)reader).FieldCount < 17)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Sheet must have 17 columns of data");
|
||||||
|
}
|
||||||
|
|
||||||
|
PAS pas = new PAS();
|
||||||
|
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||||
|
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetValue(0).ToString().Clean();
|
||||||
|
if (pas.PassengerLastName.Equals("Family Name") || (pas.PassengerLastName.Trim().Length == 0)) continue;
|
||||||
|
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetValue(1).ToString().Clean();
|
||||||
|
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||||
|
if (!reader.IsDBNull(3)) pas.PassengerPortOfEmbarkation = reader.GetString(3).Clean();
|
||||||
|
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||||
|
pas.PassengerPortOfEmbarkation = null;
|
||||||
|
if (!reader.IsDBNull(4)) pas.PassengerPortOfDisembarkation = reader.GetString(4).Clean();
|
||||||
|
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||||
|
pas.PassengerPortOfDisembarkation = null;
|
||||||
|
if (!reader.IsDBNull(5)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(5));
|
||||||
|
if (!reader.IsDBNull(6)) pas.PassengerNationality = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7).Clean();
|
||||||
|
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper().Clean();
|
||||||
|
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||||
|
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||||
|
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = reader.ReadAsString(11).Clean();
|
||||||
|
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||||
|
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||||
|
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = reader.ReadAsString(14).Clean();
|
||||||
|
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15).Clean();
|
||||||
|
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = reader.ReadAsString(16).Clean();
|
||||||
|
|
||||||
|
pas.MessageHeader = this._pasMessage;
|
||||||
|
pas.IsDirty = true;
|
||||||
|
pas.Identifier = PAS.GetNewIdentifier(this._pasMessage.Elements);
|
||||||
|
this._pasMessage.Elements.Add(pas);
|
||||||
|
importPassenger.Add(pas);
|
||||||
|
}
|
||||||
|
} while (reader.NextResult());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importPassenger.Count > 0)
|
||||||
|
{
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
MessageBox.Show(String.Format(Properties.Resources.textPassengerImported, importPassenger.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxPasNotificationSchengen_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (PAS pas in _pasMessage.Elements.Cast<PAS>())
|
||||||
|
{
|
||||||
|
pas.NotificationSchengen = checkBoxPasNotificationSchengen.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxPasNotificationPAX_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
foreach (PAS pas in _pasMessage.Elements.Cast<PAS>())
|
||||||
|
{
|
||||||
|
pas.NotificationPAX = checkBoxPasNotificationPAX.IsChecked;
|
||||||
|
}
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void buttonDeleteAllPasA_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (PAS pasa in this._pasMessage.Elements.Cast<PAS>())
|
||||||
|
{
|
||||||
|
await DBManagerAsync.DeleteAsync(pasa);
|
||||||
|
}
|
||||||
|
this._pasMessage.Elements.Clear();
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region passenger grid arrival
|
||||||
|
|
||||||
|
private void DataGridPassengerList_CreateRequested()
|
||||||
|
{
|
||||||
|
EditPASDialog epd = new EditPASDialog
|
||||||
|
{
|
||||||
|
PAS = new PAS()
|
||||||
|
};
|
||||||
|
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
|
||||||
|
epd.PAS.MessageHeader = this._pasMessage;
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!this._pasMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
this._pasMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASA();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
epd.PAS = new PAS
|
||||||
|
{
|
||||||
|
MessageHeader = this._pasMessage,
|
||||||
|
Identifier = PAS.GetNewIdentifier(_pasMessage.Elements)
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._pasMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASA();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerList_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is PAS pas)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_pasMessage.Elements.Remove(pas);
|
||||||
|
DBManager.Instance.Delete(pas);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerList_RefreshGrid()
|
||||||
|
{
|
||||||
|
DatabaseEntity.ResetIdentifiers(_pasMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerList_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditPASDialog epd = new EditPASDialog
|
||||||
|
{
|
||||||
|
PAS = obj as PAS
|
||||||
|
};
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!_pasMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASA();
|
||||||
|
}
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
epd.PAS = new PAS
|
||||||
|
{
|
||||||
|
Identifier = PAS.GetNewIdentifier(_pasMessage.Elements),
|
||||||
|
MessageHeader = _pasMessage
|
||||||
|
};
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_pasMessage.Elements.Contains(epd.PAS))
|
||||||
|
{
|
||||||
|
_pasMessage.Elements.Add(epd.PAS);
|
||||||
|
this.CheckPASA();
|
||||||
|
}
|
||||||
|
epd.PAS.IsDirty = true;
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerList_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridPassengerList_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridPassengerList_MultiEditRequested(List<DatabaseEntity> databaseEntities)
|
||||||
|
{
|
||||||
|
List<PAS> pasList = new List<PAS>();
|
||||||
|
foreach (PAS apas in databaseEntities.Cast<PAS>())
|
||||||
|
pasList.Add(apas);
|
||||||
|
|
||||||
|
// write common values of all PAS entities to template entity
|
||||||
|
PAS pas = PAS.CreateCommon(pasList);
|
||||||
|
|
||||||
|
EditPASDialog dialog = new EditPASDialog();
|
||||||
|
dialog.PAS = pas;
|
||||||
|
dialog.AddVisible = false;
|
||||||
|
if (dialog.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
// write back changed values from pas to all entities and mark them as changed
|
||||||
|
PAS.WriteTemplateToList(pas, pasList);
|
||||||
|
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||||
|
this.dataGridPassengerList.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private methods
|
||||||
|
|
||||||
|
private void CheckPASA()
|
||||||
|
{
|
||||||
|
if (this._pasMessage.Elements.Count == 0) return;
|
||||||
|
PAS firstPAS = this._pasMessage.Elements[0] as PAS;
|
||||||
|
if (this._pasMessage.Elements.Count == 1)
|
||||||
|
{
|
||||||
|
firstPAS.NotificationSchengen = true;
|
||||||
|
this.checkBoxPasNotificationSchengen.IsChecked = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 1; i < this._pasMessage.Elements.Count; i++)
|
||||||
|
{
|
||||||
|
((PAS)this._pasMessage.Elements[i]).NotificationSchengen = firstPAS.NotificationSchengen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
461
ENI2/SheetDisplayControls/PortControl.xaml
Normal file
461
ENI2/SheetDisplayControls/PortControl.xaml
Normal file
@ -0,0 +1,461 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.PortControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1050" d:DesignWidth="800">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<col:ArrayList x:Key="arrList">
|
||||||
|
<col:DictionaryEntry Key="None" Value="0" />
|
||||||
|
<col:DictionaryEntry Key="Maersk BHV" Value="1" />
|
||||||
|
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
|
||||||
|
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
|
||||||
|
<col:DictionaryEntry Key="Hoegh BHV" Value="8" />
|
||||||
|
<col:DictionaryEntry Key="Elbe Bulk" Value="16" />
|
||||||
|
<col:DictionaryEntry Key="Fct Junge" Value="32" />
|
||||||
|
</col:ArrayList>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.text2PortCall}">
|
||||||
|
<TabControl x:Name="mainTabControl">
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab21}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="120" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text21ReferenceNumbers}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textVisitTransitId}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxDisplayId" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1" IsReadOnly="True" Margin="2" VerticalContentAlignment="Center" />
|
||||||
|
<Label HorizontalAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="1" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text22PortOperations}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<GroupBox Grid.Row="4" Grid.ColumnSpan="3" Name="groupBoxCallPurpose" Header="{x:Static p:Resources.textCallPurposes}" >
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridCallPurposes" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding CallPurposeCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding CallPurposeDescription, Mode=TwoWay}" IsReadOnly="True" Width="0.9*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</GroupBox>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<Grid Grid.Row="5" Grid.Column="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width=".7*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ComboBox Grid.Row="0" Grid.Column="0" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
<Button Grid.Row="0" Grid.Column="1" x:Name="buttonSearchPortArea" Margin="2" Content="Lookup port area" Click="buttonSearchPortArea_Click" />
|
||||||
|
</Grid>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Grid.Row="6" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Grid.Row="7" Grid.Column="1" Grid.RowSpan="1" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Grid.Row="8" Grid.Column="1" Grid.RowSpan="1" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="9" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="9" Margin="2,2,2,2" VerticalContentAlignment="Center" MaxLength="99"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="10" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="10" Margin="2,2,2,2" MaxLength="255" />
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab22}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="120"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<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="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text23Agency}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textAgentTemplate}" Name="labelAgentTemplate" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textCompanyName}" Name="label_AgentCompanyName" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textStreetNumber}" Name="label_AgentStreetAndNumber" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textPostalCode}" Name="label_AgentPostalCode" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textCity}" Name="label_AgentCity" Margin="0,0,10,0" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textCountry}" Name="label_AgentCountry" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" Name="label_AgentPhone" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textFax}" Name="label_AgentFax" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" Name="label_AgentEMail" Margin="0,0,10,0" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="11" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" Name="label_AgentLastName" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" Name="label_AgentFirstName" Margin="0,0,10,0"/>
|
||||||
|
|
||||||
|
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBox_AgentTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="AgentTitle" SelectionChanged="comboBox_AgentTemplate_SelectionChanged" />
|
||||||
|
<Grid Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="26" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Name="buttonSetTemplate" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Apply template" HorizontalContentAlignment="Right" IsEnabled="False">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="2" Grid.Column="1" Name="gridTemplateControls" Visibility="Visible">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<!-- Name -->
|
||||||
|
<ColumnDefinition Width="26"/>
|
||||||
|
<!-- Save button -->
|
||||||
|
<ColumnDefinition Width="26"/>
|
||||||
|
<!-- Delete button -->
|
||||||
|
<ColumnDefinition Width="52"/>
|
||||||
|
<!-- Undo button -->
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox Grid.Column="0" Margin="2" Name="textBoxTemplateTitle" VerticalContentAlignment="Center"/>
|
||||||
|
<Button Name="buttonSaveTemplate" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSaveTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/floppy_disk_blue.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Name="buttonDeleteTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonDeleteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Name="buttonUndoTemplate" Grid.Column="3" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="99" Margin="2" Text="{Binding AgentCompanyName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="4" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="99" Margin="2" Text="{Binding AgentStreetAndNumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="99" Margin="2" Text="{Binding AgentPostalCode, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="6" Grid.Column="1" Name="textBox_AgentCity" MaxLength="99" Margin="2" Text="{Binding AgentCity, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="7" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="99" Margin="2" Text="{Binding AgentCountry, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||||
|
<TextBox Grid.Row="8" Grid.Column="1" Name="textBox_AgentPhone" MaxLength="99" Margin="2" Text="{Binding AgentPhone, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="9" Grid.Column="1" Name="textBox_AgentFax" MaxLength="99" Margin="2" Text="{Binding AgentFax, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="10" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="99" Margin="2" Text="{Binding AgentEMail, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="11" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="99" Margin="2" Text="{Binding AgentLastName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="12" Grid.Column="1" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text24Invoice}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Grid.Row="14" Grid.Column="1" x:Name="comboBoxGroup" Margin="2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textServiceName}" Binding="{Binding ServiceName, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textServiceBeneficiary}" Binding="{Binding ServiceBeneficiary, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</GroupBox>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab23}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="180" />
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text25CargeOnBoard}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textGeneralCargoDescription}" Name="label_GeneralCargoDescription" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="1" Grid.Column="1" IsEditable="False" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo, Converter={util:ByteConverter}}" Margin="2" IsTextSearchEnabled="True"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Grid.Row="2" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2,2,2,2"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textTanker}" VerticalContentAlignment="Center" Margin="0,0,10,0" />
|
||||||
|
<CheckBox Grid.Row="3" Grid.Column="1" Name="checkBoxTanker" VerticalContentAlignment="Center" IsChecked="{Binding Tanker, Mode=TwoWay}" Margin="2,2,2,2" />
|
||||||
|
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Grid.Row="4" 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="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="5" 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="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DoubleUpDown Grid.Row="6" 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"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text26CargoPort}" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3"/>
|
||||||
|
<GroupBox Name="ladgGroupBox" Header="{x:Static p:Resources.textLadg}" Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoHandlingType}" Binding="{Binding CargoHandlingTypeDisplay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
<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.textCargoCodeNST3}" Binding="{Binding CargoCodeNST_3, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCargoNumberOfItems}" IsReadOnly="False" 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.textCargoPortOfDischarge}" Binding="{Binding PortOfDischarge, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab24}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="320"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="56" />
|
||||||
|
<RowDefinition Height="56" />
|
||||||
|
<RowDefinition Height="530" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text27Waste}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_AccurateDetailsGiven" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textLastPortWasteDischarge}" Name="label_WasteLastPortDischarged" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteDateLastDisposal}" Name="label_DateOfLastDisposal" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textWasteDisposalServiceProviders}" Name="label_WasteDisposalServiceProviders" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
|
<DatePicker Grid.Row="4" 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>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
|
<TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="1" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText, Converter={util:TrimStringConverter}}" Margin="2" />
|
||||||
|
<Label Grid.Row="6" Grid.Column="0" HorizontalContentAlignment="Right" Content="{x:Static p:Resources.textAgentTemplate}" Margin="0,0,10,0" />
|
||||||
|
<Grid Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" x:Name="gridWasteControls">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width=".25*" />
|
||||||
|
<ColumnDefinition Width=".25*" />
|
||||||
|
<ColumnDefinition Width=".25*" />
|
||||||
|
<ColumnDefinition Width=".25*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<ComboBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="comboBox_WSDPTemplate" Margin="2" SelectedValuePath="Id" DisplayMemberPath="Remark" SelectionChanged="comboBox_WSDPTemplate_SelectionChanged" />
|
||||||
|
<Grid Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Name="gridWasteTemplateControls" Visibility="Visible">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<!-- Name -->
|
||||||
|
<ColumnDefinition Width="26"/>
|
||||||
|
<!-- Save button -->
|
||||||
|
<ColumnDefinition Width="26"/>
|
||||||
|
<!-- Delete button -->
|
||||||
|
<ColumnDefinition Width="52"/>
|
||||||
|
<!-- Undo button -->
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox Grid.Column="0" Margin="2" Name="textBoxWasteTemplateTitle" VerticalContentAlignment="Center"/>
|
||||||
|
<Button Name="buttonSaveWasteTemplate" Grid.Column="1" Grid.Row="0" Margin="2" Click="buttonSaveWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Save template">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/floppy_disk_blue.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Name="buttonDeleteWasteTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonDeleteWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Name="buttonUndoWasteTemplate" Grid.Column="3" Grid.Row="0" Margin="22,2,2,2" Click="buttonUndoWasteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Undo last overwrite" IsEnabled="False">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Image Source="../Resources/undo.png" Margin="0,0,0,0" Height="20" Width="20" />
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
|
||||||
|
<Button Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1" Name="buttonImportFromExcel" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Click="buttonImportFromExcel_Click" />
|
||||||
|
</Grid>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridWaste" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="7" Grid.ColumnSpan="3" CanUserAddRows="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<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.textDescription}" Binding="{Binding WasteDescription}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteAmountToBeDisposed}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteDisposalAmount_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteMaxCapacity}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteCapacity_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteRetained}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteAmountRetained_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWastePortOfDelivery}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteDisposalPort}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteGeneratedUntilNextPort}" FontSize="9"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteAmountGeneratedTillNextPort_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textNextWasteDisposalPort}" Name="label_NextWasteDisposalPort" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl Grid.Row="8" Grid.Column="1" x:Name="locodeCtrlNextWastePort" LocodeValue="{Binding NextWasteDisposalPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
|
<!--
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text28Store}" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="2"/>
|
||||||
|
<GroupBox Name="storeGroupBox" Header="{x:Static p:Resources.textStore}" Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2">
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridSTO" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding Name}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantity}" IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTextColumn.Binding>
|
||||||
|
<Binding Path="Quantity" Mode="TwoWay" StringFormat="N3">
|
||||||
|
<Binding.ValidationRules>
|
||||||
|
<util:NumberValidationRule MaxValue="1000000" MinValue="0" />
|
||||||
|
</Binding.ValidationRules>
|
||||||
|
</Binding>
|
||||||
|
</DataGridTextColumn.Binding>
|
||||||
|
</DataGridTextColumn>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textQuantityUnit}" Binding="{Binding QuantityUnit, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLocationOnBoard}" Binding="{Binding LocationOnBoard, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textOfficialUse}" Binding="{Binding OfficialUse, Mode=TwoWay}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text29CrewEffects}" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<GroupBox Name="effectsGroupBox" Header="{x:Static p:Resources.textEffects}" Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2">
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridEffects" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textEffects}" Binding="{Binding Effects}" IsReadOnly="True" Width="0.15*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</GroupBox>
|
||||||
|
-->
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
1153
ENI2/SheetDisplayControls/PortControl.xaml.cs
Normal file
1153
ENI2/SheetDisplayControls/PortControl.xaml.cs
Normal file
File diff suppressed because it is too large
Load Diff
125
ENI2/SheetDisplayControls/PreArrivalControl.xaml
Normal file
125
ENI2/SheetDisplayControls/PreArrivalControl.xaml
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.PreArrivalControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="850" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="preArrivalGroupBox" Header="{x:Static p:Resources.text3PreArrival}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="240"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text31General}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Grid.Row="1" Content="{x:Static p:Resources.textDraughtOnArrivalLabel}" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding DraughtUponArrival_DMT, Mode=TwoWay}" TextAlignment="Left"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textCurrentShipSecLevel}" Name="label_CurrentShipSecLevel" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="2" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textAnchored}" Name="label_IsAnchored" Margin="0,0,10,0" />
|
||||||
|
<CheckBox Grid.Column="1" Grid.Row="3" IsThreeState="False" VerticalContentAlignment="Center" Name="checkBox_IsAnchored" IsChecked="{Binding IsAnchored}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textAreMatterToReport}" Name="label_AreMatterToReport" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Grid.Column="1" Grid.Row="4" IsThreeState="False" VerticalContentAlignment="Center" Name="checkBox_AreMatterToReport" IsChecked="{Binding AreMatterToReport}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textMatterToReport}" Name="label_MatterToReport" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxMatterToReport" Grid.Row="5" Grid.Column="1" MaxLength="1024" Text="{Binding MatterToReport, Converter={util:TrimStringConverter}}" IsEnabled="{Binding ElementName=checkBox_AreMatterToReport, Path=IsChecked}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text32PersonsOnBoard}" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPersonsOnBoard}" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalPersonsOnBoardUponArrival, Mode=TwoWay}" Grid.Row="7" Grid.Column="1" Name="integerUpDownPersonsOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textCrewMemberOnBoard}" Grid.Column="0" Grid.Row="8" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalCrewMembersOnBoardUponArrival, Mode=TwoWay}" Grid.Row="8" Grid.Column="1" Name="integerUpDownCrewMemberOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPassengersOnBoard}" Grid.Column="0" Grid.Row="9" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalPassengersOnBoardUponArrival, Mode=TwoWay}" Grid.Row="9" Grid.Column="1" Name="integerUpDownPassengersOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textStowawaysOnBoard}" Grid.Column="0" Grid.Row="10" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalStowawaysOnBoardUponArrival, Mode=TwoWay}" Grid.Row="10" Grid.Column="1" Name="integerUpDownStowawaysOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text33BunkerOnArrival}" Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="3"/>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridBKRA" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="12" Grid.ColumnSpan="3"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Width="0.2*">
|
||||||
|
<DataGridTextColumn.Binding>
|
||||||
|
<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>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text34DangerousCargo}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="14" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxDangerousGoodsOnBoard" IsChecked="{Binding NoDPGOnBoardOnArrival, Converter={util:InverseBooleanConverter}}" Grid.Row="14" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text36TowOnArrival}" Grid.Column="0" Grid.Row="15" Grid.ColumnSpan="3"/>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridTowageOnArrival" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnArrivalName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPurposeOfCall}" Binding="{Binding TowageOnArrivalPurposeOfCall}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnArrivalFlag}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDraughtInDecimetre}" Binding="{Binding TowageOnArrivalDraught_DMT, StringFormat={}{0:N1}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGrossTonnage}" Binding="{Binding TowageOnArrivalGrossTonnage}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLengthOverAll}" Binding="{Binding TowageOnArrivalLengthOverall_MTR, StringFormat={}{0:N2}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textBeamOverAll}" Binding="{Binding TowageOnArrivalBeam_MTR, StringFormat={}{0:N2}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding TowageOnArrivalRemarks}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCompanyName}" Binding="{Binding TowageOnArrivalOperatorCompanyName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStreetNumber}" Binding="{Binding TowageOnArrivalOperatorStreetNameAndNumber}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPostalCode}" Binding="{Binding TowageOnArrivalOperatorPostalCode}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCity}" Binding="{Binding TowageOnArrivalOperatorCity}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCountry}" Binding="{Binding TowageOnArrivalOperatorCountry}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding TowageOnArrivalOperatorEmail}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPhone}" Binding="{Binding TowageOnArrivalOperatorPhone}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFax}" Binding="{Binding TowageOnArrivalOperatorFax}" IsReadOnly="True" Width="Auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
369
ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs
Normal file
369
ENI2/SheetDisplayControls/PreArrivalControl.xaml.cs
Normal file
@ -0,0 +1,369 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 3. Pre-Arrival
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for PreArrivalControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class PreArrivalControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private TIEFA _tiefa;
|
||||||
|
private SEC _sec;
|
||||||
|
private NOA_NOD _noa_nod;
|
||||||
|
private POBA _poba;
|
||||||
|
private Message _brkaMessage;
|
||||||
|
private Message _brkdMessage;
|
||||||
|
private HAZ _haz;
|
||||||
|
private Message _towaMessage;
|
||||||
|
private Message _towdMessage;
|
||||||
|
|
||||||
|
private bool _ctxInitialized = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public PreArrivalControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += PreArrivalControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
base.Initialize();
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFA) { this._tiefa = aMessage.Elements[0] as TIEFA; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) { this._sec = aMessage.Elements[0] as SEC; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD) { this._noa_nod = aMessage.Elements[0] as NOA_NOD; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBA) { this._poba = aMessage.Elements[0] as POBA; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRA) { this._brkaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._brkdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) { this._haz = aMessage.Elements[0] as HAZ; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWA) { this._towaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) { this._towdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3.1
|
||||||
|
this.doubleUpDownDraught.DataContext = this._tiefa;
|
||||||
|
this.comboBoxCurrentShipSecurityLevel.ItemsSource = Util.GlobalStructures.ShipSecurityLevels;
|
||||||
|
this.comboBoxCurrentShipSecurityLevel.DataContext = this._sec;
|
||||||
|
this.checkBox_IsAnchored.DataContext = this._noa_nod;
|
||||||
|
this.checkBox_AreMatterToReport.DataContext = this._sec;
|
||||||
|
this.textBoxMatterToReport.DataContext = this._sec;
|
||||||
|
|
||||||
|
// 3.2
|
||||||
|
this.integerUpDownPersonsOnBoard.DataContext = this._poba;
|
||||||
|
this.integerUpDownCrewMemberOnBoard.DataContext = this._poba;
|
||||||
|
this.integerUpDownPassengersOnBoard.DataContext = this._poba;
|
||||||
|
this.integerUpDownStowawaysOnBoard.DataContext = this._poba;
|
||||||
|
|
||||||
|
// 3.3
|
||||||
|
this.dataGridBKRA.Initialize();
|
||||||
|
this.dataGridBKRA.ItemsSource = this._brkaMessage.Elements;
|
||||||
|
this.dataGridBKRA.AddingNewItem += DataGridBKRA_AddingNewItem;
|
||||||
|
this.dataGridBKRA.EditRequested += DataGridBKRA_EditRequested;
|
||||||
|
this.dataGridBKRA.DeleteRequested += DataGridBKRA_DeleteRequested;
|
||||||
|
this.dataGridBKRA.CreateRequested += DataGridBKRA_CreateRequested;
|
||||||
|
|
||||||
|
// 3.4
|
||||||
|
this.checkBoxDangerousGoodsOnBoard.DataContext = this._haz;
|
||||||
|
|
||||||
|
// 3.5
|
||||||
|
if (this._towaMessage == null)
|
||||||
|
{
|
||||||
|
this._towaMessage = this.Core.CreateMessage(Message.NotificationClass.TOWA);
|
||||||
|
this.Messages.Add(this._towaMessage);
|
||||||
|
}
|
||||||
|
this.dataGridTowageOnArrival.Initialize();
|
||||||
|
this.dataGridTowageOnArrival.ItemsSource = this._towaMessage.Elements;
|
||||||
|
this.dataGridTowageOnArrival.AddingNewItem += DataGridTowageOnArrival_AddingNewItem;
|
||||||
|
this.dataGridTowageOnArrival.EditRequested += DataGridTowageOnArrival_EditRequested;
|
||||||
|
this.dataGridTowageOnArrival.DeleteRequested += DataGridTowageOnArrival_DeleteRequested;
|
||||||
|
this.dataGridTowageOnArrival.CreateRequested += DataGridTowageOnArrival_CreateRequested;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.preArrivalGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void PreArrivalControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// 3.1
|
||||||
|
this.RegisterDoubleUpDownChange(this.doubleUpDownDraught, Message.NotificationClass.TIEFA);
|
||||||
|
this.RegisterComboboxIndexChange(this.comboBoxCurrentShipSecurityLevel, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterCheckboxChange(this.checkBox_IsAnchored, Message.NotificationClass.NOA_NOD);
|
||||||
|
this.RegisterCheckboxChange(this.checkBox_AreMatterToReport, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxMatterToReport, Message.NotificationClass.SEC);
|
||||||
|
|
||||||
|
// 3.2
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownCrewMemberOnBoard, Message.NotificationClass.POBA);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBA);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBA);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBA);
|
||||||
|
|
||||||
|
// 3.3
|
||||||
|
this.dataGridBKRA.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.BKRA); };
|
||||||
|
|
||||||
|
// Extra Menüpunkt um alle Bunker Positionen nach BKRD zu kopieren
|
||||||
|
|
||||||
|
if (!_ctxInitialized)
|
||||||
|
{
|
||||||
|
this.dataGridBKRA.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyBKRItem = new MenuItem();
|
||||||
|
copyBKRItem.Header = Properties.Resources.textCopyToBKRD;
|
||||||
|
copyBKRItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyBKRItem.Click += this.copyBKR;
|
||||||
|
this.dataGridBKRA.ContextMenu.Items.Add(copyBKRItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3.4
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, Message.NotificationClass.HAZA);
|
||||||
|
|
||||||
|
// 3.5
|
||||||
|
|
||||||
|
if (!_ctxInitialized)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.dataGridTowageOnArrival.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyItem = new MenuItem();
|
||||||
|
copyItem.Header = string.Format(Properties.Resources.textCopyTo, "TOWD");
|
||||||
|
copyItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyItem.Click += new RoutedEventHandler(this.copyTOWAItem);
|
||||||
|
this.dataGridTowageOnArrival.ContextMenu.Items.Add(copyItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ctxInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyBKR(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridBKRA.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (BRKA brka in this.dataGridBKRA.SelectedItems)
|
||||||
|
{
|
||||||
|
BRKD copyBRKD = new BRKD();
|
||||||
|
copyBRKD.MessageHeader = this._brkdMessage;
|
||||||
|
copyBRKD.CopyFromBKRA(brka);
|
||||||
|
copyBRKD.Identifier = DatabaseEntity.GetNewIdentifier(this._brkdMessage.Elements);
|
||||||
|
this._brkdMessage.Elements.Add(copyBRKD);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyTOWAItem(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// aus dem aktuell selektierten TOWA Element ein neues TOWD Element machen
|
||||||
|
if (this.dataGridTowageOnArrival.SelectedItems != null)
|
||||||
|
{
|
||||||
|
foreach (TOWA selectedTOWA in this.dataGridTowageOnArrival.SelectedItems)
|
||||||
|
{
|
||||||
|
TOWD copyTOWD = new TOWD();
|
||||||
|
copyTOWD.MessageHeader = _towdMessage;
|
||||||
|
copyTOWD.CopyFromTOWA(selectedTOWA);
|
||||||
|
copyTOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
|
||||||
|
this._towdMessage.Elements.Add(copyTOWD);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BKRA grid events
|
||||||
|
|
||||||
|
private void DataGridBKRA_CreateRequested()
|
||||||
|
{
|
||||||
|
this.dataGridBKRA.CancelEdit();
|
||||||
|
this.dataGridBKRA.CancelEdit();
|
||||||
|
EditBKRDialog ebd = new EditBKRDialog();
|
||||||
|
ebd.BRKA = new BRKA();
|
||||||
|
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._brkaMessage.Elements);
|
||||||
|
ebd.BRKA.MessageHeader = _brkaMessage;
|
||||||
|
ebd.IsDeparture = false;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!this._brkaMessage.Elements.Contains(ebd.BRKA))
|
||||||
|
this._brkaMessage.Elements.Add(ebd.BRKA);
|
||||||
|
this.dataGridBKRA.Items.Refresh();
|
||||||
|
|
||||||
|
ebd.BRKA = new BRKA();
|
||||||
|
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._brkaMessage.Elements);
|
||||||
|
ebd.BRKA.MessageHeader = _brkaMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_brkaMessage.Elements.Contains(ebd.BRKA))
|
||||||
|
_brkaMessage.Elements.Add(ebd.BRKA);
|
||||||
|
this.dataGridBKRA.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridBKRA_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is BRKA brka)
|
||||||
|
{
|
||||||
|
this.dataGridBKRA.CancelEdit();
|
||||||
|
this.dataGridBKRA.CancelEdit();
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brka);
|
||||||
|
this._brkaMessage.Elements.Remove(brka);
|
||||||
|
DatabaseEntity.ResetIdentifiers(this._brkaMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
this.dataGridBKRA.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
eld.IsDeparture = false;
|
||||||
|
eld.BRKA = obj as BRKA;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!_brkaMessage.Elements.Contains(eld.BRKA))
|
||||||
|
_brkaMessage.Elements.Add(eld.BRKA);
|
||||||
|
this.dataGridBKRA.ItemsSource = null;
|
||||||
|
this.dataGridBKRA.ItemsSource = this._brkaMessage.Elements;
|
||||||
|
eld.BRKA = new BRKA();
|
||||||
|
eld.BRKA.Identifier = BRKA.GetNewIdentifier(this._brkaMessage.Elements);
|
||||||
|
eld.BRKA.MessageHeader = _brkaMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_brkaMessage.Elements.Contains(eld.BRKA))
|
||||||
|
_brkaMessage.Elements.Add(eld.BRKA);
|
||||||
|
this.dataGridBKRA.ItemsSource = null;
|
||||||
|
this.dataGridBKRA.ItemsSource = this._brkaMessage.Elements;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridBKRA_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridBKRA_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region TOWA grid
|
||||||
|
|
||||||
|
private void DataGridTowageOnArrival_CreateRequested()
|
||||||
|
{
|
||||||
|
EditTOWDialog ebd = new EditTOWDialog();
|
||||||
|
ebd.IsDeparture = false;
|
||||||
|
ebd.TOWA = new TOWA();
|
||||||
|
ebd.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
|
||||||
|
ebd.TOWA.MessageHeader = this._towaMessage;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!this._towaMessage.Elements.Contains(ebd.TOWA))
|
||||||
|
this._towaMessage.Elements.Add(ebd.TOWA);
|
||||||
|
this.dataGridTowageOnArrival.Items.Refresh();
|
||||||
|
ebd.TOWA = new TOWA();
|
||||||
|
ebd.TOWA.MessageHeader = _towaMessage;
|
||||||
|
ebd.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._towaMessage.Elements.Contains(ebd.TOWA))
|
||||||
|
_towaMessage.Elements.Add(ebd.TOWA);
|
||||||
|
this.dataGridTowageOnArrival.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is TOWA towa)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
this._towaMessage.Elements.Remove(towa);
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(towa);
|
||||||
|
DatabaseEntity.ResetIdentifiers(this._towaMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
this.dataGridTowageOnArrival.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnArrival_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditTOWDialog eld = new EditTOWDialog();
|
||||||
|
eld.IsDeparture = false;
|
||||||
|
eld.TOWA = obj as TOWA;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!_towaMessage.Elements.Contains(eld.TOWA))
|
||||||
|
_towaMessage.Elements.Add(eld.TOWA);
|
||||||
|
this.dataGridTowageOnArrival.Items.Refresh();
|
||||||
|
|
||||||
|
eld.TOWA = new TOWA();
|
||||||
|
eld.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
|
||||||
|
eld.TOWA.MessageHeader = _towaMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._towaMessage.Elements.Contains(eld.TOWA))
|
||||||
|
this._towaMessage.Elements.Add(eld.TOWA);
|
||||||
|
this.dataGridTowageOnArrival.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnArrival_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridTowageOnArrival_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
117
ENI2/SheetDisplayControls/PreDepartureControl.xaml
Normal file
117
ENI2/SheetDisplayControls/PreDepartureControl.xaml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.PreDepartureControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="850" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="preDepartureGroupBox" Header="{x:Static p:Resources.text4PreDeparture}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="220"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
<RowDefinition Height="1" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="140" />
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text41General}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Grid.Row="1" Content="{x:Static p:Resources.textDraughtOnDepartureLabel}" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding DraughtUponDeparture_DMT, Mode=TwoWay}" TextAlignment="Left"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text42PersonsOnBoard}" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPersonsOnBoard}" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalPersonsOnBoardUponDeparture, Mode=TwoWay}" Grid.Row="7" Grid.Column="1" Name="integerUpDownPersonsOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textCrewMemberOnBoard}" Grid.Column="0" Grid.Row="8" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalCrewMembersOnBoardUponDeparture, Mode=TwoWay}" Grid.Row="8" Grid.Column="1" Name="integerUpDownCrewMemberOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPassengersOnBoard}" Grid.Column="0" Grid.Row="9" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalPassengersOnBoardUponDeparture, Mode=TwoWay}" Grid.Row="9" Grid.Column="1" Name="integerUpDownPassengersOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textStowawaysOnBoard}" Grid.Column="0" Grid.Row="10" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Value="{Binding TotalStowawaysOnBoardUponDeparture, Mode=TwoWay}" Grid.Row="10" Grid.Column="1" Name="integerUpDownStowawaysOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text43BunkerOnDeparture}" Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="3"/>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridBKRD" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="12" Grid.ColumnSpan="3"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Width="0.2*">
|
||||||
|
<DataGridTextColumn.Binding>
|
||||||
|
<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>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text44DangerousCargo}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textDangerousGoodsOnBoard}" Grid.Column="0" Grid.Row="14" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxDangerousGoodsOnBoard" IsChecked="{Binding NoDPGOnBoardOnArrival, Converter={util:InverseBooleanConverter}}" Grid.Row="14" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text45TowOnDeparture}" Grid.Column="0" Grid.Row="15" Grid.ColumnSpan="3"/>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridTowageOnDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnDepartureName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPurposeOfCall}" Binding="{Binding TowageOnDeparturePurposeOfCall}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnDepartureFlag}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDraughtInDecimetre}" Binding="{Binding TowageOnDepartureDraught_DMT, StringFormat={}{0:N1}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textGrossTonnage}" Binding="{Binding TowageOnDepartureGrossTonnage}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLengthOverAll}" Binding="{Binding TowageOnDepartureLengthOverall_MTR, StringFormat={}{0:N2}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textBeamOverAll}" Binding="{Binding TowageOnDepartureBeam_MTR, StringFormat={}{0:N2}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding TowageOnDepartureRemarks}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCompanyName}" Binding="{Binding TowageOnDepartureOperatorCompanyName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textStreetNumber}" Binding="{Binding TowageOnDepartureOperatorStreetNameAndNumber}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPostalCode}" Binding="{Binding TowageOnDepartureOperatorPostalCode}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCity}" Binding="{Binding TowageOnDepartureOperatorCity}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCountry}" Binding="{Binding TowageOnDepartureOperatorCountry}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding TowageOnDepartureOperatorEmail}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPhone}" Binding="{Binding TowageOnDepartureOperatorPhone}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textFax}" Binding="{Binding TowageOnDepartureOperatorFax}" IsReadOnly="True" Width="Auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
356
ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs
Normal file
356
ENI2/SheetDisplayControls/PreDepartureControl.xaml.cs
Normal file
@ -0,0 +1,356 @@
|
|||||||
|
// Copyright (c) 2025 - schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 4. Pre-Departure
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for PreDepartureControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class PreDepartureControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private TIEFD _tiefd;
|
||||||
|
private POBD _pobd;
|
||||||
|
private Message _brkaMessage;
|
||||||
|
private Message _brkdMessage;
|
||||||
|
private HAZ _haz;
|
||||||
|
private Message _towaMessage;
|
||||||
|
private Message _towdMessage;
|
||||||
|
|
||||||
|
private bool _ctxInitialized = false;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public PreDepartureControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += PreDepartureControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
base.Initialize();
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFD) { this._tiefd = aMessage.Elements[0] as TIEFD; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBD) { this._pobd = aMessage.Elements[0] as POBD; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRA) { this._brkaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) { this._brkdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) { this._haz = aMessage.Elements[0] as HAZ; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWA) { this._towaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) { this._towdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4.1
|
||||||
|
this.doubleUpDownDraught.DataContext = this._tiefd;
|
||||||
|
|
||||||
|
// 4.2
|
||||||
|
this.integerUpDownPersonsOnBoard.DataContext = this._pobd;
|
||||||
|
this.integerUpDownCrewMemberOnBoard.DataContext = this._pobd;
|
||||||
|
this.integerUpDownPassengersOnBoard.DataContext = this._pobd;
|
||||||
|
this.integerUpDownStowawaysOnBoard.DataContext = this._pobd;
|
||||||
|
|
||||||
|
// 4.3
|
||||||
|
this.dataGridBKRD.Initialize();
|
||||||
|
this.dataGridBKRD.ItemsSource = this._brkdMessage.Elements;
|
||||||
|
this.dataGridBKRD.AddingNewItem += DataGridBKRD_AddingNewItem;
|
||||||
|
this.dataGridBKRD.EditRequested += DataGridBKRD_EditRequested;
|
||||||
|
this.dataGridBKRD.DeleteRequested += DataGridBKRD_DeleteRequested;
|
||||||
|
this.dataGridBKRD.CreateRequested += DataGridBKRD_CreateRequested;
|
||||||
|
|
||||||
|
// 4.4
|
||||||
|
this.checkBoxDangerousGoodsOnBoard.DataContext = this._haz;
|
||||||
|
|
||||||
|
// 4.5
|
||||||
|
if (this._towdMessage == null)
|
||||||
|
{
|
||||||
|
this._towdMessage = this.Core.CreateMessage(Message.NotificationClass.TOWD);
|
||||||
|
this.Messages.Add(this._towdMessage);
|
||||||
|
}
|
||||||
|
this.dataGridTowageOnDeparture.Initialize();
|
||||||
|
this.dataGridTowageOnDeparture.ItemsSource = this._towdMessage.Elements;
|
||||||
|
this.dataGridTowageOnDeparture.AddingNewItem += DataGridTowageOnDeparture_AddingNewItem;
|
||||||
|
this.dataGridTowageOnDeparture.EditRequested += DataGridTowageOnDeparture_EditRequested;
|
||||||
|
this.dataGridTowageOnDeparture.DeleteRequested += DataGridTowageOnDeparture_DeleteRequested;
|
||||||
|
this.dataGridTowageOnDeparture.CreateRequested += DataGridTowageOnDeparture_CreateRequested;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.preDepartureGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void PreDepartureControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// 4.1
|
||||||
|
this.RegisterDoubleUpDownChange(this.doubleUpDownDraught, Message.NotificationClass.TIEFA);
|
||||||
|
|
||||||
|
// 4.2
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownCrewMemberOnBoard, Message.NotificationClass.POBD);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBD);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBD);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBD);
|
||||||
|
|
||||||
|
// 4.3
|
||||||
|
this.dataGridBKRD.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.BKRD); };
|
||||||
|
|
||||||
|
// Extra Menüpunkt um alle Bunker Positionen nach BKRA zu kopieren
|
||||||
|
|
||||||
|
if (!_ctxInitialized)
|
||||||
|
{
|
||||||
|
this.dataGridBKRD.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem copyBKRItem = new MenuItem();
|
||||||
|
copyBKRItem.Header = Properties.Resources.textCopyToBKRD;
|
||||||
|
copyBKRItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/documents.png")) };
|
||||||
|
copyBKRItem.Click += this.copyBKR;
|
||||||
|
this.dataGridBKRD.ContextMenu.Items.Add(copyBKRItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4.4
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, Message.NotificationClass.HAZD);
|
||||||
|
|
||||||
|
// 4.5
|
||||||
|
|
||||||
|
if (!_ctxInitialized)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.dataGridTowageOnDeparture.ContextMenu.Items.Add(new Separator());
|
||||||
|
MenuItem 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.copyTOWAItem);
|
||||||
|
this.dataGridTowageOnDeparture.ContextMenu.Items.Add(copyItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
_ctxInitialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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._brkdMessage;
|
||||||
|
copyBRKA.CopyFromBKRD(brkd);
|
||||||
|
copyBRKA.Identifier = DatabaseEntity.GetNewIdentifier(this._brkaMessage.Elements);
|
||||||
|
this._brkaMessage.Elements.Add(copyBRKA);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void copyTOWAItem(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.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BKRD grid events
|
||||||
|
|
||||||
|
private void DataGridBKRD_CreateRequested()
|
||||||
|
{
|
||||||
|
this.dataGridBKRD.CancelEdit();
|
||||||
|
this.dataGridBKRD.CancelEdit();
|
||||||
|
EditBKRDialog ebd = new EditBKRDialog();
|
||||||
|
ebd.BRKD = new BRKD();
|
||||||
|
ebd.BRKD.Identifier = BRKD.GetNewIdentifier(this._brkdMessage.Elements);
|
||||||
|
ebd.BRKD.MessageHeader = _brkdMessage;
|
||||||
|
ebd.IsDeparture = true;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!this._brkdMessage.Elements.Contains(ebd.BRKD))
|
||||||
|
this._brkdMessage.Elements.Add(ebd.BRKD);
|
||||||
|
this.dataGridBKRD.Items.Refresh();
|
||||||
|
|
||||||
|
ebd.BRKD = new BRKD();
|
||||||
|
ebd.BRKD.Identifier = BRKD.GetNewIdentifier(this._brkdMessage.Elements);
|
||||||
|
ebd.BRKD.MessageHeader = _brkdMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_brkdMessage.Elements.Contains(ebd.BRKD))
|
||||||
|
_brkdMessage.Elements.Add(ebd.BRKD);
|
||||||
|
this.dataGridBKRD.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridBKRD_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is BRKD brkd)
|
||||||
|
{
|
||||||
|
this.dataGridBKRD.CancelEdit();
|
||||||
|
this.dataGridBKRD.CancelEdit();
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brkd);
|
||||||
|
this._brkdMessage.Elements.Remove(brkd);
|
||||||
|
DatabaseEntity.ResetIdentifiers(this._brkdMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
this.dataGridBKRD.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridBKRD_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.dataGridBKRD.CancelEdit(DataGridEditingUnit.Row);
|
||||||
|
this.dataGridBKRD.CommitEdit(DataGridEditingUnit.Row, true);
|
||||||
|
|
||||||
|
EditBKRDialog eld = new EditBKRDialog();
|
||||||
|
eld.IsDeparture = true;
|
||||||
|
eld.BRKD = obj as BRKD;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!_brkdMessage.Elements.Contains(eld.BRKD))
|
||||||
|
_brkdMessage.Elements.Add(eld.BRKD);
|
||||||
|
this.dataGridBKRD.ItemsSource = null;
|
||||||
|
this.dataGridBKRD.ItemsSource = this._brkdMessage.Elements;
|
||||||
|
eld.BRKD = new BRKD();
|
||||||
|
eld.BRKD.Identifier = BRKD.GetNewIdentifier(this._brkdMessage.Elements);
|
||||||
|
eld.BRKD.MessageHeader = _brkdMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_brkdMessage.Elements.Contains(eld.BRKD))
|
||||||
|
_brkdMessage.Elements.Add(eld.BRKD);
|
||||||
|
this.dataGridBKRD.ItemsSource = null;
|
||||||
|
this.dataGridBKRD.ItemsSource = this._brkaMessage.Elements;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.BKRD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridBKRD_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridBKRD_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region TOWD grid
|
||||||
|
|
||||||
|
private void DataGridTowageOnDeparture_CreateRequested()
|
||||||
|
{
|
||||||
|
EditTOWDialog ebd = new EditTOWDialog();
|
||||||
|
ebd.IsDeparture = true;
|
||||||
|
ebd.TOWD = new TOWD();
|
||||||
|
ebd.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
|
||||||
|
ebd.TOWD.MessageHeader = this._towdMessage;
|
||||||
|
|
||||||
|
ebd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ebd.CopyValuesToEntity();
|
||||||
|
if (!this._towdMessage.Elements.Contains(ebd.TOWD))
|
||||||
|
this._towdMessage.Elements.Add(ebd.TOWD);
|
||||||
|
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||||
|
ebd.TOWD = new TOWD();
|
||||||
|
ebd.TOWD.MessageHeader = _towdMessage;
|
||||||
|
ebd.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ebd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._towdMessage.Elements.Contains(ebd.TOWD))
|
||||||
|
_towdMessage.Elements.Add(ebd.TOWD);
|
||||||
|
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is TOWD towd)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
this._towdMessage.Elements.Remove(towd);
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(towd);
|
||||||
|
DatabaseEntity.ResetIdentifiers(this._towdMessage.Elements);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnDeparture_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditTOWDialog eld = new EditTOWDialog();
|
||||||
|
eld.IsDeparture = true;
|
||||||
|
eld.TOWD = obj as TOWD;
|
||||||
|
|
||||||
|
eld.AddClicked += () =>
|
||||||
|
{
|
||||||
|
eld.CopyValuesToEntity();
|
||||||
|
if (!_towdMessage.Elements.Contains(eld.TOWD))
|
||||||
|
_towdMessage.Elements.Add(eld.TOWD);
|
||||||
|
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||||
|
|
||||||
|
eld.TOWD = new TOWD();
|
||||||
|
eld.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
|
||||||
|
eld.TOWD.MessageHeader = _towdMessage;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eld.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._towdMessage.Elements.Contains(eld.TOWD))
|
||||||
|
this._towdMessage.Elements.Add(eld.TOWD);
|
||||||
|
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridTowageOnDeparture_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridTowageOnDeparture_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
228
ENI2/SheetDisplayControls/ShipDataControl.xaml
Normal file
228
ENI2/SheetDisplayControls/ShipDataControl.xaml
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.ShipDataControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1050" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.text3PreArrival}">
|
||||||
|
<TabControl x:Name="mainTabControl">
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab51}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width="25" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="8" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text51General}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textVesselName}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxVesselName" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="1" Text="{Binding ShipName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textVesselType}" Margin="0,0,10,0" />
|
||||||
|
<ComboBox Name="comboBoxVesselType" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="1" SelectedValue="{Binding ShipType}" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxIMO" Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Text="{Binding IMO, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" IsReadOnly="True" VerticalContentAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textFlag}" Margin="0,0,10,0" />
|
||||||
|
<ComboBox Name="comboBoxFlag" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="1" Margin="2" SelectedValue="{Binding Flag}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textPortOfRegistry}" Margin="0,0,10,0" />
|
||||||
|
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="1" LocodeValue="{Binding PortOfRegistry, Mode=TwoWay}" LocodeSource="NO_PORT_FLAG" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textCallsign}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxCallsign" Grid.Column="1" Grid.Row="6" Text="{Binding CallSign, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="7"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textMMSI}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxMMSI" Grid.Column="1" Grid.Row="7" Margin="2" Text="{Binding MMSINumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" MaxLength="10"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textLengthOverAll}" Margin="0,0,10,0" />
|
||||||
|
<xctk:DoubleUpDown Name="doubleUpDownLength" Grid.Column="1" Grid.Row="9" Margin="2" Value="{Binding LengthOverall_MTR}" ShowButtonSpinner="False" TextAlignment="Left" ParsingNumberStyle="Any" FormatString="N2" />
|
||||||
|
<Label Content="m" Grid.Column="2" Grid.Row="9" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textBeamOverAll}" Margin="0,0,10,0" />
|
||||||
|
<xctk:DoubleUpDown Name="doubleUpDownBeam" Grid.Column="1" Grid.Row="10" Margin="2" Value="{Binding Beam_MTR}" ShowButtonSpinner="False" TextAlignment="Left" ParsingNumberStyle="Any" FormatString="N2" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="11" Grid.Column="0" Content="{x:Static p:Resources.textGrossTonnage}" Margin="0,0,10,0" />
|
||||||
|
<xctk:IntegerUpDown Name="integerUpDownGrossTonnage" Grid.Column="1" Grid.Row="11" Margin="2" Value="{Binding GrossTonnage}" ShowButtonSpinner="False" TextAlignment="Left"/>
|
||||||
|
<Label Content="t" Grid.Column="2" Grid.Row="11" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textNetTonnage}" Margin="0,0,10,0" />
|
||||||
|
<xctk:IntegerUpDown Name="integerUpDownNetTonnage" Grid.Column="1" Grid.Row="12" Margin="2" Value="{Binding NetTonnage}" ShowButtonSpinner="False" TextAlignment="Left"/>
|
||||||
|
<Label Content="t" Grid.Column="2" Grid.Row="12" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="13" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DoubleUpDown Grid.Row="13" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
||||||
|
<Label Content="t" Grid.Column="2" Grid.Row="13" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="15" Grid.Column="0" Content="{x:Static p:Resources.textRegistryDate}" Margin="0,0,10,0" />
|
||||||
|
<DatePicker Name="datePickerRegistryDateOfIssue" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding RegistryDate, Mode=TwoWay}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
|
||||||
|
<DatePicker.BlackoutDates>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="16" Grid.Column="0" Content="{x:Static p:Resources.textCertificateOfRegistryNumber}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxCertificateRegistry" Grid.Column="1" Grid.Row="16" Margin="2" Text="{Binding CertificateOfRegistryNumber, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" MaxLength="35"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textLastExpandedInspection }" Grid.Column="0" Grid.Row="17" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<DatePicker Grid.Column="1" Grid.Row="17" 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>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
|
<Label Content="{x:Static p:Resources.textIsDueToInspection }" Grid.Column="0" Grid.Row="18" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxIsDueToInspection" IsChecked="{Binding IsDueToInspection}" Grid.Row="18" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textPossibleAnchorage }" Grid.Column="0" Grid.Row="19" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxPossibleAnchorage" IsChecked="{Binding IsDueToInspection}" Grid.Row="19" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="21" Grid.Column="0" Content="{x:Static p:Resources.textCompanyName}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxCompanyName" Grid.Row="21" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyName, Converter={util:TrimStringConverter}}" MaxLength="100" VerticalContentAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="22" Grid.Column="0" Content="{x:Static p:Resources.textCompanyId}" Margin="0,0,10,0" />
|
||||||
|
<TextBox Name="textBoxCompanyId" Grid.Row="22" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyId, Converter={util:TrimStringConverter}}" MaxLength="7" VerticalContentAlignment="Center"/>
|
||||||
|
<Label Grid.Row="24" Grid.Column="0" HorizontalAlignment="Right" Margin="10,0,0,0" Content="{x:Static p:Resources.textShipEmail}" VerticalContentAlignment="Center" />
|
||||||
|
<xctk:AutoSelectTextBox Grid.Row="24" Grid.Column="1" Margin="2" x:Name="shipEMailLabel" Text="{Binding HerbergEmailContactReportingVessel}" VerticalContentAlignment="Center" FontWeight="Normal" IsReadOnly="True" AutoSelectBehavior="OnFocus" />
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab52}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="290"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width="25" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<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" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text52SSCEC}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textMDHSimplification}" Name="label_MDHSimplificationAvailable" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkSimplification" IsChecked="{Binding MDHSimplification}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Checked="checkSimplification_Checked" Unchecked="checkSimplification_Checked"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textPortOfHealth}" Name="label_PortOfHealth" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl x:Name="locodePortWhereHealthDeclarationWasGiven" Grid.Row="2" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteMDHNotified, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkSimplification, Path=IsChecked}" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textSanitaryControlExemption}" Name="label_SanitaryControlExemption" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"
|
||||||
|
IsEnabled="{Binding ElementName=checkSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}" Checked="checkSimplification_Checked" Unchecked="checkSimplification_Checked"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textPlaceOfIssue}" Name="label_PlaceOfIssue" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="4" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue, Converter={util:TrimStringConverter}}" Margin="2" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textDateOfIssue}" Name="label_DateOfIssue" Margin="0,0,10,0"/>
|
||||||
|
<DatePicker Name="datePickerDateOfIssue" Grid.Row="5" Grid.Column="1" SelectedDate="{Binding DateOfIssue, Mode=TwoWay}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate" >
|
||||||
|
<DatePicker.BlackoutDates>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textReinspectionSanitaryControl}" Name="label_ReinspectionSanitaryControl" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxReinspectionSanitary" IsChecked="{Binding SanitaryControlReinspectionRequired}" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" IsEnabled="{Binding ElementName=checkSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text53ISPS}" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="2"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textSECSimplification}" Name="label_SimplificationAvailable" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxSECSimplification" IsChecked="{Binding SECSimplification}" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textPortWhereSimplWasGiven}" Name="label_PortWhereSimplWasGiven" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl x:Name="locodePortOfCallWhereCompleteSECNotified" Grid.Row="9" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteSECNotified, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" VerticalContentAlignment="Bottom" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textChiefSecurityOfficer}" Name="label_ChiefSecurityOfficer" Margin="0,0,10,0"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="11" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" Name="label_LastName" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxCSOLastName" Grid.Row="11" Grid.Column="1" MaxLength="100" Text="{Binding CSOLastName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" Name="label_FirstName" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxCSOFirstName" Grid.Row="12" Grid.Column="1" MaxLength="100" Text="{Binding CSOFirstName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="13" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" Name="label_Phone" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxCSOPhoneName" Grid.Row="13" Grid.Column="1" MaxLength="100" Text="{Binding CSOPhone, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" Name="label_EMail" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxCSOEMailName" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding CSOEMail, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="15" Grid.Column="0" Content="{x:Static p:Resources.textFax}" Name="label_Fax" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxCSOFaxName" Grid.Row="15" Grid.Column="1" MaxLength="100" Text="{Binding CSOFax, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="16" Grid.Column="0" Content="{x:Static p:Resources.textValidISSCOnBoard}" Name="label_ValidISSCOnBoard" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxValidISSCOnBoard" IsChecked="{Binding ValidISSCOnBoard}" Grid.Row="16" Grid.Column="1" VerticalAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="17" Grid.Column="0" Content="{x:Static p:Resources.textReasonForInvalidISSC}" Name="label_ReasonForInvalidISSC" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxReasonsForNoValidISSC" Grid.Row="17" Grid.Column="1" MaxLength="255" Text="{Binding ReasonsForNoValidISSC, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="18" Grid.Column="0" Content="{x:Static p:Resources.textISSCType}" Name="label_ISSCType" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Name="comboBoxISSCType" Grid.Row="18" Grid.Column="1" SelectedIndex="{Binding ISSCType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="19" Grid.Column="0" Content="{x:Static p:Resources.textISSCExpirationDate}" Name="label_ISSCExpirationDate" Margin="0,0,10,0"/>
|
||||||
|
<DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="19" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}">
|
||||||
|
<DatePicker.BlackoutDates>
|
||||||
|
<CalendarDateRange Start="1/1/0001" End="12/31/1799"/>
|
||||||
|
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
|
||||||
|
</DatePicker.BlackoutDates>
|
||||||
|
</DatePicker>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="20" Grid.Column="0" Content="{x:Static p:Resources.textISSCIssuerType}" Name="label_ISSCIssuerType" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Name="comboBoxISSCIssuerType" Grid.Row="20" Grid.Column="1" SelectedIndex="{Binding ISSCIssuerType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="21" Grid.Column="0" Content="{x:Static p:Resources.textISSCIssuerName}" Name="label_ISSCIssuerName" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxISSCIssuerName" Grid.Row="21" Grid.Column="1" MaxLength="100" Text="{Binding ISSCIssuerName, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="22" Grid.Column="0" Content="{x:Static p:Resources.textApprovedSecPlan}" Name="label_ApprovedSecPlan" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxApprovedSecurityPlanOnBoard" IsChecked="{Binding ApprovedSecurityPlanOnBoard}" Grid.Row="22" Grid.Column="1" VerticalAlignment="Center" IsEnabled="{Binding ElementName=checkBoxSECSimplification, Path=IsChecked, Converter={util:InverseBooleanConverter}}"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab53}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="200"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width="25" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text54TankerDetails}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textTanker}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxTanker" IsChecked="{Binding Tanker}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textTankerHullConfig}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxTankerHullConfig" Margin="2" SelectedIndex="{Binding TankerHullConfiguration, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
196
ENI2/SheetDisplayControls/ShipDataControl.xaml.cs
Normal file
196
ENI2/SheetDisplayControls/ShipDataControl.xaml.cs
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
// Copyright (c) 2025- schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 5. Ship data
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for ShipDataControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class ShipDataControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private INFO _info;
|
||||||
|
private PRE72H _pre72H;
|
||||||
|
private SEC _sec;
|
||||||
|
private MDH _mdh;
|
||||||
|
private STAT _stat;
|
||||||
|
|
||||||
|
private static readonly string[] isscTypes = { "Final", "Preliminary" };
|
||||||
|
|
||||||
|
private static readonly string[] isscIssuerTypes = { "Authority", "RSO (Recognized security org.)" };
|
||||||
|
|
||||||
|
private static readonly string[] hullConfiguration = {
|
||||||
|
Properties.Resources.textSingleHull,
|
||||||
|
Properties.Resources.textSingleHullBallast,
|
||||||
|
Properties.Resources.textDoubleHull
|
||||||
|
};
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public ShipDataControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += ShipDataControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.STAT) { this._stat = aMessage.Elements[0] as STAT; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) { this._sec = aMessage.Elements[0] as SEC; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._info = aMessage.Elements[0] as INFO; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.PRE72H) { this._pre72H = aMessage.Elements[0] as PRE72H; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.MDH) { this._mdh = aMessage.Elements[0] as MDH; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5.1
|
||||||
|
this.textBoxVesselName.DataContext = _stat;
|
||||||
|
this.textBoxIMO.DataContext = this.Core;
|
||||||
|
this.comboBoxVesselType.ItemsSource = STAT.VesselTypeDict;
|
||||||
|
this.comboBoxVesselType.DataContext = _stat;
|
||||||
|
this.comboBoxFlag.ItemsSource = CREW.NationalityDict;
|
||||||
|
this.comboBoxFlag.DataContext = _stat;
|
||||||
|
this.locodePortOfRegistry.DataContext = _stat;
|
||||||
|
this.textBoxCallsign.DataContext = _stat;
|
||||||
|
this.textBoxMMSI.DataContext = _stat;
|
||||||
|
|
||||||
|
this.doubleUpDownLength.DataContext = _stat;
|
||||||
|
this.doubleUpDownBeam.DataContext = _stat;
|
||||||
|
this.integerUpDownGrossTonnage.DataContext = _stat;
|
||||||
|
this.integerUpDownNetTonnage.DataContext = _stat;
|
||||||
|
this.doubleUpDownDisplacementSummerDraught.DataContext = _info;
|
||||||
|
|
||||||
|
this.datePickerRegistryDateOfIssue.DataContext = _stat;
|
||||||
|
this.textBoxCertificateRegistry.DataContext = _stat;
|
||||||
|
this.datePickerLastExpandedInspection.DataContext = _pre72H;
|
||||||
|
this.checkBoxIsDueToInspection.DataContext = _pre72H;
|
||||||
|
this.checkBoxPossibleAnchorage.DataContext = _pre72H;
|
||||||
|
|
||||||
|
this.textBoxCompanyName.DataContext = _stat;
|
||||||
|
this.textBoxCompanyId.DataContext = _stat;
|
||||||
|
this.shipEMailLabel.DataContext = this.Core;
|
||||||
|
|
||||||
|
// 5.2
|
||||||
|
this.checkSimplification.DataContext = _mdh;
|
||||||
|
this.locodePortWhereHealthDeclarationWasGiven.DataContext = _mdh;
|
||||||
|
this.checkBoxSanitaryControlExemption.DataContext = _mdh;
|
||||||
|
this.textBoxPlaceOfIssue.DataContext = _mdh;
|
||||||
|
this.datePickerDateOfIssue.DataContext = _mdh;
|
||||||
|
this.checkBoxReinspectionSanitary.DataContext = _mdh;
|
||||||
|
|
||||||
|
// 5.3
|
||||||
|
this.checkBoxSECSimplification.DataContext = _sec;
|
||||||
|
this.locodePortOfCallWhereCompleteSECNotified.DataContext = _sec;
|
||||||
|
this.textBoxCSOLastName.DataContext = _sec;
|
||||||
|
this.textBoxCSOFirstName.DataContext = _sec;
|
||||||
|
this.textBoxCSOPhoneName.DataContext = _sec;
|
||||||
|
this.textBoxCSOEMailName.DataContext = _sec;
|
||||||
|
this.textBoxCSOFaxName.DataContext = _sec;
|
||||||
|
this.checkBoxValidISSCOnBoard.DataContext = _sec;
|
||||||
|
this.textBoxReasonsForNoValidISSC.DataContext = _sec;
|
||||||
|
this.comboBoxISSCType.ItemsSource = isscTypes;
|
||||||
|
this.comboBoxISSCType.DataContext = _sec;
|
||||||
|
this.datePickerISSCDateOfExpiration.DataContext = _sec;
|
||||||
|
this.comboBoxISSCIssuerType.ItemsSource = isscIssuerTypes;
|
||||||
|
this.comboBoxISSCIssuerType.DataContext = _sec;
|
||||||
|
this.textBoxISSCIssuerName.DataContext = _sec;
|
||||||
|
this.checkBoxApprovedSecurityPlanOnBoard.DataContext = _sec;
|
||||||
|
|
||||||
|
// 5.4
|
||||||
|
this.checkBoxTanker.DataContext = _pre72H;
|
||||||
|
this.comboBoxTankerHullConfig.ItemsSource = hullConfiguration;
|
||||||
|
this.comboBoxTankerHullConfig.DataContext = _pre72H;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.shipDataGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int SelectedTabIndex
|
||||||
|
{
|
||||||
|
get { return this.mainTabControl.SelectedIndex; }
|
||||||
|
set { this.mainTabControl.SelectedIndex = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void ShipDataControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// 5.1
|
||||||
|
this.RegisterTextboxChange(this.textBoxVesselName, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterComboboxValueChange(this.comboBoxVesselType, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterComboboxValueChange(this.comboBoxFlag, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterLocodeChange(this.locodePortOfRegistry, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterLocodeChange(this.locodePortOfRegistry, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCallsign, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterTextboxChange(this.textBoxMMSI, Message.NotificationClass.STAT);
|
||||||
|
|
||||||
|
this.RegisterDoubleUpDownChange(this.doubleUpDownLength, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterDoubleUpDownChange(this.doubleUpDownBeam, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownGrossTonnage, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterIntegerUpDownChange(this.integerUpDownNetTonnage, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterDoubleUpDownChange(this.doubleUpDownDisplacementSummerDraught, Message.NotificationClass.INFO);
|
||||||
|
|
||||||
|
this.RegisterDatePickerChange(this.datePickerRegistryDateOfIssue, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCertificateRegistry, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterDatePickerChange(this.datePickerLastExpandedInspection, Message.NotificationClass.PRE72H);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxIsDueToInspection, Message.NotificationClass.PRE72H);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxPossibleAnchorage, Message.NotificationClass.PRE72H);
|
||||||
|
|
||||||
|
this.RegisterTextboxChange(this.textBoxCompanyName, Message.NotificationClass.STAT);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCompanyId, Message.NotificationClass.STAT);
|
||||||
|
|
||||||
|
// 5.2
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxSanitaryControlExemption, Message.NotificationClass.MDH);
|
||||||
|
this.RegisterTextboxChange(this.textBoxPlaceOfIssue, Message.NotificationClass.MDH);
|
||||||
|
this.RegisterDatePickerChange(this.datePickerDateOfIssue, Message.NotificationClass.MDH);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxReinspectionSanitary, Message.NotificationClass.MDH);
|
||||||
|
|
||||||
|
// 5.3
|
||||||
|
this.RegisterTextboxChange(this.textBoxCSOLastName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCSOFirstName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCSOPhoneName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCSOFaxName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxCSOEMailName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxValidISSCOnBoard, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxReasonsForNoValidISSC, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterComboboxIndexChange(this.comboBoxISSCType, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterDatePickerChange(this.datePickerISSCDateOfExpiration, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterComboboxIndexChange(this.comboBoxISSCIssuerType, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterTextboxChange(this.textBoxISSCIssuerName, Message.NotificationClass.SEC);
|
||||||
|
this.RegisterCheckboxChange(this.checkBoxApprovedSecurityPlanOnBoard, Message.NotificationClass.SEC);
|
||||||
|
|
||||||
|
// 5.4
|
||||||
|
this.RegisterComboboxIndexChange(this.comboBoxTankerHullConfig, Message.NotificationClass.PRE72H);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkSimplification_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.textBoxPlaceOfIssue.IsEnabled = !(this.checkSimplification.IsChecked ?? false) && (checkBoxSanitaryControlExemption.IsChecked ?? false);
|
||||||
|
this.datePickerDateOfIssue.IsEnabled = !(this.checkSimplification.IsChecked ?? false) && (checkBoxSanitaryControlExemption.IsChecked ?? false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
328
ENI2/SheetDisplayControls/VoyageControl.xaml
Normal file
328
ENI2/SheetDisplayControls/VoyageControl.xaml
Normal file
@ -0,0 +1,328 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.VoyageControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1150" d:DesignWidth="800">
|
||||||
|
|
||||||
|
<GroupBox Name="voyageGroupBox" Header="{x:Static p:Resources.textVoyage}">
|
||||||
|
<TabControl x:Name="mainTabControl">
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab11}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="280"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text11PreviousPort}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textLastPort}" Name="label_LastPort" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="1" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textETDLastPort}" Name="label_ETDFromLastport" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" 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"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text12IncomingVoyage}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textKielPassagePlanned}" Name="label_KielPassagePlanned" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxKielCanalPassagePlanned" IsChecked="{Binding KielCanalPassagePlanned}" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" Checked="checkBoxKielCanalPassagePlanned_Checked" Unchecked="checkBoxKielCanalPassagePlanned_Checked"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textIncomingETANOK}" Name="label_IncomingETANOK" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedIncomming" Grid.Row="5" Grid.Column="1" Value="{Binding KielCanalPassagePlannedIncomming, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" AllowTextInput="True" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text13RelevantPortcall}" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="7" Width="Auto" x:Name="locodePoC" LocodeValue="{Binding PoC, Mode=TwoWay}" IsEnabled="False" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textETAPortOfCall}" Margin="0,0,10,0" />
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="8" 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="9" Grid.Column="0" Content="{x:Static p:Resources.textETDPortOfCall}" Margin="0,0,10,0" />
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="9" 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 Content="{x:Static p:Resources.textPlannedPeriodOfStay}" Grid.Column="0" Grid.Row="10" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DoubleUpDown Grid.Row="10" Grid.Column="1" Name="doubleUpDownPlannedPeriodOfStay" Value="{Binding PlannedPeriodOfStay_HUR, Mode=TwoWay}" FormatString="N2" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" TextAlignment="Left"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text14OutgoingVoyage}" Grid.Column="0" Grid.Row="11" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textKielPassagePlanned}" Name="label_KielPassagePlanned_Outgoing" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxKielCanalPassagePlannedOutgoing" IsChecked="{Binding KielCanalPassagePlanned}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center" Checked="checkBoxKielCanalPassagePlanned_Checked" Unchecked="checkBoxKielCanalPassagePlanned_Checked"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="13" Grid.Column="0" Content="{x:Static p:Resources.textOutgoingETANOK}" Name="label_OutgoingETANOK" Margin="0,0,10,0"/>
|
||||||
|
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedOutgoing" Grid.Row="13" Grid.Column="1" Value="{Binding KielCanalPassagePlannedOutgoing, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" AllowTextInput="True" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00" PreviewKeyUp="DateTimePicker_PreviewKeyUp"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text15NextPort}" Grid.Column="0" Grid.Row="14" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="15" Grid.Column="0" Content="{x:Static p:Resources.textNextPort}" Name="label_NextPort" Margin="0,0,10,0"/>
|
||||||
|
<enictrl:LocodeControl Grid.Column="1" Grid.Row="15" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="16" Grid.Column="0" Content="{x:Static p:Resources.textETANextPort}" Name="label_ETAToNextPort" Margin="0,0,10,0" />
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="16" 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"/>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text16Voyage}" Grid.Column="0" Grid.Row="17" Grid.ColumnSpan="3"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="18" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
|
<ComboBox Grid.Row="18" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="19" Grid.Column="0" Content="{x:Static p:Resources.textTransportMode}" Margin="0,0,10,0" />
|
||||||
|
<ComboBox Name="comboBoxTransportMode" Grid.Column="1" Grid.Row="19" Margin="2" SelectedValue="{Binding TransportMode}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab12}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="280"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="260" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="260" />
|
||||||
|
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="340" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text17Last10PortFacilitiesCalled}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.ColumnSpan="2">
|
||||||
|
<Button Name="buttonImportExcelLast10PortFacilities" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelLast10PortFacilities_Click" />
|
||||||
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumL10PEntries" FontWeight="Bold" Text="{Binding LastTenPortFacilitesCalled.Count}" VerticalAlignment="Center"/>
|
||||||
|
<Label Name="labelL10PEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
</StackPanel>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortFacilityPortName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortLocode}" Binding="{Binding PortFacilityPortLoCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortCountry}" Binding="{Binding PortFacilityPortCountry}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="ATA" Binding="{Binding PortFacilityDateOfArrival, StringFormat=d}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="ATD" Binding="{Binding PortFacilityDateOfDeparture, StringFormat=d}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textGISISCode}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding PortFacilityGISISCode}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textGISISCodeLocode}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding PortFacilityGISISCodeLocode}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textShipSecLevel}" Binding="{Binding PortFacilityShipSecurityLevel, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSecurityMatters}" Binding="{Binding PortFacilitySecurityMattersToReport}" IsReadOnly="True" Width="0.2*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text18ShipToShip}" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"/>
|
||||||
|
<StackPanel Grid.Row="4" Orientation="Horizontal" Grid.ColumnSpan="2">
|
||||||
|
<Button Name="buttonImportFromL10P" Margin="2" Content="{x:Static p:Resources.textCopyFromL10P}" Width="220" VerticalAlignment="Center" Click="buttonImportFromL10P_Click" Background="Transparent" />
|
||||||
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumS2SEntries" FontWeight="Bold" Text="{Binding ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count}" VerticalAlignment="Center"/>
|
||||||
|
<Label Name="labelS2SEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
</StackPanel>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLocationName}" Binding="{Binding ShipToShipActivityLocationName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLocationLocode}" Binding="{Binding ShipToShipActivityLocationLoCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDateFrom}" Binding="{Binding ShipToShipActivityDateFrom, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textDateTo}" Binding="{Binding ShipToShipActivityDateTo, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textActivityType}" Binding="{Binding ShipToShipActivityTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSecurityMatters}" Binding="{Binding ShipToShipActivitySecurityMattersToReport, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLatitudeDecimal}" Binding="{Binding ShipToShipActivityLocationCoordinatesLatitude, StringFormat={}{0:N0}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textLongitudeDecimal}" Binding="{Binding ShipToShipActivityLocationCoordinatesLongitude, StringFormat={}{0:N0}}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text19PortsCalled30days}" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2"/>
|
||||||
|
<StackPanel Grid.Row="7" Orientation="Horizontal" Grid.ColumnSpan="2">
|
||||||
|
<Button Name="buttonImportFromSEC" Margin="2" Content="{x:Static p:Resources.textImportFromSEC}" Width="120" VerticalAlignment="Center" Click="buttonImportFromSEC_Click" Background="Transparent" />
|
||||||
|
<Button Name="buttonImportLast30DaysFromExcel" Margin="2" Content="{x:Static p:Resources.textImportFromExcel}" Width="120" VerticalAlignment="Center" Click="buttonImportLast30DaysFromExcel_Click" Background="Transparent" />
|
||||||
|
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPoCEntries" FontWeight="Bold" Text="{Binding PortOfCallLast30Days.Count}" VerticalAlignment="Center"/>
|
||||||
|
<Label Name="labelPoCEntryCount" Content="{x:Static p:Resources.textEntries}" />
|
||||||
|
</StackPanel>
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfCallLast30Days" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
SelectionMode="Extended" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortCall}" Binding="{Binding PortOfCallLast30DaysLocode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textATDPortOfCall}" Binding="{Binding PortOfCallLast30DaysDateOfDeparture, StringFormat=d}" IsReadOnly="True" Width="0.1*" />
|
||||||
|
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textCrewMemberJoinTheShip}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<CheckBox IsChecked="{Binding PortOfCallLast30DaysCrewMembersJoined}" IsEnabled="False" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textCrewMembersJoinedGrid}" Binding="{Binding CrewMembersJoinedText, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab13}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="290"/>
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
<ColumnDefinition Width=".3*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="56" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="120" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
<RowDefinition Height="120" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text110MaritimeHealthData}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"/>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Grid.RowSpan="2" Text="{x:Static p:Resources.textPersonDiedOnBoard}" Name="textBlock_PersonsDiedOnBoard" Margin="0,0,10,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
|
||||||
|
<CheckBox Name="checkBoxHavePersonsDied" IsChecked="{Binding NonAccidentalDeathsDuringVoyage}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNumberOfDeaths}" Name="label_NumberOfDeaths" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Name="integerUpDownNumberOfDeaths" Grid.Row="2" Grid.Column="1" Value="{Binding NonAccidentalDeathsDuringVoyageCount}" Margin="2" ShowButtonSpinner="False" TextAlignment="Left"/>
|
||||||
|
<TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Static p:Resources.textDiseaseInfectiousNature}" Name="textBlock_diseaseInfectious" TextWrapping="Wrap" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxIsSuspectedInfectious" IsChecked="{Binding SuspisionInfectiousNature}" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTotalNumberIllHigherThanExpected}" Name="label_TotalNumberHigher" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxTotalNumberSickHigherThan" IsChecked="{Binding NumberOfIllPersonsHigherThanExpected}" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textNumberOfIl}" Name="label_NumberOfIllPersons" Margin="0,0,10,0"/>
|
||||||
|
<xctk:IntegerUpDown Name="integerUpDownNumberOfIllPersons" Grid.Row="5" Grid.Column="1" Value="{Binding NumberOfIllPersons}" Margin="2" ShowButtonSpinner="False" TextAlignment="Left"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textSickPersonsOnBoard}" Name="label_SickPersonsOnBoard" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxSickPersonsOnBoard" IsChecked="{Binding SickPersonsOnBoard}" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textMedicalPractitionerConsulted}" Name="label_WasMedical" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxWasMedicalConsulted" IsChecked="{Binding MedicalConsulted}" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Row="8" Grid.Column="0" Text="{x:Static p:Resources.textAwareofConditionInfectious}" Name="label_AwareOfCondition" Margin="0,0,10,0" TextWrapping="Wrap"/>
|
||||||
|
<CheckBox Name="checkBoxAwareOfConditions" IsChecked="{Binding AwareOfFurtherInfections}" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textAnySanitaryMeasures}" Name="labelSanitaryMeasuresApplied" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxSanitaryMeasuresApplied" IsChecked="{Binding SanitaryMeasuresApplied}" Grid.Row="9" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridSanitaryMeasures" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasureKind}" Binding="{Binding SanitaryMeasuresType, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasurePlace}" Binding="{Binding SanitaryMeasuresLocation, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasureDate}" Binding="{Binding SanitaryMeasuresDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="11" Grid.Column="0" Content="{x:Static p:Resources.textStowaways}" Name="label_StowawaysOnBoard" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxStowawaysOnBoard" IsChecked="{Binding StowawaysDetected}" Grid.Row="11" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="12" Grid.Column="0" Content="{x:Static p:Resources.textJoiningLocation}" Name="label_JoiningLocation" Margin="0,0,10,0"/>
|
||||||
|
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="12" Grid.RowSpan="1" Grid.Column="1" MaxLength="100" Text="{Binding StowawaysJoiningLocationText}" Margin="2" VerticalContentAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="13" Grid.Column="0" Content="{x:Static p:Resources.textSickAnimalsOrPets}" Name="label_SickAnimalsOrPets" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textShipVisitedInfectedArea}" Name="labelHasShipVisited" Margin="0,0,10,0" />
|
||||||
|
<CheckBox Name="checkBoxHasShipVisited" IsChecked="{Binding InfectedAreaVisited}" Grid.Row="14" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridInfectedAreas" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textInfectedAreaPort}" Binding="{Binding InfectedAreaPort, Mode=TwoWay}" IsReadOnly="True" Width="0.5*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textInfectedAreaDate}" Binding="{Binding InfectedAreaDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.5*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="{x:Static p:Resources.textTab14}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="280"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="300" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text111PortOfItinerary}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" />
|
||||||
|
<Label Content="{x:Static p:Resources.textCruiseShip}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxCruiseShip" IsChecked="{Binding CruiseShip}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
<Label Content="{x:Static p:Resources.textStowaways}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
<CheckBox Name="checkBoxStowaways" IsChecked="{Binding StowawaysOnBoard}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
|
<Button Name="buttonImportPortOfItineraryFromSEC" Grid.Column="0" Grid.Row="3" Margin="2" HorizontalAlignment="Left" Content="{x:Static p:Resources.textImportFromSEC}" Width="120" VerticalAlignment="Center" Click="buttonImportPortOfItineraryFromSEC_Click" Background="Transparent" />
|
||||||
|
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfItinerary" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortOfItineraryName, Mode=TwoWay}" IsReadOnly="True" Width="0.5*" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textETA}" Binding="{Binding PortOfItineraryETA, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}, StringFormat=\{0:dd.MM.yy HH:mm\}}" IsReadOnly="True" Width="0.5*" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
1052
ENI2/SheetDisplayControls/VoyageControl.xaml.cs
Normal file
1052
ENI2/SheetDisplayControls/VoyageControl.xaml.cs
Normal file
File diff suppressed because it is too large
Load Diff
95
ENI2/SheetDisplayControls/WasteReceiptsControl.xaml
Normal file
95
ENI2/SheetDisplayControls/WasteReceiptsControl.xaml
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<src:DetailBaseControl xmlns:src="clr-namespace:ENI2"
|
||||||
|
x:Class="ENI2.SheetDisplayControls.WasteReceiptsControl"
|
||||||
|
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:p="clr-namespace:ENI2.Properties"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:util="clr-namespace:ENI2.Util"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:local="clr-namespace:ENI2.SheetDisplayControls"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="1200" d:DesignWidth="800">
|
||||||
|
<GroupBox Name="wasteReceiptsGroupBox" Header="{x:Static p:Resources.text13WasteReceipts}">
|
||||||
|
<ScrollViewer PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width=".35*"/>
|
||||||
|
<ColumnDefinition Width=".65*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="1080" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text131WasteReceipt}" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
|
||||||
|
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Name="was_rcptGroupBox" Header="{x:Static p:Resources.textWasteReceipt}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="240" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height=".9*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridWasteReceipt" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" SelectionMode="Single"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="0" SelectionChanged="dataGridWasteReceipt_SelectionChanged">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textIdentificationNumber}" Binding="{Binding IdentificationNumber}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortReceptionFacilityName}" Binding="{Binding PortReceptionFacilityName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textPortReceptionFacilityProviderName}" Binding="{Binding PortReceptionFacilityProviderName}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textTreatmentFacilityProviderName}" Binding="{Binding TreatmentFacilityProviderText}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textWasteDeliveryDateFrom}" Binding="{Binding WasteDeliveryDateFrom, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textWasteDeliveryDateTo}" Binding="{Binding WasteDeliveryDateTo, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" Width="Auto" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
<ColumnDefinition Width="120" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</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="1" Name="buttonCopyFromWAS" Content="{x:Static p:Resources.textCopyFromWAS}" Margin="2" Click="buttonCopyFromWAS_Click"/>
|
||||||
|
</Grid>
|
||||||
|
<enictrl:ENIDataGrid x:Name="dataGridWasteReceived" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="2" CanUserAddRows="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<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.textDescription}" Binding="{Binding WasteDescription}" IsReadOnly="True" Width="0.3*" />
|
||||||
|
<!--DataGridTemplateColumn IsReadOnly="True" Width="0.15*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textAmountWasteReceived_MTQ}" FontSize="10"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding AmountWasteReceived_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn-->
|
||||||
|
<DataGridTextColumn Header="{x:Static p:Resources.textAmountWasteReceived_MTQ}" IsReadOnly="False" Width="0.15*">
|
||||||
|
<DataGridTextColumn.ElementStyle>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||||
|
</Style>
|
||||||
|
</DataGridTextColumn.ElementStyle>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
</enictrl:ENIDataGrid>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</GroupBox>
|
||||||
|
</src:DetailBaseControl>
|
||||||
355
ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs
Normal file
355
ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs
Normal file
@ -0,0 +1,355 @@
|
|||||||
|
// Copyright (c) 2025- schick Informatik
|
||||||
|
// Description: Display control of formsheet Tab 13. Waste receipts
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.EditControls;
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace ENI2.SheetDisplayControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for WasteReceiptsControl.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class WasteReceiptsControl : DetailBaseControl
|
||||||
|
{
|
||||||
|
#region fields
|
||||||
|
|
||||||
|
private Message _wasMessage;
|
||||||
|
private WAS _was;
|
||||||
|
private Message _wasRcptMessage;
|
||||||
|
private WAS_RCPT _selectedWAS_RCPT;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public WasteReceiptsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += WasteReceiptsControl_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region public override
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) { this._wasMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT) { this._wasRcptMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
}
|
||||||
|
|
||||||
|
#region init WAS
|
||||||
|
|
||||||
|
WAS was = null;
|
||||||
|
if (this._wasMessage.Elements.Count > 0)
|
||||||
|
was = this._wasMessage.Elements[0] as WAS;
|
||||||
|
if (was == null)
|
||||||
|
{
|
||||||
|
was = new WAS();
|
||||||
|
was.MessageCore = this.Core;
|
||||||
|
was.MessageHeader = this._wasMessage;
|
||||||
|
_wasMessage.Elements.Add(was);
|
||||||
|
}
|
||||||
|
this._was = was;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region init WAS_RCPT
|
||||||
|
|
||||||
|
if (this._wasRcptMessage == null)
|
||||||
|
{
|
||||||
|
this._wasRcptMessage = this.Core.CreateMessage(Message.NotificationClass.WAS_RCPT);
|
||||||
|
this.Messages.Add(this._wasRcptMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dataGridWasteReceipt.Initialize();
|
||||||
|
this.dataGridWasteReceipt.ItemsSource = this._wasRcptMessage.Elements;
|
||||||
|
this.dataGridWasteReceipt.AddingNewItem += DataGridWasteReceipt_AddingNewItem;
|
||||||
|
this.dataGridWasteReceipt.EditRequested += DataGridWasteReceipt_EditRequested;
|
||||||
|
this.dataGridWasteReceipt.DeleteRequested += DataGridWasteReceipt_DeleteRequested;
|
||||||
|
this.dataGridWasteReceipt.CreateRequested += DataGridWasteReceipt_CreateRequested;
|
||||||
|
|
||||||
|
this.dataGridWasteReceived.Initialize();
|
||||||
|
this.dataGridWasteReceived.AddingNewItem += DataGridWasteReceived_AddingNewItem;
|
||||||
|
this.dataGridWasteReceived.EditRequested += DataGridWasteReceived_EditRequested;
|
||||||
|
this.dataGridWasteReceived.DeleteRequested += DataGridWasteReceived_DeleteRequested;
|
||||||
|
this.dataGridWasteReceived.CreateRequested += DataGridWasteReceived_CreateRequested;
|
||||||
|
|
||||||
|
if (this._wasRcptMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
this.dataGridWasteReceipt.SelectedItem = this._wasRcptMessage.Elements[0];
|
||||||
|
this.dataGridWasteReceipt_SelectionChanged(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
base.SetEnabled(enabled);
|
||||||
|
this.wasteReceiptsGroupBox.IsEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void WasteReceiptsControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.dataGridWasteReceived.CellEditEnding += (obj, ev) => { this.SublistElementChanged(Message.NotificationClass.WAS_RCPT); };
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonWasteReceivedAddMissingEntries_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this._selectedWAS_RCPT != null)
|
||||||
|
{
|
||||||
|
this._selectedWAS_RCPT.AddMissingWasteReceived();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#region Waste receipt grid event handler
|
||||||
|
|
||||||
|
private void DataGridWasteReceipt_CreateRequested()
|
||||||
|
{
|
||||||
|
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
|
||||||
|
epd.WAS_RCPT = new WAS_RCPT();
|
||||||
|
epd.WAS_RCPT.MessageHeader = _wasRcptMessage;
|
||||||
|
epd.WAS_RCPT.Identifier = WAS_RCPT.GetNewIdentifier(_wasRcptMessage.Elements);
|
||||||
|
epd.WAS_RCPT.AddMissingWasteReceived();
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!this._wasRcptMessage.Elements.Contains(epd.WAS_RCPT))
|
||||||
|
this._wasRcptMessage.Elements.Add(epd.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
|
epd.WAS_RCPT = new WAS_RCPT();
|
||||||
|
epd.WAS_RCPT.MessageHeader = _wasRcptMessage;
|
||||||
|
epd.WAS_RCPT.Identifier = WAS_RCPT.GetNewIdentifier(_wasRcptMessage.Elements);
|
||||||
|
epd.WAS_RCPT.AddMissingWasteReceived();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!this._wasRcptMessage.Elements.Contains(epd.WAS_RCPT))
|
||||||
|
_wasRcptMessage.Elements.Add(epd.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
|
this.dataGridWasteReceipt.SelectedItem = epd.WAS_RCPT;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceived.ItemsSource = null;
|
||||||
|
dataGridWasteReceipt_SelectionChanged(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// await InitTemplates(); // templates might have changed in the dialog
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridWasteReceipt_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is WAS_RCPT wasRCPT)
|
||||||
|
{
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_wasRcptMessage.Elements.Remove(wasRCPT);
|
||||||
|
wasRCPT.DeleteElements();
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(wasRCPT);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(_wasRcptMessage.Elements));
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
|
this.dataGridWasteReceived.ItemsSource = null;
|
||||||
|
this._selectedWAS_RCPT = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridWasteReceipt_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
|
||||||
|
epd.WAS_RCPT = obj as WAS_RCPT;
|
||||||
|
|
||||||
|
epd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
epd.CopyValuesToEntity();
|
||||||
|
if (!_wasRcptMessage.Elements.Contains(epd.WAS_RCPT))
|
||||||
|
_wasRcptMessage.Elements.Add(epd.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
|
epd.WAS_RCPT = new WAS_RCPT();
|
||||||
|
epd.WAS_RCPT.Identifier = WAS_RCPT.GetNewIdentifier(_wasRcptMessage.Elements);
|
||||||
|
epd.WAS_RCPT.MessageHeader = _wasRcptMessage;
|
||||||
|
epd.WAS_RCPT.AddMissingWasteReceived();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (epd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if (!_wasRcptMessage.Elements.Contains(epd.WAS_RCPT))
|
||||||
|
_wasRcptMessage.Elements.Add(epd.WAS_RCPT);
|
||||||
|
}
|
||||||
|
this.dataGridWasteReceipt.SelectedItem = epd.WAS_RCPT;
|
||||||
|
this.dataGridWasteReceipt.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
dataGridWasteReceipt_SelectionChanged(this, null);
|
||||||
|
|
||||||
|
// await InitTemplates(); // templates might have changed in the dialog
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridWasteReceipt_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
this.DataGridWasteReceipt_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridWasteReceipt_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGridWasteReceipt.SelectedItem is WAS_RCPT was_rcpt)
|
||||||
|
{
|
||||||
|
this.dataGridWasteReceived.ItemsSource = was_rcpt.WasteReceived;
|
||||||
|
this._selectedWAS_RCPT = was_rcpt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Waste received grid event handler
|
||||||
|
|
||||||
|
private void DataGridWasteReceived_DeleteRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
if (obj is WasteReceived wasteReceived)
|
||||||
|
{
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
// are you sure dialog is in base class
|
||||||
|
_selectedWAS_RCPT.WasteReceived.Remove(wasteReceived);
|
||||||
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(wasteReceived);
|
||||||
|
DatabaseEntity.ResetIdentifiers(new List<DatabaseEntity>(_selectedWAS_RCPT.WasteReceived));
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridWasteReceived_CreateRequested()
|
||||||
|
{
|
||||||
|
if (_selectedWAS_RCPT == null) return;
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
||||||
|
ewrd.WasteReceived = new WasteReceived();
|
||||||
|
ewrd.WasteReceived.WAS_RCPT = _selectedWAS_RCPT;
|
||||||
|
ewrd.WasteReceived.Identifier = WasteReceived.GetNewIdentifier(_selectedWAS_RCPT.WasteReceived);
|
||||||
|
|
||||||
|
ewrd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ewrd.CopyValuesToEntity();
|
||||||
|
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
|
{
|
||||||
|
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
ewrd.WasteReceived = new WasteReceived();
|
||||||
|
ewrd.WasteReceived.WAS_RCPT = _selectedWAS_RCPT;
|
||||||
|
ewrd.WasteReceived.Identifier = WasteReceived.GetNewIdentifier(_selectedWAS_RCPT.WasteReceived);
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ewrd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
|
{
|
||||||
|
this._selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void DataGridWasteReceived_EditRequested(DatabaseEntity obj)
|
||||||
|
{
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
this.dataGridWasteReceived.CancelEdit();
|
||||||
|
|
||||||
|
EditWasteReceivedDialog ewrd = new EditWasteReceivedDialog();
|
||||||
|
ewrd.WasteReceived = obj as WasteReceived;
|
||||||
|
|
||||||
|
ewrd.AddClicked += () =>
|
||||||
|
{
|
||||||
|
ewrd.CopyValuesToEntity();
|
||||||
|
if ((ewrd.WasteReceived.WasteCode != null) && !this._selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
|
{
|
||||||
|
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
ewrd.WasteReceived = new WasteReceived();
|
||||||
|
ewrd.WasteReceived.Identifier = WasteReceived.GetNewIdentifier(_selectedWAS_RCPT.WasteReceived);
|
||||||
|
ewrd.WasteReceived.WAS_RCPT = _selectedWAS_RCPT;
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ewrd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
if ((ewrd.WasteReceived.WasteCode != null) && !_selectedWAS_RCPT.WasteReceived.Any(wr => wr.WasteCode == ewrd.WasteReceived.WasteCode))
|
||||||
|
{
|
||||||
|
_selectedWAS_RCPT.WasteReceived.Add(ewrd.WasteReceived);
|
||||||
|
}
|
||||||
|
this.dataGridWasteReceived.Items.Refresh();
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataGridWasteReceived_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
||||||
|
{
|
||||||
|
DataGridWasteReceived_CreateRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -72,14 +72,24 @@ namespace ENI2
|
|||||||
cancelItem.Visibility = Visibility.Collapsed;
|
cancelItem.Visibility = Visibility.Collapsed;
|
||||||
this.dataGrid.ContextMenu.Items.Add(cancelItem);
|
this.dataGrid.ContextMenu.Items.Add(cancelItem);
|
||||||
|
|
||||||
|
this.dataGrid.ContextMenu.Items.Add(new Separator());
|
||||||
|
|
||||||
|
MenuItem classicOpen = new MenuItem();
|
||||||
|
classicOpen.Header = Properties.Resources.textOpenClassic;
|
||||||
|
classicOpen.Click += ClassicOpen_Click;
|
||||||
|
this.dataGrid.ContextMenu.Items.Add(classicOpen);
|
||||||
|
|
||||||
|
MenuItem formOpen = new MenuItem();
|
||||||
|
formOpen.Header = Properties.Resources.textOpenFormsheet;
|
||||||
|
formOpen.Click += FormOpen_Click;
|
||||||
|
this.dataGrid.ContextMenu.Items.Add(formOpen);
|
||||||
|
|
||||||
if (Keyboard.IsKeyDown(Key.LeftShift))
|
if (Keyboard.IsKeyDown(Key.LeftShift))
|
||||||
{
|
{
|
||||||
efMode = true;
|
efMode = true;
|
||||||
logoImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/ef_logo.png"));
|
logoImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/ef_logo.png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -256,20 +266,20 @@ namespace ENI2
|
|||||||
|
|
||||||
#region Selection event handling
|
#region Selection event handling
|
||||||
|
|
||||||
private void DisplayCore(MessageCore core)
|
private void DisplayCore(MessageCore core, ReportingParty.ShipcallDisplayModeEnum displayMode)
|
||||||
{
|
{
|
||||||
if (core != null)
|
if (core != null)
|
||||||
{
|
{
|
||||||
this.OnMessageCoreSelected(core);
|
this.OnMessageCoreSelected(core, displayMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnMessageCoreSelected(MessageCore aMessageCore)
|
protected void OnMessageCoreSelected(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode)
|
||||||
{
|
{
|
||||||
if ((this.MessageCoreSelected != null) && (aMessageCore != null))
|
if ((this.MessageCoreSelected != null) && (aMessageCore != null))
|
||||||
{
|
{
|
||||||
Util.UIHelper.SetBusyState();
|
Util.UIHelper.SetBusyState();
|
||||||
this.MessageCoreSelected(aMessageCore);
|
this.MessageCoreSelected(aMessageCore, displayMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,7 +292,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
// DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
|
// 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, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,7 +302,7 @@ namespace ENI2
|
|||||||
if ((e.Key == Key.Return) || (e.Key == Key.Enter))
|
if ((e.Key == Key.Return) || (e.Key == Key.Enter))
|
||||||
{
|
{
|
||||||
MessageCore selectedCore = dataGrid.SelectedItem as MessageCore;
|
MessageCore selectedCore = dataGrid.SelectedItem as MessageCore;
|
||||||
this.DisplayCore(selectedCore);
|
this.DisplayCore(selectedCore, DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].ShipcallDisplayMode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -330,6 +340,24 @@ namespace ENI2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void FormOpen_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGrid.SelectedItems?.Count == 1)
|
||||||
|
{
|
||||||
|
MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore;
|
||||||
|
this.DisplayCore(selectedCore, ReportingParty.ShipcallDisplayModeEnum.FORMSHEET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClassicOpen_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.dataGrid.SelectedItems?.Count == 1)
|
||||||
|
{
|
||||||
|
MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore;
|
||||||
|
this.DisplayCore(selectedCore, ReportingParty.ShipcallDisplayModeEnum.CLASSIC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void logoImage_MouseUp(object sender, MouseButtonEventArgs e)
|
private void logoImage_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
|||||||
30
ENI2/Util/Extensions.cs
Normal file
30
ENI2/Util/Extensions.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2025- schick Informatik
|
||||||
|
// Description: Some extensions only relevant to ENI itself
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ExcelDataReader;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace ENI2.Util
|
||||||
|
{
|
||||||
|
internal static class Extensions
|
||||||
|
{
|
||||||
|
|
||||||
|
public static string ReadAsString(this IExcelDataReader reader, int index)
|
||||||
|
{
|
||||||
|
if (index >= reader.FieldCount) return null;
|
||||||
|
Type fieldType = reader.GetFieldType(index);
|
||||||
|
if (fieldType == null) return null;
|
||||||
|
if (fieldType == typeof(string))
|
||||||
|
return reader.GetString(index).Clean();
|
||||||
|
if (fieldType == typeof(DateTime))
|
||||||
|
return reader.GetDateTime(index).ToString();
|
||||||
|
if (fieldType == typeof(int))
|
||||||
|
return reader.GetInt32(index).ToString();
|
||||||
|
if (fieldType == typeof(double))
|
||||||
|
return ((int)reader.GetDouble(index)).ToString();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -28,23 +28,32 @@ namespace ENI2.Util
|
|||||||
public object Convert(object value, Type targetType, object parameter,
|
public object Convert(object value, Type targetType, object parameter,
|
||||||
System.Globalization.CultureInfo culture)
|
System.Globalization.CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (targetType != typeof(bool?))
|
|
||||||
throw new InvalidOperationException("The target must be a boolean");
|
if (targetType == typeof(bool?))
|
||||||
|
{
|
||||||
|
if (!((bool?)value).HasValue) return null;
|
||||||
|
return !(bool?)value;
|
||||||
|
}
|
||||||
|
|
||||||
if (!((bool?)value).HasValue) return null;
|
if (targetType == typeof(bool))
|
||||||
|
return !(bool) value;
|
||||||
|
|
||||||
return !(bool?)value;
|
throw new InvalidOperationException("The target must be a boolean");
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter,
|
public object ConvertBack(object value, Type targetType, object parameter,
|
||||||
System.Globalization.CultureInfo culture)
|
System.Globalization.CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (targetType != typeof(bool?))
|
if (targetType == typeof(bool?))
|
||||||
throw new InvalidOperationException("The target must be a boolean");
|
{
|
||||||
|
if (!((bool?)value).HasValue) return null;
|
||||||
|
return !(bool?)value;
|
||||||
|
}
|
||||||
|
|
||||||
if (!((bool?)value).HasValue) return null;
|
if(targetType == typeof(bool))
|
||||||
|
return !(bool)value;
|
||||||
|
|
||||||
return !(bool?)value;
|
throw new InvalidOperationException("The target must be a boolean");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
|
||||||
Sample license text.
|
|
||||||
-->
|
|
||||||
<packages>
|
<packages>
|
||||||
<package id="ExcelDataReader" version="3.7.0" targetFramework="net48" />
|
<package id="ExcelDataReader" version="3.7.0" targetFramework="net48" />
|
||||||
<package id="Extended.Wpf.Toolkit" version="4.7.25103.5738" targetFramework="net48" />
|
<package id="Extended.Wpf.Toolkit" version="4.7.25103.5738" targetFramework="net48" />
|
||||||
|
|||||||
@ -244,7 +244,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
// das sieht riskanter aus als es ist, diese Funktion wird aber nur für Elemente angewendet, die
|
// das sieht riskanter aus als es ist, diese Funktion wird aber nur für Elemente angewendet, die
|
||||||
// ISublistElement implementieren
|
// ISublistElement implementieren
|
||||||
foreach(ISublistElement element in sublist)
|
foreach(ISublistElement element in sublist.Cast<ISublistElement>())
|
||||||
{
|
{
|
||||||
if (element.Identifier.IsNullOrEmpty()) continue;
|
if (element.Identifier.IsNullOrEmpty()) continue;
|
||||||
int elementIdent;
|
int elementIdent;
|
||||||
@ -287,7 +287,7 @@ namespace bsmd.database
|
|||||||
{
|
{
|
||||||
List<DatabaseEntity> tmpList = new List<DatabaseEntity>(sublist);
|
List<DatabaseEntity> tmpList = new List<DatabaseEntity>(sublist);
|
||||||
sublist.Clear();
|
sublist.Clear();
|
||||||
foreach(ISublistElement element in tmpList)
|
foreach(ISublistElement element in tmpList.Cast<ISublistElement>())
|
||||||
{
|
{
|
||||||
element.Identifier = DatabaseEntity.GetNewIdentifier(sublist);
|
element.Identifier = DatabaseEntity.GetNewIdentifier(sublist);
|
||||||
sublist.Add(element as DatabaseEntity);
|
sublist.Add(element as DatabaseEntity);
|
||||||
|
|||||||
@ -25,14 +25,14 @@ namespace bsmd.database
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? NoDPGOnBoardOnArrival { get; set; }
|
public bool? NoDPGOnBoardOnArrival { get; set; } = true;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? DPGManifestOnBoardOnArrival { get; set; }
|
public bool? DPGManifestOnBoardOnArrival { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
@ -40,7 +40,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? MOUBaltic { get; set; }
|
public bool? MOUBaltic { get; set; } = false;
|
||||||
|
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? DPGClassificationIMDG { get; set; }
|
public bool? DPGClassificationIMDG { get; set; }
|
||||||
|
|||||||
@ -35,7 +35,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
public byte? Flashpoint { get; set; }
|
public byte? Flashpoint { get; set; }
|
||||||
|
|
||||||
public bool? SpecRef15_19 { get; set; }
|
public bool? SpecRef15_19 { get; set; } = false;
|
||||||
|
|
||||||
public bool? MHB { get; set; }
|
public bool? MHB { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? SpecRef15_19 { get; set; }
|
public bool? SpecRef15_19 { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[MaxLength(255)]
|
[MaxLength(255)]
|
||||||
|
|||||||
@ -114,7 +114,7 @@ namespace bsmd.database
|
|||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? MarinePollutant { get; set; }
|
public bool? MarinePollutant { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
@ -130,12 +130,12 @@ namespace bsmd.database
|
|||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? LimitedQuantities { get; set; }
|
public bool? LimitedQuantities { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? ExceptedQuantities { get; set; }
|
public bool? ExceptedQuantities { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
@ -154,7 +154,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? GeneralCargoIBC { get; set; }
|
public bool? GeneralCargoIBC { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[MaxLength(24)]
|
[MaxLength(24)]
|
||||||
|
|||||||
@ -58,7 +58,7 @@ namespace bsmd.database
|
|||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? MHB { get; set; }
|
public bool? MHB { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[MaxLength(4)]
|
[MaxLength(4)]
|
||||||
|
|||||||
@ -58,7 +58,7 @@ namespace bsmd.database
|
|||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public byte? FumigatedBulkCargo { get; set; }
|
public byte? FumigatedBulkCargo { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ENI-2 Edit Value für Checkbox (OMG!)
|
/// ENI-2 Edit Value für Checkbox (OMG!)
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
#region selection delegate definition
|
#region selection delegate definition
|
||||||
|
|
||||||
public delegate void MessageCoreSelectedHandler(MessageCore aMessageCore);
|
public delegate void MessageCoreSelectedHandler(MessageCore aMessageCore, ReportingParty.ShipcallDisplayModeEnum displayMode = ReportingParty.ShipcallDisplayModeEnum.CLASSIC);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ namespace bsmd.database
|
|||||||
public DateTime? ETAToNextPort { get; set; }
|
public DateTime? ETAToNextPort { get; set; }
|
||||||
|
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? IsAnchored { get; set; }
|
public bool? IsAnchored { get; set; } = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ namespace bsmd.database
|
|||||||
[ReportDisplayName("In transit")]
|
[ReportDisplayName("In transit")]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? PassengerInTransit { get; set; }
|
public bool? PassengerInTransit { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ReportDisplayName("Issuing state")]
|
[ReportDisplayName("Issuing state")]
|
||||||
|
|||||||
@ -28,7 +28,7 @@ namespace bsmd.database
|
|||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
[LookupName("PRE72H.Tanker")]
|
[LookupName("PRE72H.Tanker")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? Tanker { get; set; }
|
public bool? Tanker { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
@ -78,11 +78,11 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[LookupName("PRE72H.IsDueToInspection")]
|
[LookupName("PRE72H.IsDueToInspection")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? IsDueToInspection { get; set; }
|
public bool? IsDueToInspection { get; set; } = false;
|
||||||
|
|
||||||
[LookupName("PRE72H.PossibleAnchorage")]
|
[LookupName("PRE72H.PossibleAnchorage")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? PossibleAnchorage { get; set; }
|
public bool? PossibleAnchorage { get; set; } = false;
|
||||||
|
|
||||||
public override string Subtitle
|
public override string Subtitle
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,7 +49,7 @@ namespace bsmd.database
|
|||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? PortOfCallLast30DaysCrewMembersJoined { get; set; }
|
public bool? PortOfCallLast30DaysCrewMembersJoined { get; set; } = false;
|
||||||
|
|
||||||
public string Identifier { get; set; }
|
public string Identifier { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
[assembly: AssemblyCompany("schick Informatik")]
|
[assembly: AssemblyCompany("schick Informatik")]
|
||||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||||
[assembly: AssemblyInformationalVersion("7.2.6")]
|
[assembly: AssemblyInformationalVersion("7.2.7")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2025 schick Informatik")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2025 schick Informatik")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("7.2.6.*")]
|
[assembly: AssemblyVersion("7.2.7.*")]
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace bsmd.database
|
namespace bsmd.database
|
||||||
{
|
{
|
||||||
@ -19,11 +20,19 @@ namespace bsmd.database
|
|||||||
OK,
|
OK,
|
||||||
FAILED,
|
FAILED,
|
||||||
USERUKN
|
USERUKN
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ReportingPartyTypeEnum
|
public enum ReportingPartyTypeEnum
|
||||||
{ MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS }
|
{ MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS }
|
||||||
|
|
||||||
|
public enum ShipcallDisplayModeEnum
|
||||||
|
{
|
||||||
|
[Description("Classic display")]
|
||||||
|
CLASSIC,
|
||||||
|
[Description("New formsheet display")]
|
||||||
|
FORMSHEET
|
||||||
|
}
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
internal enum UserFlags : int
|
internal enum UserFlags : int
|
||||||
{
|
{
|
||||||
@ -46,7 +55,11 @@ namespace bsmd.database
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// kann bestimmte Dinge (e.g. templates) im ENI bearbeiten
|
/// kann bestimmte Dinge (e.g. templates) im ENI bearbeiten
|
||||||
/// </summary>
|
/// </summary>
|
||||||
EDITOR = 8
|
EDITOR = 8,
|
||||||
|
/// <summary>
|
||||||
|
/// Beim Klick auf einen Anlauf soll sich per default die "neue" Formansicht öffnen
|
||||||
|
/// </summary>
|
||||||
|
DEFAULTFORMVIEW = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -166,6 +179,19 @@ namespace bsmd.database
|
|||||||
set { this.SetUserFlag(value, UserFlags.EDITOR); }
|
set { this.SetUserFlag(value, UserFlags.EDITOR); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ShipcallDisplayModeEnum ShipcallDisplayMode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((this.Flags & (int)UserFlags.DEFAULTFORMVIEW) != 0) return ShipcallDisplayModeEnum.FORMSHEET;
|
||||||
|
else return ShipcallDisplayModeEnum.CLASSIC;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.SetUserFlag(value != ShipcallDisplayModeEnum.CLASSIC, UserFlags.DEFAULTFORMVIEW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace bsmd.database
|
|||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
[LookupName("SEC.ValidISSCOnBoard")]
|
[LookupName("SEC.ValidISSCOnBoard")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? ValidISSCOnBoard { get; set; }
|
public bool? ValidISSCOnBoard { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[LookupName("SEC.ReasonsForNoValidISSC")]
|
[LookupName("SEC.ReasonsForNoValidISSC")]
|
||||||
@ -122,7 +122,7 @@ namespace bsmd.database
|
|||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
[LookupName("SEC.ApprovedSecurityPlanOnBoard")]
|
[LookupName("SEC.ApprovedSecurityPlanOnBoard")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? ApprovedSecurityPlanOnBoard { get; set; }
|
public bool? ApprovedSecurityPlanOnBoard { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation(ValidationCode.NOT_NULL)]
|
[Validation(ValidationCode.NOT_NULL)]
|
||||||
@ -140,7 +140,7 @@ namespace bsmd.database
|
|||||||
public byte? GeneralDescriptionOfCargo { get; set; }
|
public byte? GeneralDescriptionOfCargo { get; set; }
|
||||||
|
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? AreMatterToReport { get; set; }
|
public bool? AreMatterToReport { get; set; } = false;
|
||||||
|
|
||||||
[LookupName("SEC.MatterToReport")]
|
[LookupName("SEC.MatterToReport")]
|
||||||
[MaxLength(1024)]
|
[MaxLength(1024)]
|
||||||
@ -148,7 +148,7 @@ namespace bsmd.database
|
|||||||
public string MatterToReport { get; set; }
|
public string MatterToReport { get; set; }
|
||||||
|
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? KielCanalPassagePlanned { get; set; }
|
public bool? KielCanalPassagePlanned { get; set; } = false;
|
||||||
|
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public DateTime? KielCanalPassagePlannedIncomming { get; set; }
|
public DateTime? KielCanalPassagePlannedIncomming { get; set; }
|
||||||
|
|||||||
@ -122,7 +122,7 @@ namespace bsmd.database
|
|||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
[LookupName("WAS.ConfirmationOfCorrectness")]
|
[LookupName("WAS.ConfirmationOfCorrectness")]
|
||||||
[ENI2Validation]
|
[ENI2Validation]
|
||||||
public bool? ConfirmationOfCorrectness { get; set; }
|
public bool? ConfirmationOfCorrectness { get; set; } = false;
|
||||||
|
|
||||||
[ShowReport]
|
[ShowReport]
|
||||||
[Validation2(ValidationCode.NOT_NULL)]
|
[Validation2(ValidationCode.NOT_NULL)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user