511 lines
25 KiB
C#
511 lines
25 KiB
C#
// Copyright (c) 2017 schick Informatik
|
|
// Description: SEC Meldung Bearbeitungsseite
|
|
//
|
|
|
|
using bsmd.database;
|
|
using ClosedXML.Excel;
|
|
using ENI2.EditControls;
|
|
using ENI2.Util;
|
|
using Microsoft.Win32;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
|
|
namespace ENI2.DetailViewControls
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for SecurityDetailControl.xaml
|
|
/// </summary>
|
|
public partial class SecurityDetailControl : DetailBaseControl
|
|
{
|
|
private Message _secMessage;
|
|
private SEC _sec;
|
|
|
|
private static readonly string[] isscTypes = { "Final", "Preliminary" };
|
|
|
|
private static readonly string[] isscIssuerTypes = { "Authority", "RSO (Recognized security org.)" };
|
|
|
|
private static readonly string[] cargoDescriptions = {
|
|
"Container",
|
|
"Vehicles",
|
|
"Conventional general cargo",
|
|
"Dry bulk cargo",
|
|
"Liquid bulk cargo",
|
|
"In ballast"
|
|
};
|
|
|
|
public SecurityDetailControl()
|
|
{
|
|
InitializeComponent();
|
|
Loaded += SecurityDetailControl_Loaded;
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
foreach (Message aMessage in this.Messages)
|
|
{
|
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) { this._secMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
|
}
|
|
|
|
#region init SEC
|
|
|
|
if (this._secMessage == null)
|
|
{
|
|
this._secMessage = this.Core.CreateMessage(Message.NotificationClass.SEC);
|
|
this.Messages.Add(this._secMessage);
|
|
}
|
|
|
|
SEC sec = null;
|
|
if (this._secMessage.Elements.Count > 0)
|
|
sec = this._secMessage.Elements[0] as SEC;
|
|
if (sec == null)
|
|
{
|
|
sec = new SEC
|
|
{
|
|
MessageCore = this.Core,
|
|
MessageHeader = this._secMessage
|
|
};
|
|
_secMessage.Elements.Add(sec);
|
|
}
|
|
|
|
this.mainFrame.DataContext = sec;
|
|
this._sec = sec;
|
|
|
|
this.comboBoxCurrentShipSecurityLevel.ItemsSource = Util.GlobalStructures.ShipSecurityLevels;
|
|
//this.comboBoxCurrentShipSecurityLevel.KeyUp += ComboBox_KeyUp;
|
|
this.comboBoxISSCType.ItemsSource = isscTypes;
|
|
//this.comboBoxISSCType.KeyUp += ComboBox_KeyUp;
|
|
this.comboBoxISSCIssuerType.ItemsSource = isscIssuerTypes;
|
|
//this.comboBoxISSCIssuerType.KeyUp += ComboBox_KeyUp;
|
|
this.comboBoxGeneralDescriptionOfCargo.ItemsSource = cargoDescriptions;
|
|
//this.comboBoxGeneralDescriptionOfCargo.KeyUp += ComboBox_KeyUp;
|
|
|
|
this.dataGridLast10PortFacilities.Initialize();
|
|
this.dataGridLast10PortFacilities.ItemsSource = sec.LastTenPortFacilitesCalled;
|
|
|
|
this.dataGridLast10PortFacilities.AddingNewItem += DataGridLast10PortFacilities_AddingNewItem;
|
|
this.dataGridLast10PortFacilities.EditRequested += DataGridLast10PortFacilities_EditRequested;
|
|
this.dataGridLast10PortFacilities.DeleteRequested += DataGridLast10PortFacilities_DeleteRequested;
|
|
this.dataGridLast10PortFacilities.CreateRequested += DataGridLast10PortFacilities_CreateRequested;
|
|
|
|
this.dataGridShip2ShipActivities.Initialize();
|
|
foreach(ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s in sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled)
|
|
{
|
|
if (s2s.ShipToShipActivityTypeCode.HasValue && s2s.ShipToShipActivityType.IsNullOrEmpty() && GlobalStructures.Edifact8025.ContainsKey(s2s.ShipToShipActivityTypeCode.Value))
|
|
s2s.ShipToShipActivityType = GlobalStructures.Edifact8025[s2s.ShipToShipActivityTypeCode.Value];
|
|
}
|
|
this.dataGridShip2ShipActivities.ItemsSource = sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled;
|
|
this.dataGridShip2ShipActivities.AddingNewItem += DataGridShip2ShipActivities_AddingNewItem;
|
|
this.dataGridShip2ShipActivities.EditRequested += DataGridShip2ShipActivities_EditRequested;
|
|
this.dataGridShip2ShipActivities.DeleteRequested += DataGridShip2ShipActivities_DeleteRequested;
|
|
this.dataGridShip2ShipActivities.CreateRequested += DataGridShip2ShipActivities_CreateRequested;
|
|
|
|
this.checkBoxSECSimplification.Checked += CheckBoxSECSimplification_Checked;
|
|
this.checkBoxSECSimplification.Unchecked += CheckBoxSECSimplification_Checked;
|
|
this.checkBoxKielCanalPassagePlanned.Checked += CheckBoxKielCanalPassagePlanned_Checked;
|
|
|
|
this.CheckBoxKielCanalPassagePlanned_Checked(null, null);
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
public override int SelectedTabIndex
|
|
{
|
|
get { return this.mainFrame.SelectedIndex; }
|
|
set { this.mainFrame.SelectedIndex = value; }
|
|
}
|
|
|
|
#region SetEnabled
|
|
|
|
public override void SetEnabled(bool enabled)
|
|
{
|
|
this.secGroupBox.IsEnabled = enabled;
|
|
this.dataGridLast10PortFacilities.IsEnabled = enabled;
|
|
this.dataGridShip2ShipActivities.IsEnabled = enabled;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region data grid ship 2 ship activities
|
|
|
|
private void DataGridShip2ShipActivities_CreateRequested()
|
|
{
|
|
EditShip2ShipActivitiesDialog epd = new EditShip2ShipActivitiesDialog
|
|
{
|
|
ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled()
|
|
};
|
|
epd.ShipToShipActivity.Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
|
|
epd.ShipToShipActivity.SEC = this._sec;
|
|
|
|
epd.AddClicked += () =>
|
|
{
|
|
epd.CopyValuesToEntity();
|
|
if(!this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(epd.ShipToShipActivity))
|
|
this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
epd.ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled
|
|
{
|
|
SEC = this._sec,
|
|
Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled)
|
|
};
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
};
|
|
|
|
if (epd.ShowDialog() ?? false)
|
|
{
|
|
if(!_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(epd.ShipToShipActivity))
|
|
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
}
|
|
}
|
|
|
|
private void DataGridShip2ShipActivities_DeleteRequested(DatabaseEntity obj)
|
|
{
|
|
if (obj is ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s)
|
|
{
|
|
// are you sure dialog is in base class
|
|
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Remove(s2s);
|
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(s2s);
|
|
List<DatabaseEntity> tmpList = new List<DatabaseEntity>(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
|
|
DatabaseEntity.ResetIdentifiers(tmpList);
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
}
|
|
}
|
|
|
|
private void DataGridShip2ShipActivities_EditRequested(DatabaseEntity obj)
|
|
{
|
|
EditShip2ShipActivitiesDialog ecpd = new EditShip2ShipActivitiesDialog
|
|
{
|
|
ShipToShipActivity = obj as ShipToShipActivitiesDuringLastTenPortFacilitiesCalled
|
|
};
|
|
ecpd.AddClicked += () =>
|
|
{
|
|
ecpd.CopyValuesToEntity();
|
|
if (!_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(ecpd.ShipToShipActivity))
|
|
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(ecpd.ShipToShipActivity);
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
ecpd.ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled
|
|
{
|
|
SEC = this._sec,
|
|
Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled)
|
|
};
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
};
|
|
if (ecpd.ShowDialog() ?? false)
|
|
{
|
|
if (!_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(ecpd.ShipToShipActivity))
|
|
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(ecpd.ShipToShipActivity);
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
}
|
|
}
|
|
|
|
private void DataGridShip2ShipActivities_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
|
{
|
|
this.DataGridShip2ShipActivities_CreateRequested();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region data grid last 10 port facilities
|
|
|
|
private void DataGridLast10PortFacilities_CreateRequested()
|
|
{
|
|
EditLast10PortFacilitiesDialog epd = new EditLast10PortFacilitiesDialog
|
|
{
|
|
LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled()
|
|
};
|
|
epd.LastTenPortFacilitiesCalled.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled);
|
|
epd.LastTenPortFacilitiesCalled.SEC = this._sec;
|
|
|
|
epd.AddClicked += () =>
|
|
{
|
|
epd.CopyValuesToEntity();
|
|
if(!this._sec.LastTenPortFacilitesCalled.Contains(epd.LastTenPortFacilitiesCalled))
|
|
this._sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
|
|
epd.LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled
|
|
{
|
|
SEC = this._sec,
|
|
Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled)
|
|
};
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
};
|
|
|
|
if (epd.ShowDialog() ?? false)
|
|
{
|
|
if(!_sec.LastTenPortFacilitesCalled.Contains(epd.LastTenPortFacilitiesCalled))
|
|
_sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
}
|
|
}
|
|
|
|
private void DataGridLast10PortFacilities_DeleteRequested(DatabaseEntity obj)
|
|
{
|
|
if (obj is LastTenPortFacilitiesCalled l10c)
|
|
{
|
|
// are you sure dialog is in base class
|
|
_sec.LastTenPortFacilitesCalled.Remove(l10c);
|
|
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(l10c);
|
|
List<DatabaseEntity> tmpList = new List<DatabaseEntity>(_sec.LastTenPortFacilitesCalled);
|
|
DatabaseEntity.ResetIdentifiers(tmpList);// );
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
}
|
|
}
|
|
|
|
private void DataGridLast10PortFacilities_EditRequested(DatabaseEntity obj)
|
|
{
|
|
EditLast10PortFacilitiesDialog ecpd = new EditLast10PortFacilitiesDialog
|
|
{
|
|
LastTenPortFacilitiesCalled = obj as LastTenPortFacilitiesCalled
|
|
};
|
|
ecpd.AddClicked += () =>
|
|
{
|
|
ecpd.CopyValuesToEntity();
|
|
if (!_sec.LastTenPortFacilitesCalled.Contains(ecpd.LastTenPortFacilitiesCalled))
|
|
_sec.LastTenPortFacilitesCalled.Add(ecpd.LastTenPortFacilitiesCalled);
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
ecpd.LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled
|
|
{
|
|
SEC = this._sec,
|
|
Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled)
|
|
};
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
};
|
|
if (ecpd.ShowDialog() ?? false)
|
|
{
|
|
if (!_sec.LastTenPortFacilitesCalled.Contains(ecpd.LastTenPortFacilitiesCalled))
|
|
_sec.LastTenPortFacilitesCalled.Add(ecpd.LastTenPortFacilitiesCalled);
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
}
|
|
}
|
|
|
|
private void DataGridLast10PortFacilities_AddingNewItem(object sender, AddingNewItemEventArgs e)
|
|
{
|
|
this.DataGridLast10PortFacilities_CreateRequested();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region event handler
|
|
|
|
private void SecurityDetailControl_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
|
|
this.RegisterTextboxChange(this.textBoxCSOEMailName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxCSOFaxName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxCSOFirstName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxCSOLastName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxCSOPhoneName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxISSCIssuerName, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxPortFacilityOfArrival, Message.NotificationClass.SEC);
|
|
this.RegisterTextboxChange(this.textBoxReasonsForNoValidISSC, Message.NotificationClass.SEC);
|
|
|
|
this.RegisterComboboxIndexChange(this.comboBoxCurrentShipSecurityLevel, Message.NotificationClass.SEC);
|
|
this.RegisterComboboxIndexChange(this.comboBoxGeneralDescriptionOfCargo, Message.NotificationClass.SEC);
|
|
this.RegisterComboboxIndexChange(this.comboBoxISSCIssuerType, Message.NotificationClass.SEC);
|
|
this.RegisterComboboxIndexChange(this.comboBoxISSCType, Message.NotificationClass.SEC);
|
|
|
|
this.RegisterDatePickerChange(this.datePickerISSCDateOfExpiration, Message.NotificationClass.SEC);
|
|
this.RegisterDateTimePickerChange(this.dateTimePickerKielCanalPassagePlannedIncomming, Message.NotificationClass.SEC);
|
|
this.RegisterDateTimePickerChange(this.dateTimePickerKielCanalPassagePlannedOutgoing, Message.NotificationClass.SEC);
|
|
|
|
this.RegisterCheckboxChange(this.checkBoxApprovedSecurityPlanOnBoard, Message.NotificationClass.SEC);
|
|
this.RegisterCheckboxChange(this.checkBoxKielCanalPassagePlanned, Message.NotificationClass.SEC);
|
|
this.RegisterCheckboxChange(this.checkBoxSECSimplification, Message.NotificationClass.SEC);
|
|
this.RegisterCheckboxChange(this.checkBoxValidISSCOnBoard, Message.NotificationClass.SEC);
|
|
|
|
this.RegisterLocodeChange(this.locodePortOfCallWhereCompleteSECNotified, Message.NotificationClass.SEC);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Excel import last 10 port facilities
|
|
|
|
private void buttonImportExcel_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
OpenFileDialog ofd = new OpenFileDialog
|
|
{
|
|
Filter = "Excel Files|*.xls;*.xlsx"
|
|
};
|
|
|
|
if (ofd.ShowDialog() ?? false)
|
|
{
|
|
try
|
|
{
|
|
using (var workbook = new XLWorkbook(ofd.FileName))
|
|
{
|
|
var worksheet = workbook.Worksheet(1); // Get first worksheet
|
|
var rows = worksheet.RangeUsed().RowsUsed(); // Get all rows with data
|
|
|
|
List<LastTenPortFacilitiesCalled> importL10C = new List<LastTenPortFacilitiesCalled>();
|
|
|
|
int cnt = 0;
|
|
foreach (var row in rows)
|
|
{
|
|
if (cnt >= 10) break; // Maximum 10 rows
|
|
|
|
if (worksheet.RangeUsed().ColumnCount() < 8)
|
|
{
|
|
throw new InvalidDataException("Sheet must have 8 Columns of data");
|
|
}
|
|
|
|
LastTenPortFacilitiesCalled l10c = new LastTenPortFacilitiesCalled();
|
|
|
|
if (row.Cell(1).IsEmpty() && row.Cell(2).IsEmpty()) continue;
|
|
|
|
if (!row.Cell(1).IsEmpty()) l10c.PortFacilityPortName = row.Cell(1).GetString();
|
|
if (!row.Cell(3).IsEmpty()) l10c.PortFacilityPortCountry = row.Cell(3).GetString();
|
|
if (!row.Cell(4).IsEmpty()) l10c.PortFacilityPortLoCode = row.Cell(4).GetString();
|
|
|
|
object o = null;
|
|
if (!row.Cell(5).IsEmpty()) o = row.Cell(5).Value;
|
|
if (o != null) l10c.PortFacilityDateOfArrival = Convert.ToDateTime(o);
|
|
|
|
if (!row.Cell(6).IsEmpty()) o = row.Cell(6).Value;
|
|
if (o != null) l10c.PortFacilityDateOfDeparture = Convert.ToDateTime(o);
|
|
|
|
if (!row.Cell(7).IsEmpty()) o = row.Cell(7).Value;
|
|
if (o != null) l10c.PortFacilityShipSecurityLevel = Convert.ToByte(o);
|
|
|
|
if (!row.Cell(8).IsEmpty()) o = row.Cell(8).Value;
|
|
int gisis = Convert.ToInt32(o);
|
|
if (!row.Cell(8).IsEmpty()) l10c.PortFacilityGISISCode = gisis.ToString().PadLeft(4, '0');
|
|
|
|
if (!row.Cell(9).IsEmpty()) l10c.PortFacilitySecurityMattersToReport = row.Cell(9).GetString();
|
|
if (l10c.PortFacilitySecurityMattersToReport?.Equals("nil", StringComparison.CurrentCultureIgnoreCase) == true)
|
|
l10c.PortFacilitySecurityMattersToReport = null;
|
|
|
|
if (!row.Cell(10).IsEmpty()) l10c.PortFacilityGISISCodeLocode = row.Cell(10).GetString();
|
|
|
|
l10c.SEC = this._sec;
|
|
l10c.IsDirty = true;
|
|
l10c.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(this._sec.LastTenPortFacilitesCalled);
|
|
this._sec.LastTenPortFacilitesCalled.Add(l10c);
|
|
importL10C.Add(l10c);
|
|
cnt++;
|
|
}
|
|
|
|
if (importL10C.Count > 0)
|
|
{
|
|
this.dataGridLast10PortFacilities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
MessageBox.Show(String.Format(Properties.Resources.textL10PImported, importL10C.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Copy l10p into Ship2Ship
|
|
|
|
private void buttonImportFromL10P_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count > 0)
|
|
{
|
|
MessageBox.Show(Properties.Resources.textOnlyIfGridIsEmpty, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
}
|
|
else
|
|
{
|
|
foreach(LastTenPortFacilitiesCalled l10c in this._sec.LastTenPortFacilitesCalled)
|
|
{
|
|
ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled
|
|
{
|
|
SEC = this._sec,
|
|
Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled),
|
|
ShipToShipActivityLocationName = l10c.PortFacilityPortName,
|
|
ShipToShipActivityLocationLoCode = l10c.PortFacilityPortLoCode,
|
|
ShipToShipActivityDateFrom = l10c.PortFacilityDateOfArrival,
|
|
ShipToShipActivityDateTo = l10c.PortFacilityDateOfDeparture,
|
|
ShipToShipActivitySecurityMattersToReport = l10c.PortFacilitySecurityMattersToReport
|
|
};
|
|
|
|
this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(s2s);
|
|
}
|
|
if(this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Count > 0)
|
|
{
|
|
this.dataGridShip2ShipActivities.Items.Refresh();
|
|
this.SublistElementChanged(Message.NotificationClass.SEC);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region enable / disable controls
|
|
|
|
private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e)
|
|
{
|
|
this.dateTimePickerKielCanalPassagePlannedIncomming.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
|
|
this.dateTimePickerKielCanalPassagePlannedOutgoing.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
|
|
}
|
|
|
|
private void CheckBoxSECSimplification_Checked(object sender, RoutedEventArgs e)
|
|
{
|
|
this.locodePortOfCallWhereCompleteSECNotified.IsEnabled = this.checkBoxSECSimplification.IsChecked ?? false;
|
|
bool enable = !(this.checkBoxSECSimplification.IsChecked ?? false);
|
|
|
|
this.textBoxCSOEMailName.IsEnabled = enable;
|
|
this.textBoxCSOFaxName.IsEnabled = enable;
|
|
this.textBoxCSOFirstName.IsEnabled = enable;
|
|
this.textBoxCSOLastName.IsEnabled = enable;
|
|
this.textBoxCSOPhoneName.IsEnabled = enable;
|
|
this.textBoxISSCIssuerName.IsEnabled = enable;
|
|
this.textBoxPortFacilityOfArrival.IsEnabled = enable;
|
|
this.textBoxReasonsForNoValidISSC.IsEnabled = enable;
|
|
|
|
this.checkBoxApprovedSecurityPlanOnBoard.IsEnabled = enable;
|
|
this.checkBoxValidISSCOnBoard.IsEnabled = enable;
|
|
|
|
this.comboBoxGeneralDescriptionOfCargo.IsEnabled = enable;
|
|
this.comboBoxISSCIssuerType.IsEnabled = enable;
|
|
this.comboBoxISSCType.IsEnabled = enable;
|
|
|
|
this.datePickerISSCDateOfExpiration.IsEnabled = enable;
|
|
|
|
this.dataGridLast10PortFacilities.IsEnabled = enable;
|
|
this.dataGridShip2ShipActivities.IsEnabled = enable;
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Highlighting
|
|
|
|
public override void HighlightErrorMessageContainer()
|
|
{
|
|
if (this._secMessage.HasErrors)
|
|
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.ERROR, this._secMessage);
|
|
|
|
}
|
|
|
|
public override void HighlightViolationMessageContainer()
|
|
{
|
|
if (this._secMessage.HasViolations)
|
|
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.VIOLATION, this._secMessage);
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|