Merge branch 'release/eni_7.20'

This commit is contained in:
Daniel Schick 2023-12-04 16:50:29 +01:00
commit dfb3b123ed
59 changed files with 2663 additions and 1438 deletions

View File

@ -15,6 +15,8 @@ using ENI2.Util;
using ENI2.EditControls;
using System.Windows.Input;
using Microsoft.Office.Interop.Excel;
using System.Linq;
namespace ENI2
{
@ -163,7 +165,7 @@ namespace ENI2
_messages.AddRange(missingMessages);
BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock);
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0));
Dispatcher.BeginInvoke((System.Action)(() => this.listBoxMessages.SelectedIndex = 0));
RoutedCommand saveCmd = new RoutedCommand();
saveCmd.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control));
@ -190,7 +192,7 @@ namespace ENI2
public void CoreChanged(MessageCore newCore)
{
this.Core = newCore;
Application.Current.Dispatcher.Invoke(delegate
System.Windows.Application.Current.Dispatcher.Invoke(delegate
{
if(controlCache.ContainsKey(Properties.Resources.textOverview))
{
@ -429,7 +431,7 @@ namespace ENI2
this.controlCache.Clear();
// return to "new" overview
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages_SelectionChanged(this, null)));
Dispatcher.BeginInvoke((System.Action)(() => this.listBoxMessages_SelectionChanged(this, null)));
}
private void DetailControl_ResetControlCache(string messageGroupName)
@ -607,7 +609,7 @@ namespace ENI2
this.controlCache.Clear();
// return to "new" overviewdan
Dispatcher.BeginInvoke((Action)(() =>
Dispatcher.BeginInvoke((System.Action)(() =>
{
this.listBoxMessages_SelectionChanged(this, null);
shipNameLabel.Text = this.Core.Shipname;
@ -713,11 +715,6 @@ namespace ENI2
RuleEngine ruleEngine = new RuleEngine();
foreach (Message aMessage in _messages)
{
// XXX : TODO wegmachen wenn CREWD/PASD kommt
if ((aMessage.MessageNotificationClass == Message.NotificationClass.PASD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.CREWD))
continue;
if (!aMessage.EvaluateForValidation(this.Core.IsTransit)) continue;
List<MessageError> errors = new List<MessageError>();
@ -739,9 +736,9 @@ namespace ENI2
}
#region 12.11.18 / 6.3.21 / 23.5.22: globale Plausi-Prüfungen
Message crewaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREW);
Message crewaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWA);
Message crewdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWD);
Message pasaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PAS);
Message pasaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASA);
Message pasdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASD);
Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA);
Message secMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC);
@ -777,28 +774,13 @@ namespace ENI2
// Wir können davon ausgehen, dass bei allen Unterelementen die Flags gleich gesetzt sind. Das wird im Import und BorderPoliceDetailControl sichergestellt.
// XXX : TODO auskommentiert bis CREWD/PASD kommt
/*
if(crewaMessage.Elements.Count > 0)
{
CREW crewaFirst = crewaMessage.Elements[0] as CREW;
bool crewaIsSchengen = crewaFirst.NotificationSchengen ?? false;
if (!((crewaFirst.NotificationPAX ?? false) || crewaIsSchengen)) // mindestens eins der beiden
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V181, "Wrong selection", null, "CREWA", null, "CREWA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
foreach(CREW crewa in crewaMessage.Elements)
{
if(crewaIsSchengen && !crewa.HasSchengenDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWA", crewa.Identifier, "CREWA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
vErrors.Add(RuleEngine.CreateError(ValidationCode.V181, "Pax / Schengen: one must be set", null, Properties.Resources.textOverview, null, "CREWA")); ;
}
}
@ -810,19 +792,7 @@ namespace ENI2
bool crewdIsSchengen = crewdFirst.NotificationSchengen ?? false;
if (!((crewdFirst.NotificationPAX ?? false) || crewdIsSchengen)) // mindestens eins der beiden
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V181, "Wrong selection", null, "CREWD", null, "CREWD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
foreach (CREWD crewd in crewdMessage.Elements)
{
if (crewdIsSchengen && !crewd.HasSchengenDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWD", crewd.Identifier, "CREWD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
vErrors.Add(RuleEngine.CreateError(ValidationCode.V181, "Pax / Schengen: one must be set", null, Properties.Resources.textOverview, null, "CREWD")); ;
}
}
}
@ -834,25 +804,7 @@ namespace ENI2
bool pasIsPAX = pasFirst.NotificationPAX ?? false;
if (!(pasIsPAX || pasIsSchengen)) // mindestens eins der beiden
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V201, "Wrong selection", null, "PASA", null, "PASA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
foreach (PAS pasa in pasaMessage.Elements)
{
if (pasIsSchengen && !pasa.HasSchengenDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "No Schengen details", null, "PASA", pasa.Identifier, "PASA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
if(pasIsPAX && !pasa.HasPAXDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "No PAX details", null, "PASA", pasa.Identifier, "PASA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
vErrors.Add(RuleEngine.CreateError (ValidationCode.V201, "Pax / Schengen: one must be set", null, Properties.Resources.textOverview, null, "PASA"));
}
}
@ -865,30 +817,54 @@ namespace ENI2
bool pasdIsPAX = pasdFirst.NotificationPAX ?? false;
if (!(pasdIsPAX || pasdIsSchengen)) // mindestens eins der beiden
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V201, "Wrong selection", null, "PASD", null, "PASD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
foreach (PASD pasd in pasdMessage.Elements)
{
if (pasdIsSchengen && !pasd.HasSchengenDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "No Schengen details", null, "PASD", pasd.Identifier, "PASD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
if (pasdIsPAX && !pasd.HasPAXDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "No PAX details", null, "PASD", pasd.Identifier, "PASD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
vErrors.Add(RuleEngine.CreateError(ValidationCode.V201, "Pax / Schengen: one must be set", null, Properties.Resources.textOverview, null, "PASD"));
}
}
}
*/
#endregion
#region 7.11.23 > 12 Passagiere in PASA oder PASD -> CREW* und PAS* muss NotificationPAX gesetzt haben
if ((pasaMessage != null) && (pasaMessage.Elements.Count > 12))
{
PAS firstPASA = pasaMessage.Elements[0] as PAS;
if(!(firstPASA.NotificationPAX ?? false))
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASA > 12)", null, Properties.Resources.textOverview, null, "PASA");
vViolations.Add(mv);
}
if((crewaMessage != null) && (crewaMessage.Elements.Count > 0))
{
CREW firstCREW = crewaMessage.Elements[0] as CREW;
if(!(firstCREW.NotificationPAX ?? false))
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASA > 12)", null, Properties.Resources.textOverview, null, "CREWA");
vViolations.Add(mv);
}
}
}
if((pasdMessage != null) && (pasdMessage.Elements.Count > 12))
{
PASD firstPASD = pasdMessage.Elements[0] as PASD;
if(!(firstPASD.NotificationPAX ?? false))
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASD > 12)", null, Properties.Resources.textOverview, null, "PASD");
vViolations.Add(mv);
}
if ((crewdMessage != null) && (crewdMessage.Elements.Count > 0))
{
CREWD firstCREW = crewdMessage.Elements[0] as CREWD;
if(!(firstCREW.NotificationPAX ?? false))
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASD > 12)", null, Properties.Resources.textOverview, null, "CREWD");
vViolations.Add(mv);
}
}
}
#endregion
@ -912,7 +888,7 @@ namespace ENI2
Dictionary<string, string> identDict = new Dictionary<string, string>();
foreach (WAS_RCPT was_rcpt in was_rcptMessage.Elements)
foreach (WAS_RCPT was_rcpt in was_rcptMessage.Elements.Cast<WAS_RCPT>())
{
if (!was_rcpt.IdentificationNumber.IsNullOrEmpty())
{
@ -1243,9 +1219,9 @@ namespace ENI2
case Message.NotificationClass.BKRA:
return Properties.Resources.textArrivalNotification;
case Message.NotificationClass.BPOL:
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
case Message.NotificationClass.CREWD:
case Message.NotificationClass.PAS:
case Message.NotificationClass.PASA:
case Message.NotificationClass.PASD:
return Properties.Resources.textBorderPolice;
case Message.NotificationClass.HAZA:

View File

@ -49,7 +49,7 @@
</ScrollViewer>
</GroupBox>
</TabItem>
<TabItem Header="{x:Static p:Resources.textCrew}" Name="tabCrewArrival">
<TabItem Header="{x:Static p:Resources.textCrewArrival}" Name="tabCrewArrival">
<GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}">
<Grid>
<Grid.RowDefinitions>
@ -60,13 +60,13 @@
<Button Name="buttonImportExcelCrew" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumCrewEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelCrewEntryCount" Content="{x:Static p:Resources.textEntries}" />
<!--
<CheckBox Name="checkBoxCrewNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/>
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" />
-->
</StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0">
@ -78,7 +78,7 @@
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.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*" />--> <!-- XXX: TODO -->
<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*" />
@ -91,7 +91,7 @@
</Grid>
</GroupBox>
</TabItem>
<!-- XXX : TODO
<TabItem Header="{x:Static p:Resources.textCrewDeparture}" Name="tabCrewDeparture">
<GroupBox Name="groupBoxCrewListDeparture" Header="{x:Static p:Resources.textTabCrewList}">
<Grid>
@ -131,8 +131,8 @@
</Grid>
</GroupBox>
</TabItem>
-->
<TabItem Header="{x:Static p:Resources.textPas}" Name="tabPassengerList">
<TabItem Header="{x:Static p:Resources.textPasArrival}" Name="tabPassengerList">
<GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}">
<Grid>
<Grid.RowDefinitions>
@ -143,13 +143,11 @@
<Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
<TextBlock Margin="20, 0, 0, 0" Name="textBlockNumPasEntries" FontWeight="Bold" Text="{Binding Elements.Count}" VerticalAlignment="Center"/>
<Label Name="labelPasEntryCount" Content="{x:Static p:Resources.textEntries}" />
<!--
<CheckBox Name="checkBoxPasNotificationSchengen" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationSchengen_Click"/>
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
<Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" />
-->
</StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0">
@ -163,22 +161,22 @@
<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.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*" />--> <!-- XXX : TODO -->
<!-- <DataGridTextColumn Header="{x:Static p:Resources.textEmergencyContactNumber}" Binding="{Binding EmergencyContactNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> -->
<DataGridTextColumn Header="{x:Static p:Resources.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>
</GroupBox>
</TabItem>
<!-- XXX : TODO
<TabItem Header="{x:Static p:Resources.textPasDeparture}" Name="tabPassengerListDeparture">
<GroupBox Name="groupBoxPassengerListDeparture" Header="{x:Static p:Resources.textTabPassengerList}">
<Grid>
@ -222,7 +220,7 @@
</Grid>
</GroupBox>
</TabItem>
-->
</TabControl>
</src:DetailBaseControl>

View File

@ -13,6 +13,7 @@ using ENI2.Util;
using ENI2.Locode;
using ExcelDataReader;
using bsmd.database;
using System.Windows.Media.Imaging;
namespace ENI2.DetailViewControls
{
@ -50,8 +51,8 @@ namespace ENI2.DetailViewControls
foreach (Message aMessage in this.Messages)
{
if (aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) { this._bpolMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREW) { this._crewMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.PAS) { this._pasMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASA) { this._pasMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) { this._crewdMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASD) { this._pasdMessage = aMessage; this.ControlMessages.Add(aMessage); }
@ -99,7 +100,7 @@ namespace ENI2.DetailViewControls
if (this._crewMessage == null)
{
this._crewMessage = this.Core.CreateMessage(Message.NotificationClass.CREW);
this._crewMessage = this.Core.CreateMessage(Message.NotificationClass.CREWA);
this.Messages.Add(this._crewMessage);
}
@ -112,20 +113,27 @@ namespace ENI2.DetailViewControls
this.dataGridCrewList.DeleteRequested += DataGridCrewList_DeleteRequested;
this.dataGridCrewList.CreateRequested += DataGridCrewList_CreateRequested;
this.dataGridCrewList.RefreshGrid += DataGridCrewList_RefreshGrid;
/* XXX : TODO
if(this._crewMessage.Elements.Count > 0)
{
this.checkBoxCrewNotificationSchengen.IsChecked = ((CREW)this._crewMessage.Elements[0]).NotificationSchengen;
this.checkBoxCrewNotificationPAX.IsChecked = ((CREW)this._crewMessage.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
#region init CREWD
/* XXX : TODO
if (this._crewdMessage == null)
{
this._crewdMessage = this.Core.CreateMessage(Message.NotificationClass.CREWD);
@ -148,7 +156,15 @@ namespace ENI2.DetailViewControls
this.checkBoxCrewNotificationPAXDeparture.IsChecked = ((CREWD)this._crewdMessage.Elements[0]).NotificationPAX;
}
*/
// 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
@ -156,7 +172,7 @@ namespace ENI2.DetailViewControls
if (this._pasMessage == null)
{
this._pasMessage = this.Core.CreateMessage(Message.NotificationClass.PAS);
this._pasMessage = this.Core.CreateMessage(Message.NotificationClass.PASA);
this.Messages.Add(this._pasMessage);
}
@ -170,22 +186,26 @@ namespace ENI2.DetailViewControls
this.dataGridPassengerList.CreateRequested += DataGridPassengerList_CreateRequested;
this.dataGridPassengerList.RefreshGrid += DataGridPassengerList_RefreshGrid;
/* XXX : TODO
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
#region init PASD
/* XXX : TODO
if (this._pasdMessage == null)
{
this._pasdMessage = this.Core.CreateMessage(Message.NotificationClass.PASD);
@ -208,11 +228,171 @@ namespace ENI2.DetailViewControls
this.checkBoxPasNotificationPAXDeparture.IsChecked = ((PASD)this._pasdMessage.Elements[0]).NotificationPAX;
}
*/
// 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
}
#region Grid copy handlers
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);
}
this.CheckPASA();
}
}
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);
}
this.CheckPASD();
}
}
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._crewMessage;
crewa.CopyFromCREW(crewd);
crewa.IsDeparture = false;
crewa.Identifier = DatabaseEntity.GetNewIdentifier(this._crewMessage.Elements);
this._crewMessage.Elements.Add(crewa);
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
this.CheckCREWA();
}
}
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);
}
this.CheckCREWD();
}
}
#endregion
#region Check Schengen / PAX flags and sync
private void CheckCREWA()
{
if (this._crewMessage.Elements.Count == 0) return;
CREW firstCREW = this._crewMessage.Elements[0] as CREW;
if (this._crewMessage.Elements.Count == 1)
{
firstCREW.NotificationSchengen = true;
this.checkBoxCrewNotificationSchengen.IsChecked = true;
}
else
{
for (int i = 1; i < this._crewMessage.Elements.Count; i++)
{
((CREW)this._crewMessage.Elements[i]).NotificationSchengen = firstCREW.NotificationSchengen;
}
}
}
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;
}
}
}
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;
}
}
}
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
#region SetEnabled
public override void SetEnabled(bool enabled)
@ -364,23 +544,29 @@ namespace ENI2.DetailViewControls
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
if(!this._pasMessage.Elements.Contains(epd.PAS))
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.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
};
if (epd.ShowDialog() ?? false)
{
if(!this._pasMessage.Elements.Contains(epd.PAS))
if (!this._pasMessage.Elements.Contains(epd.PAS))
{
_pasMessage.Elements.Add(epd.PAS);
this.CheckPASA();
}
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
}
}
@ -397,7 +583,7 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_RefreshGrid()
{
DatabaseEntity.ResetIdentifiers(_pasMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
this.dataGridPassengerList.Items.Refresh();
}
@ -411,24 +597,30 @@ namespace ENI2.DetailViewControls
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
if(!_pasMessage.Elements.Contains(epd.PAS))
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.PAS);
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.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
}
}
@ -439,8 +631,6 @@ namespace ENI2.DetailViewControls
#endregion
/* XXX : TODO
#region passenger grid departure
private void DataGridPassengerListDeparture_CreateRequested()
@ -457,7 +647,10 @@ namespace ENI2.DetailViewControls
{
epd.CopyValuesToEntity();
if (!this._pasdMessage.Elements.Contains(epd.PAS))
{
this._pasdMessage.Elements.Add(epd.PAS);
this.CheckPASD();
}
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PASD
{
@ -471,7 +664,10 @@ namespace ENI2.DetailViewControls
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);
}
@ -505,7 +701,10 @@ namespace ENI2.DetailViewControls
{
epd.CopyValuesToEntity();
if (!_pasMessage.Elements.Contains(epd.PAS))
{
_pasMessage.Elements.Add(epd.PAS);
this.CheckPASD();
}
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PASD
{
@ -519,7 +718,10 @@ namespace ENI2.DetailViewControls
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);
@ -533,8 +735,6 @@ namespace ENI2.DetailViewControls
#endregion
*/
#region crew grid arrival
private void DataGridCrewList_CreateRequested()
@ -549,23 +749,29 @@ namespace ENI2.DetailViewControls
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
if(!this._crewMessage.Elements.Contains(ecd.CREW))
if (!this._crewMessage.Elements.Contains(ecd.CREW))
{
this._crewMessage.Elements.Add(ecd.CREW);
this.CheckCREWA();
}
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW
{
MessageHeader = this._crewMessage,
Identifier = CREW.GetNewIdentifier(_crewMessage.Elements)
};
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
};
if (ecd.ShowDialog() ?? false)
{
if(!this._crewMessage.Elements.Contains(ecd.CREW))
if (!this._crewMessage.Elements.Contains(ecd.CREW))
{
_crewMessage.Elements.Add(ecd.CREW);
this.CheckCREWA();
}
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
}
@ -582,7 +788,7 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_RefreshGrid()
{
DatabaseEntity.ResetIdentifiers(_crewMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
this.dataGridCrewList.Items.Refresh();
}
@ -596,24 +802,30 @@ namespace ENI2.DetailViewControls
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
if(!_crewMessage.Elements.Contains(ecd.CREW))
if (!_crewMessage.Elements.Contains(ecd.CREW))
{
_crewMessage.Elements.Add(ecd.CREW);
this.CheckCREWA();
}
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW
{
Identifier = CREW.GetNewIdentifier(_crewMessage.Elements),
MessageHeader = _crewMessage
};
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
};
if (ecd.ShowDialog() ?? false)
{
if (!_crewMessage.Elements.Contains(ecd.CREW))
{
_crewMessage.Elements.Add(ecd.CREW);
this.CheckCREWA();
}
ecd.CREW.IsDirty = true;
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
}
@ -624,8 +836,6 @@ namespace ENI2.DetailViewControls
#endregion
/* XXX : TODO
#region crew grid departure
private void DataGridCrewListDeparture_CreateRequested()
@ -642,7 +852,10 @@ namespace ENI2.DetailViewControls
{
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
{
@ -656,7 +869,10 @@ namespace ENI2.DetailViewControls
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);
}
@ -667,7 +883,7 @@ namespace ENI2.DetailViewControls
if (obj is CREWD crewd)
{
// are you sure dialog is in base class
_crewMessage.Elements.Remove(crewd);
_crewdMessage.Elements.Remove(crewd);
DBManager.Instance.Delete(crewd);
}
}
@ -690,7 +906,10 @@ namespace ENI2.DetailViewControls
{
ecd.CopyValuesToEntity();
if (!_crewdMessage.Elements.Contains(ecd.CREW))
{
_crewdMessage.Elements.Add(ecd.CREW);
this.CheckCREWD();
}
this.dataGridCrewListDeparture.Items.Refresh();
ecd.CREW = new CREWD
{
@ -704,7 +923,10 @@ namespace ENI2.DetailViewControls
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);
@ -718,8 +940,6 @@ namespace ENI2.DetailViewControls
#endregion
*/
#region Excel import
private string getValueAsString(IExcelDataReader reader, int index)
@ -799,7 +1019,7 @@ namespace ENI2.DetailViewControls
if (importCrew.Count > 0)
{
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
MessageBox.Show(String.Format(Properties.Resources.textCrewImported, importCrew.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
@ -808,8 +1028,6 @@ namespace ENI2.DetailViewControls
}
}
/* XXX : TODO
private void buttonImportExcelCrewDeparture_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog
@ -887,8 +1105,6 @@ namespace ENI2.DetailViewControls
}
}
*/
private void buttonImportExcelPassenger_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog
@ -964,7 +1180,7 @@ namespace ENI2.DetailViewControls
if (importPassenger.Count > 0)
{
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
MessageBox.Show(String.Format(Properties.Resources.textPassengerImported, importPassenger.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
@ -972,7 +1188,7 @@ namespace ENI2.DetailViewControls
}
}
/*
private void buttonImportExcelPassengerDeparture_Click(object sender, RoutedEventArgs e)
{
@ -1057,8 +1273,6 @@ namespace ENI2.DetailViewControls
}
}
*/
#endregion
#region Highlighting
@ -1098,15 +1312,13 @@ namespace ENI2.DetailViewControls
#region Schengen/PAX checkboxes changed event handler
/* XXX : TODO
private void checkBoxCrewNotificationSchengen_Click(object sender, RoutedEventArgs e)
{
foreach(CREW crew in _crewMessage.Elements)
{
crew.NotificationSchengen = checkBoxCrewNotificationSchengen.IsChecked;
}
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
private void checkBoxCrewNotificationPAX_Click(object sender, RoutedEventArgs e)
@ -1116,7 +1328,7 @@ namespace ENI2.DetailViewControls
{
crew.NotificationPAX = checkBoxCrewNotificationPAX.IsChecked;
}
this.SublistElementChanged(Message.NotificationClass.CREW);
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
private void checkBoxCrewNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
@ -1143,7 +1355,7 @@ namespace ENI2.DetailViewControls
{
pas.NotificationSchengen = checkBoxPasNotificationSchengen.IsChecked;
}
this.SublistElementChanged(Message.NotificationClass.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
}
private void checkBoxPasNotificationPAX_Click(object sender, RoutedEventArgs e)
@ -1152,7 +1364,7 @@ namespace ENI2.DetailViewControls
{
pas.NotificationPAX = checkBoxPasNotificationPAX.IsChecked;
}
this.SublistElementChanged(Message.NotificationClass.PAS);
this.SublistElementChanged(Message.NotificationClass.PASA);
}
private void checkBoxPasNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
@ -1173,8 +1385,6 @@ namespace ENI2.DetailViewControls
this.SublistElementChanged(Message.NotificationClass.PASD);
}
*/
#endregion
}

View File

@ -151,7 +151,14 @@
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=Elements, Converter={util:CutoffConverter}, ConverterParameter=0}" Value="True" />
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PAS}" />
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PASA}" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="Yellow" />
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=Elements, Converter={util:CutoffConverter}, ConverterParameter=0}" Value="True" />
<Condition Binding="{Binding Path=MessageNotificationClass}" Value="{x:Static data:Message+NotificationClass.PASD}" />
</MultiDataTrigger.Conditions>
<Setter Property="Background" Value="Yellow" />
</MultiDataTrigger>

View File

@ -186,12 +186,6 @@ namespace ENI2.DetailViewControls
pasdMessage = aMessage;
}
// XXX : TODO remove this
this.Messages.Remove(crewdMessage);
this.Messages.Remove(pasdMessage);
#endregion
#region init ATA

View File

@ -18,7 +18,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<PublishUrl>eni2.publish\</PublishUrl>
<PublishUrl>eni_publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<InstallUrl>http://192.168.2.24/eni2.publish/</InstallUrl>
<InstallUrl>http://192.168.2.24/eni_publish/</InstallUrl>
<SupportUrl>http://www.textbausteine.net/</SupportUrl>
<ProductName>ENI</ProductName>
<PublisherName>Informatikbüro Daniel Schick</PublisherName>
@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>7.14.0.%2a</ApplicationVersion>
<ApplicationRevision>9</ApplicationRevision>
<ApplicationVersion>7.2.0.9</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -1022,7 +1022,7 @@
<SignToolPath Condition="'$(SignToolPath)' == '' And '$(SignToolPathBase)' != ''">$(SignToolPathBase)$(Platform)\</SignToolPath>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>"$(SignToolPath)signtool.exe" sign /f $(ProjectDir)\..\misc\codesigning.pfx /p t5bj2dk9ifdIWBPhPra4U $(TargetPath)</PostBuildEvent>
<PostBuildEvent>"$(SignToolPath)signtool.exe" sign /f $(ProjectDir)\..\misc\codesigning.pfx /p t5bj2dk9ifdIWBPhPra4U /fd SHA256 $(TargetPath)</PostBuildEvent>
</PropertyGroup>
<Import Project="packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@
<Label Name="labelNationality" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
<Label Name="labelDateOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
<Label Name="labelIdDocType" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
<!--<Label Name="labelCountryOfBirth" Grid.Row="4" Grid.Column="1" Content="{x:Static p:Resources.textCountryOfBirth}" Grid.ColumnSpan="2" Margin="263,0,1,0" />--> <!-- XXX : TODO -->
<Label Name="labelCountryOfBirth" Grid.Row="4" Grid.Column="1" Content="{x:Static p:Resources.textCountryOfBirth}" Grid.ColumnSpan="2" Margin="263,0,1,0" />
<Label Name="labelIdDocNumber" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
<Label Name="labelVisaNumber" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textDocumentIssuingState}" />
@ -42,27 +42,29 @@
<!--Label Name="labelEffects" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEffects}" /-->
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}"/>
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates>
</DatePicker>
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
<!-- <ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>-->
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<ComboBox Grid.Row="6" Grid.Column="3" Width="auto" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
<DatePicker Grid.Row="6" Grid.Column="1" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates>
</DatePicker>
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates>
</DatePicker>
<ComboBox Grid.Row="4" Grid.Column="3" Width="auto" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
<TextBox Grid.Row="5" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<ComboBox Grid.Row="6" Grid.Column="3" Width="auto" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" ContextMenu="{DynamicResource ClearContextMenu}"/>
<!--TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEffects" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/-->
</Grid>
</enictrl:EditWindowBase>

View File

@ -67,8 +67,9 @@ namespace ENI2.EditControls
{
this.datePickerExpiryDate.SelectedDate = this.CREW.CrewMemberIdentityDocumentExpiryDate;
}
// this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict; // XXX: TODO
// this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth;
this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth;
// this.textBoxEffects.Text = this.CREW.Effects;
this.OKClicked += EditCREWDialog_OKClicked;
this.AddVisible = true;
@ -89,7 +90,7 @@ namespace ENI2.EditControls
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string) this.comboBoxIssuingState.SelectedValue;
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
// this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
// this.CREW.Effects = this.textBoxEffects.Text.Trim();
}

View File

@ -34,7 +34,7 @@
<Label Name="labelNationality" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
<Label Name="labelDateOfBirth" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
<Label Name="labelIdDocType" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
<!--<Label Name="labelCountryOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCountryOfBirth}" />-->
<Label Name="labelCountryOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCountryOfBirth}" />
<Label Name="labelIdDocNumber" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
<Label Name="labelVisaNumber" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
<Label Name="labelPortOfEmbarkation" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textPortOfEmbarkation}" />
@ -42,35 +42,37 @@
<Label Name="labelTransitPassenger" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textTransitPassenger}" />
<Label Name="labelIssuingState" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDocumentIssuingState}" />
<Label Name="labelExpiryDate" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textDocumentExpiryDate}" />
<!--<Label Name="labelEmergencyCare" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyCare}" />
<Label Name="labelEmergencyContactNumber" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyContactNumber}" />-->
<Label Name="labelEmergencyCare" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyCare}" />
<Label Name="labelEmergencyContactNumber" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textEmergencyContactNumber}" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True"/>
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<enictrl:LocodeControl x:Name="locodePortOfDisembarkation" Grid.Row="5" Grid.Column="1" />
<ComboBox Grid.Row="6" Grid.Column="1" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEmergencyCare" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="8" Grid.Column="1" Width="auto" Name="textBoxEmergencyContactNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates>
</DatePicker>
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" IsEditable="True" SelectedValuePath="Key" DisplayMemberPath="Value" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<!--<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />-->
<ComboBox Grid.Row="3" Grid.Column="3" Name="comboBoxCountryOfBirth" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<enictrl:LocodeControl x:Name="locodePortOfEmbarkation" Grid.Row="5" Grid.Column="3" />
<enictrl:LocodeControl x:Name="locodePortOfDisembarkation" Grid.Row="5" Grid.Column="1" />
<CheckBox Name="checkBoxTransitPassenger" Grid.Row="6" Grid.Column="3" VerticalAlignment="Center" Margin="2"/>
<ComboBox Grid.Row="6" Grid.Column="1" Name="comboBoxIssuingState" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<DatePicker Grid.Row="7" Grid.Column="3" Name="datePickerExpiryDate" Margin="2" DisplayDateStart="1/1/1900" DisplayDateEnd="12/31/2199" PreviewKeyUp="DateTimePicker_PreviewKeyUpDate">
<DatePicker.BlackoutDates>
<CalendarDateRange Start="1/1/0001" End="12/31/1899"/>
<CalendarDateRange Start="1/1/2199" End="1/1/9999"/>
</DatePicker.BlackoutDates>
</DatePicker>
<!--<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxEmergencyCare" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="8" Grid.Column="1" Width="auto" Name="textBoxEmergencyContactNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />-->
</Grid>
</enictrl:EditWindowBase>

View File

@ -71,11 +71,10 @@ namespace ENI2.EditControls
this.datePickerExpiryDate.SelectedDate = this.PAS.PassengerIdentityDocumentExpiryDate;
}
// XXX : TODO
//this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
//this.comboBoxCountryOfBirth.SelectedValue = this.PAS.PassengerCountryOfBirth;
//this.textBoxEmergencyCare.Text = this.PAS.EmergencyCare;
//this.textBoxEmergencyContactNumber.Text = this.PAS.EmergencyContactNumber;
this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxCountryOfBirth.SelectedValue = this.PAS.PassengerCountryOfBirth;
this.textBoxEmergencyCare.Text = this.PAS.EmergencyCare;
this.textBoxEmergencyContactNumber.Text = this.PAS.EmergencyContactNumber;
this.OKClicked += EditPasDialog_OKClicked;
this.AddVisible = true;
@ -98,10 +97,10 @@ namespace ENI2.EditControls
this.PAS.PassengerInTransit = this.checkBoxTransitPassenger.IsChecked;
this.PAS.PassengerIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
this.PAS.PassengerIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
// XXX : TODO
// this.PAS.PassengerCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
//this.PAS.EmergencyCare = this.textBoxEmergencyCare.Text.Trim();
//this.PAS.EmergencyContactNumber = this.textBoxEmergencyContactNumber.Text.Trim();
this.PAS.PassengerCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
this.PAS.EmergencyCare = this.textBoxEmergencyCare.Text.Trim();
this.PAS.EmergencyContactNumber = this.textBoxEmergencyContactNumber.Text.Trim();
}
private void EditPasDialog_OKClicked()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,9 +46,7 @@ namespace ENI2.EditControls
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.STO) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) || // XXX : TODO remove
(aMessage.MessageNotificationClass == Message.NotificationClass.PASD)
(aMessage.MessageNotificationClass == Message.NotificationClass.STO)
) continue;
if (IsTransit &&

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using bsmd.database;
namespace ENI2.Excel
@ -74,7 +74,7 @@ namespace ENI2.Excel
{ if (ScanBKRD(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.BPOL) && notificationClasses.Contains(Message.NotificationClass.BPOL))
{ if (ScanBPOL(message, reader)) ExcelReader.SaveMessage(message); }
if ((message.MessageNotificationClass == Message.NotificationClass.CREW) && notificationClasses.Contains(Message.NotificationClass.CREW))
if ((message.MessageNotificationClass == Message.NotificationClass.CREWA) && notificationClasses.Contains(Message.NotificationClass.CREWA))
{ if (ScanCREW(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.CREWD) && notificationClasses.Contains(Message.NotificationClass.CREWD))
{ if (ScanCREWD(message, reader)) ExcelReader.SaveMessage(message); continue; }
@ -92,8 +92,8 @@ namespace ENI2.Excel
{ if (ScanNAME(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.NOA_NOD) && notificationClasses.Contains(Message.NotificationClass.NOA_NOD))
{ if (ScanNOA_NOD(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.PAS) && notificationClasses.Contains(Message.NotificationClass.PAS))
{ if (ScanPAS(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.PASA) && notificationClasses.Contains(Message.NotificationClass.PASA))
{ if (ScanPASA(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.PASD) && notificationClasses.Contains(Message.NotificationClass.PASD))
{ if (ScanPASD(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.POBA) && notificationClasses.Contains(Message.NotificationClass.POBA))
@ -726,40 +726,53 @@ namespace ENI2.Excel
pas = new PASD();
pas.Identifier = (i + 1).ToString();
pas.MessageHeader = pasdMessage;
pas.IsDeparture = true;
pasdMessage.Elements.Add(pas);
}
// these two are not working, since the lookup field is a combobox where reading text always yields empty string
// if there is time we should do the solution suggested in this question
// https://stackoverflow.com/questions/46752911/how-to-read-comboboxes-value-from-excel-using-c-sharp
pas.NotificationSchengen = reader.ReadCellAsBool("passenger departure", "C10");
pas.NotificationPAX = reader.ReadCellAsBool("passenger departure", "C11");
pas.NotificationPAX = reader.ReadCellAsBool("passenger departure", "C11") ?? false;
pas.PassengerLastName = lastName;
pas.PassengerFirstName = reader.ReadCellAsText("passenger departure", string.Format("C{0}", i + 16));
pas.PassengerPlaceOfBirth = reader.ReadCellAsText("passenger departure", string.Format("D{0}", i + 16));
pas.PassengerCountryOfBirth = reader.ReadCellAsText("passenger departure", string.Format("E{0}", i + 16));
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger departure", string.Format("E{0}", i + 16)), out bool canceled);
if (canceled) return false;
pas.PassengerDateOfBirth = reader.ReadCellAsDateTime("passenger departure", string.Format("F{0}", i + 16));
pas.PassengerGender = ParseGender(reader.ReadCellAsText("passenger departure", string.Format("G{0}", i + 16)));
pas.PassengerNationality = reader.ReadCellAsText("passenger departure", string.Format("H{0}", i + 16));
pas.PassengerIdentityDocumentIssuingState = reader.ReadCellAsText("passenger departure", string.Format("O{0}", i + 16));
pas.PassengerNationality = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger departure", string.Format("H{0}", i + 16)), out canceled);
if (canceled) return false;
pas.PassengerIdentityDocumentIssuingState = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger departure", string.Format("O{0}", i + 16)), out canceled);
if (canceled) return false;
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("passenger departure", string.Format("P{0}", i + 16));
if (pas.NotificationPAX ?? false)
{
pas.EmergencyCare = reader.ReadCellAsText("passenger departure", string.Format("Q{0}", i + 16));
pas.EmergencyContactNumber = reader.ReadCellAsText("passenger departure", string.Format("R{0}", i + 16));
}
if (pas.NotificationSchengen ?? false)
{
pas.PassengerIdentityDocumentType = ParseDocumentType(reader.ReadCellAsText("passenger departure", string.Format("I{0}", i + 16)));
pas.PassengerIdentityDocumentId = reader.ReadCellAsText("passenger departure", string.Format("J{0}", i + 16));
pas.PassengerVisaNumber = reader.ReadCellAsText("passenger departure", string.Format("K{0}", i + 16));
pas.PassengerPortOfEmbarkation = reader.ReadCellAsText("passenger departure", string.Format("L{0}", i + 16));
pas.PassengerPortOfDisembarkation = reader.ReadCellAsText("passenger departure", string.Format("M{0}", i + 16));
pas.PassengerInTransit = reader.ReadCellAsBool("passenger departure", string.Format("N{0}", i + 16));
}
pas.EmergencyCare = reader.ReadCellAsText("passenger departure", string.Format("Q{0}", i + 16));
pas.EmergencyContactNumber = reader.ReadCellAsText("passenger departure", string.Format("R{0}", i + 16));
pas.PassengerIdentityDocumentType = ParseDocumentType(reader.ReadCellAsText("passenger departure", string.Format("I{0}", i + 16)));
pas.PassengerIdentityDocumentId = reader.ReadCellAsText("passenger departure", string.Format("J{0}", i + 16));
pas.PassengerVisaNumber = reader.ReadCellAsText("passenger departure", string.Format("K{0}", i + 16));
pas.PassengerPortOfEmbarkation = reader.ReadCellAsText("passenger departure", string.Format("L{0}", i + 16));
pas.PassengerPortOfDisembarkation = reader.ReadCellAsText("passenger departure", string.Format("M{0}", i + 16));
pas.PassengerInTransit = reader.ReadCellAsBool("passenger departure", string.Format("N{0}", i + 16));
// if (pas.HasSchengenDetails) pas.NotificationSchengen = true;
// if (pas.HasPAXDetails) pas.NotificationPAX = true;
result = true;
}
bool mustPAX = pasdMessage.Elements.Count >= 12;
if (mustPAX)
{
foreach (PASD pasd in pasdMessage.Elements.Cast<PASD>())
pasd.NotificationPAX = mustPAX;
}
return result;
}
@ -767,7 +780,7 @@ namespace ENI2.Excel
#region PAS
private static bool ScanPAS(Message pasMessage, ExcelReader reader)
private static bool ScanPASA(Message pasMessage, ExcelReader reader)
{
bool result = false;
for (int i = 0; i < 1000; i++)
@ -784,36 +797,45 @@ namespace ENI2.Excel
}
pas.NotificationSchengen = reader.ReadCellAsBool("passenger arrival", "C10");
pas.NotificationPAX = reader.ReadCellAsBool("passenger arrival", "C11");
pas.NotificationPAX = reader.ReadCellAsBool("passenger arrival", "C11") ?? false;
pas.PassengerLastName = lastName;
pas.PassengerFirstName = reader.ReadCellAsText("passenger arrival", string.Format("C{0}", i + 16));
pas.PassengerPlaceOfBirth = reader.ReadCellAsText("passenger arrival", string.Format("D{0}", i + 16));
pas.PassengerCountryOfBirth = reader.ReadCellAsText("passenger arrival", string.Format("E{0}", i + 16));
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger arrival", string.Format("E{0}", i + 16)), out bool canceled);
if (canceled) return false;
pas.PassengerDateOfBirth = reader.ReadCellAsDateTime("passenger arrival", string.Format("F{0}", i + 16));
pas.PassengerGender = ParseGender(reader.ReadCellAsText("passenger arrival", string.Format("G{0}", i + 16)));
pas.PassengerNationality = reader.ReadCellAsText("passenger arrival", string.Format("H{0}", i + 16));
pas.PassengerIdentityDocumentIssuingState = reader.ReadCellAsText("passenger arrival", string.Format("O{0}", i + 16));
pas.PassengerNationality = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger arrival", string.Format("H{0}", i + 16)), out canceled);
if(canceled) return false;
pas.PassengerIdentityDocumentIssuingState = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger arrival", string.Format("O{0}", i + 16)), out canceled);
if (canceled) return false;
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("passenger arrival", string.Format("P{0}", i + 16));
//if(pas.NotificationPAX ?? false)
//{
pas.EmergencyCare = reader.ReadCellAsText("passenger arrival", string.Format("Q{0}", i + 16));
pas.EmergencyContactNumber = reader.ReadCellAsText("passenger arrival", string.Format("R{0}", i + 16));
//}
pas.EmergencyCare = reader.ReadCellAsText("passenger arrival", string.Format("Q{0}", i + 16));
pas.EmergencyContactNumber = reader.ReadCellAsText("passenger arrival", string.Format("R{0}", i + 16));
//if(pas.NotificationSchengen ?? false)
//{
pas.PassengerIdentityDocumentType = ParseDocumentType(reader.ReadCellAsText("passenger arrival", string.Format("I{0}", i + 16)));
pas.PassengerIdentityDocumentId = reader.ReadCellAsText("passenger arrival", string.Format("J{0}", i + 16));
pas.PassengerVisaNumber = reader.ReadCellAsText("passenger arrival", string.Format("K{0}", i + 16));
pas.PassengerPortOfEmbarkation = reader.ReadCellAsText("passenger arrival", string.Format("L{0}", i + 16));
pas.PassengerPortOfDisembarkation = reader.ReadCellAsText("passenger arrival", string.Format("M{0}", i + 16));
pas.PassengerInTransit = reader.ReadCellAsBool("passenger arrival", string.Format("N{0}", i + 16));
//}
pas.PassengerIdentityDocumentType = ParseDocumentType(reader.ReadCellAsText("passenger arrival", string.Format("I{0}", i + 16)));
pas.PassengerIdentityDocumentId = reader.ReadCellAsText("passenger arrival", string.Format("J{0}", i + 16));
pas.PassengerVisaNumber = reader.ReadCellAsText("passenger arrival", string.Format("K{0}", i + 16));
pas.PassengerPortOfEmbarkation = reader.ReadCellAsText("passenger arrival", string.Format("L{0}", i + 16));
pas.PassengerPortOfDisembarkation = reader.ReadCellAsText("passenger arrival", string.Format("M{0}", i + 16));
pas.PassengerInTransit = reader.ReadCellAsBool("passenger arrival", string.Format("N{0}", i + 16));
// if (pas.HasSchengenDetails) pas.NotificationSchengen = true;
// if (pas.HasPAXDetails) pas.NotificationPAX = true;
result = true;
}
bool mustPAX = pasMessage.Elements.Count >= 12;
if (mustPAX)
{
foreach (PAS pasa in pasMessage.Elements.Cast<PAS>())
pasa.NotificationPAX = mustPAX;
}
return result;
}
@ -1156,6 +1178,7 @@ namespace ENI2.Excel
crew = new CREWD();
crew.Identifier = (i + 1).ToString();
crew.MessageHeader = crewMessage;
crew.IsDeparture = true;
crewMessage.Elements.Add(crew);
}
@ -1165,11 +1188,13 @@ namespace ENI2.Excel
crew.CrewMemberLastName = lastName;
crew.CrewMemberFirstName = reader.ReadCellAsText("crew departure", string.Format("C{0}", i + 15));
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText("crew departure", string.Format("D{0}", i + 15));
crew.CrewMemberCountryOfBirth = reader.ReadCellAsText("crew departure", string.Format("E{0}", i + 15));
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew departure", string.Format("E{0}", i + 15)), out bool canceled);
if (canceled) return false;
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime("crew departure", string.Format("F{0}", i + 15));
string gender = reader.ReadCellAsText("crew departure", string.Format("G{0}", i + 15));
crew.CrewMemberGender = ParseGender(gender);
crew.CrewMemberNationality = reader.ReadCellAsText("crew departure", string.Format("H{0}", i + 15));
crew.CrewMemberNationality = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew departure", string.Format("H{0}", i + 15)), out canceled);
if (canceled) return false;
if (crew.NotificationSchengen ?? false)
{
@ -1177,7 +1202,8 @@ namespace ENI2.Excel
crew.CrewMemberIdentityDocumentType = ParseDocumentType(idDocType);
crew.CrewMemberIdentityDocumentId = reader.ReadCellAsText("crew departure", string.Format("J{0}", i + 15));
crew.CrewMemberVisaNumber = reader.ReadCellAsText("crew departure", string.Format("K{0}", i + 15));
crew.CrewMemberIdentityDocumentIssuingState = reader.ReadCellAsText("crew departure", string.Format("M{0}", i + 15));
crew.CrewMemberIdentityDocumentIssuingState = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew departure", string.Format("M{0}", i + 15)), out canceled);
if (canceled) return false;
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("crew departure", string.Format("N{0}", i + 15));
}
@ -1190,7 +1216,7 @@ namespace ENI2.Excel
#endregion
#region CREW
#region CREWA
private static bool ScanCREW(Message crewMessage, ExcelReader reader)
{
@ -1209,26 +1235,25 @@ namespace ENI2.Excel
}
crew.NotificationSchengen = reader.ReadCellAsBool("crew arrival", "C10");
crew.NotificationPAX = reader.ReadCellAsBool("crew arrival", "C11");
crew.NotificationPAX = reader.ReadCellAsBool("crew arrival", "C11") ?? false;
crew.CrewMemberLastName = lastName;
crew.CrewMemberFirstName = reader.ReadCellAsText("crew arrival", string.Format("C{0}", i + 15));
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText("crew arrival", string.Format("D{0}", i + 15));
crew.CrewMemberCountryOfBirth = reader.ReadCellAsText("crew arrival", string.Format("E{0}", i + 15));
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew arrival", string.Format("E{0}", i + 15)), out bool canceled);
if (canceled) return false;
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime("crew arrival", string.Format("F{0}", i + 15));
string gender = reader.ReadCellAsText("crew arrival", string.Format("G{0}", i + 15));
crew.CrewMemberGender = ParseGender(gender);
crew.CrewMemberNationality = reader.ReadCellAsText("crew arrival", string.Format("H{0}", i + 15));
//if(crew.NotificationSchengen ?? false)
//{
string idDocType = reader.ReadCellAsText("crew arrival", string.Format("I{0}", i + 15));
crew.CrewMemberIdentityDocumentType = ParseDocumentType(idDocType);
crew.CrewMemberIdentityDocumentId = reader.ReadCellAsText("crew arrival", string.Format("J{0}", i + 15));
crew.CrewMemberVisaNumber = reader.ReadCellAsText("crew arrival", string.Format("K{0}", i + 15));
crew.CrewMemberIdentityDocumentIssuingState = reader.ReadCellAsText("crew arrival", string.Format("M{0}", i + 15));
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("crew arrival", string.Format("N{0}", i + 15));
//}
crew.CrewMemberNationality = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew arrival", string.Format("H{0}", i + 15)), out canceled);
if (canceled) return false;
string idDocType = reader.ReadCellAsText("crew arrival", string.Format("I{0}", i + 15));
crew.CrewMemberIdentityDocumentType = ParseDocumentType(idDocType);
crew.CrewMemberIdentityDocumentId = reader.ReadCellAsText("crew arrival", string.Format("J{0}", i + 15));
crew.CrewMemberVisaNumber = reader.ReadCellAsText("crew arrival", string.Format("K{0}", i + 15));
crew.CrewMemberIdentityDocumentIssuingState = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew arrival", string.Format("M{0}", i + 15)), out canceled);
if (canceled) return false;
crew.CrewMemberIdentityDocumentExpiryDate = reader.ReadCellAsDateTime("crew arrival", string.Format("N{0}", i + 15));
crew.CrewMemberDuty = reader.ReadCellAsText("crew arrival", string.Format("L{0}", i + 15));

View File

@ -84,7 +84,7 @@ namespace ENI2.Excel
{ if (ScanBKRD(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.BPOL) && notificationClasses.Contains(Message.NotificationClass.BPOL))
{ if (ScanBPOL(message, messages, messageCore, reader)) ExcelReader.SaveMessage(message); }
if ((message.MessageNotificationClass == Message.NotificationClass.CREW) && notificationClasses.Contains(Message.NotificationClass.CREW))
if ((message.MessageNotificationClass == Message.NotificationClass.CREWA) && notificationClasses.Contains(Message.NotificationClass.CREWA))
{ if (ScanCREW(message, reader, isOldVersion)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.CREWD) && notificationClasses.Contains(Message.NotificationClass.CREWD))
{ if (ScanCREWD(message, reader)) ExcelReader.SaveMessage(message); continue; }
@ -102,7 +102,7 @@ namespace ENI2.Excel
{ if (ScanNAME(message, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.NOA_NOD) && notificationClasses.Contains(Message.NotificationClass.NOA_NOD))
{ if (ScanNOA_NOD(message, messageCore, reader)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.PAS) && notificationClasses.Contains(Message.NotificationClass.PAS))
if ((message.MessageNotificationClass == Message.NotificationClass.PASA) && notificationClasses.Contains(Message.NotificationClass.PASA))
{ if (ScanPAS(message, reader, isOldVersion)) ExcelReader.SaveMessage(message); continue; }
if ((message.MessageNotificationClass == Message.NotificationClass.PASD) && notificationClasses.Contains(Message.NotificationClass.PASD))
{ if (ScanPASD(message, reader)) ExcelReader.SaveMessage(message); continue; }
@ -2076,7 +2076,7 @@ namespace ENI2.Excel
#endregion LADG
#region CREW
#region CREWA
private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion)
{
@ -2086,7 +2086,7 @@ namespace ENI2.Excel
// 5.9.22: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names)
if (reader.HasWorksheetNamed(sheetTitle))
{
bool? notificationSchengen = reader.ReadBoolean("CREW.NotificationSchengen");
// bool? notificationSchengen = reader.ReadBoolean("CREW.NotificationSchengen");
bool? notificationPax = reader.ReadBoolean("CREW.NotificationPAX");
for (int i = 0; i < 5000; i++)
@ -2103,8 +2103,8 @@ namespace ENI2.Excel
crewMessage.Elements.Add(crew);
}
crew.NotificationSchengen = notificationSchengen;
crew.NotificationPAX = notificationPax;
crew.NotificationSchengen = true;
crew.NotificationPAX = notificationPax ?? false;
crew.CrewMemberLastName = lastName;
crew.CrewMemberFirstName = firstName;
@ -2115,8 +2115,7 @@ namespace ENI2.Excel
crew.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
if (canceled) return true;
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18));
crew.CrewMemberCountryOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18));
if ((crew.CrewMemberCountryOfBirth != null) && (crew.CrewMemberCountryOfBirth.Length > 2)) crew.CrewMemberCountryOfBirth = null;
crew.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _);
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
@ -2137,6 +2136,7 @@ namespace ENI2.Excel
if (crew.Effects.Length > 256)
crew.Effects = crew.Effects.Substring(0, 256);
// crew.NotificationSchengen = crew.HasSchengenDetails;
Util.UIHelper.SetBusyState(); // dialog might reset busy state
}
@ -2192,6 +2192,10 @@ namespace ENI2.Excel
return true;
}
#endregion
#region CREWD
private static bool ScanCREWD(Message crewdMessage, ExcelReader reader)
{
crewdMessage.DeleteElements();
@ -2199,7 +2203,7 @@ namespace ENI2.Excel
// CREW DEPARTURE
if (reader.HasWorksheetNamed(sheetTitle))
{
bool? notificationSchengen = reader.ReadBoolean("CREWD.NotificationSchengen");
// bool? notificationSchengen = reader.ReadBoolean("CREWD.NotificationSchengen");
bool? notificationPax = reader.ReadBoolean("CREWD.NotificationPAX");
for (int i = 0; i < 5000; i++)
@ -2212,11 +2216,12 @@ namespace ENI2.Excel
crewd = new CREWD();
crewd.Identifier = (i + 1).ToString();
crewd.MessageHeader = crewdMessage;
crewd.IsDeparture = true;
crewdMessage.Elements.Add(crewd);
}
crewd.NotificationSchengen = notificationSchengen;
crewd.NotificationPAX = notificationPax;
crewd.NotificationSchengen = true;
crewd.NotificationPAX = notificationPax ?? false;
crewd.CrewMemberLastName = lastName;
crewd.CrewMemberFirstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
@ -2227,11 +2232,9 @@ namespace ENI2.Excel
crewd.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
if (canceled) return true;
crewd.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18));
crewd.CrewMemberCountryOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18));
if ((crewd.CrewMemberCountryOfBirth != null) && (crewd.CrewMemberCountryOfBirth.Length > 2)) crewd.CrewMemberCountryOfBirth = null;
crewd.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _);
crewd.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
crewd.CrewMemberIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out canceled);
if (canceled) return true;
@ -2245,6 +2248,8 @@ namespace ENI2.Excel
crewd.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142));
// crewd.NotificationSchengen = crewd.HasSchengenDetails;
Util.UIHelper.SetBusyState(); // dialog might reset busy state
}
}
@ -2263,6 +2268,7 @@ namespace ENI2.Excel
crewd = new CREWD();
crewd.Identifier = (i + 1).ToString();
crewd.MessageHeader = crewdMessage;
crewd.IsDeparture = true;
crewdMessage.Elements.Add(crewd);
}
@ -2302,7 +2308,7 @@ namespace ENI2.Excel
#region PAS
private static bool ScanPAS(Message pasMessage, ExcelReader reader, bool isOldVersion)
private static bool ScanPAS(Message pasMessage, ExcelReader reader, bool _)
{
List<PAS> newPasList = new List<PAS>();
@ -2310,7 +2316,7 @@ namespace ENI2.Excel
if (reader.HasWorksheetNamed(sheetTitle))
{
bool? notificationSchengen = reader.ReadBoolean("PAS.NotificationSchengen");
// bool? notificationSchengen = reader.ReadBoolean("PAS.NotificationSchengen");
bool? notificationPax = reader.ReadBoolean("PAS.NotificationPAX");
for (int i = 0; i < 5000; i++)
@ -2324,8 +2330,8 @@ namespace ENI2.Excel
pas.MessageHeader = pasMessage;
newPasList.Add(pas);
pas.NotificationSchengen = notificationSchengen;
pas.NotificationPAX = notificationPax;
pas.NotificationSchengen = true;
pas.NotificationPAX = notificationPax ?? false;
pas.PassengerLastName = lastName;
pas.PassengerFirstName = firstName;
@ -2346,8 +2352,7 @@ namespace ENI2.Excel
pas.PassengerInTransit = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", i + 17));
pas.PassengerPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", i + 17));
pas.PassengerCountryOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 17));
if ((pas.PassengerCountryOfBirth != null) && (pas.PassengerCountryOfBirth.Length > 2)) pas.PassengerCountryOfBirth = null;
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 17)), out _);
if (canceled) return true;
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 17));
@ -2363,8 +2368,17 @@ namespace ENI2.Excel
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 17));
pas.EmergencyContactNumber = reader.ReadCellAsText(sheetTitle, string.Format("S{0}", i + 17));
// pas.NotificationSchengen = pas.HasSchengenDetails;
Util.UIHelper.SetBusyState(); // dialog might reset busy state
}
bool mustPAX = newPasList.Count >= 12;
if (mustPAX)
{
foreach (PAS pasa in newPasList.Cast<PAS>())
pasa.NotificationPAX = mustPAX;
}
}
else
{
@ -2433,66 +2447,83 @@ namespace ENI2.Excel
private static bool ScanPASD(Message pasMessage, ExcelReader reader)
{
pasMessage.DeleteElements();
List<PAS> newPasList = new List<PAS>();
bool? notificationSchengen = reader.ReadBoolean("PASD.NotificationSchengen");
bool? notificationPax = reader.ReadBoolean("PASD.NotificationPAX");
string sheetTitle = "9. PAX - Departure";
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
if (reader.HasWorksheetNamed(sheetTitle))
{
string pasLastName = string.Format("PASD.PassengerLastName_{0}", i + 1);
string pasFirstName = string.Format("PASD.PassengerFirstName_{0}", i + 1);
string pasGender = string.Format("PASD.PassengerGender_{0}", i + 1);
string pasNationality = string.Format("PASD.PassengerNationality_{0}", i + 1);
string pasEmbarkation = string.Format("PASD.PassengerPortOfEmbarkation_{0}", i + 1);
string pasDebarkation = string.Format("PASD.PassengerPortOfDisembarkation_{0}", i + 1);
string pasTransit = string.Format("PASD.PassengerInTransit_{0}", i + 1);
string pasPlaceOfBirth = string.Format("PASD.PassengerPlaceOfBirth_{0}", i + 1);
string pasDateOfBirth = string.Format("PASD.PassengerDateOfBirth_{0}", i + 1);
string pasIdentDocType = string.Format("PASD.PassengerIdentityDocumentType_{0}", i + 1);
string pasIdentDocId = string.Format("PASD.PassengerIdentityDocumentId_{0}", i + 1);
string pasVisaNo = string.Format("PASD.PassengerVisaNumber_{0}", i + 1);
string pasIssuing = string.Format("PASD.PassengerIdentityDocumentIssuingState_{0}", i + 1);
string pasExpiryDate = string.Format("PASD.PassengerIdentityDocumentExpiryDate_{0}", i + 1);
string pasCountryOfBirth = string.Format("PASD.CountryOfBirth_{0}", i + 1);
string pasEmergencyCare = string.Format("PASD.EmergencyCare_{0}", i + 1);
string pasEmergencyContact = string.Format("PASD.EmergencyContactNumber_{0}", i + 1);
// bool? notificationSchengen = reader.ReadBoolean("PAS.NotificationSchengen");
bool? notificationPax = reader.ReadBoolean("PASD.NotificationPAX");
string lastName = reader.ReadText(pasLastName);
if (!lastName.IsNullOrEmpty())
for (int i = 0; i < 5000; i++)
{
if (!(pasMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is PASD pas))
{
pas = new PASD();
pas.IsDeparture = true;
pas.Identifier = (i + 1).ToString();
pas.MessageHeader = pasMessage;
pasMessage.Elements.Add(pas);
}
string lastName = reader.ReadCellAsText(sheetTitle, string.Format("C{0}", i + 18));
string firstName = reader.ReadCellAsText(sheetTitle, string.Format("D{0}", i + 18));
if (lastName.IsNullOrEmpty() && firstName.IsNullOrEmpty()) break; // finish after reading last row
PASD pas = new PASD();
pas.Identifier = (i + 1).ToString();
pas.MessageHeader = pasMessage;
pas.IsDeparture = true;
pas.NotificationSchengen = notificationSchengen;
pas.NotificationPAX = notificationPax;
pas.PassengerLastName = lastName;
pas.PassengerFirstName = reader.ReadText(pasFirstName);
pas.PassengerGender = reader.ReadGender(pasGender);
pas.PassengerNationality = reader.ReadNationality(pasNationality);
newPasList.Add(pas);
pas.PassengerPortOfEmbarkation = reader.ReadTextNoWhitespace(pasEmbarkation);
pas.PassengerPortOfDisembarkation = reader.ReadTextNoWhitespace(pasDebarkation);
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
pas.PassengerIdentityDocumentIssuingState = reader.ReadNationality(pasIssuing);
pas.PassengerIdentityDocumentExpiryDate = reader.ReadDate(pasExpiryDate) ?? (DateTime?)new DateTime(2100, 12, 31);
pas.PassengerCountryOfBirth = reader.ReadNationality(pasCountryOfBirth);
pas.EmergencyCare = reader.ReadText(pasEmergencyCare);
pas.EmergencyContactNumber = reader.ReadText(pasEmergencyContact);
pas.NotificationSchengen = true;
pas.NotificationPAX = notificationPax ?? false;
pas.PassengerLastName = lastName;
pas.PassengerFirstName = firstName;
pas.PassengerNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out bool canceled);
if (canceled) return true;
pas.PassengerIdentityDocumentIssuingState = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("O{0}", i + 18)), out canceled);
if (canceled) return true;
if (pas.PassengerIdentityDocumentIssuingState.IsNullOrEmpty())
pas.PassengerIdentityDocumentIssuingState = "XX";
pas.PassengerGender = ReadGender(reader.ReadCellAsText(sheetTitle, string.Format("E{0}", i + 18)), out canceled);
if (canceled) return true;
pas.PassengerPortOfEmbarkation = ReadLocode(reader.ReadCellAsText(sheetTitle, string.Format("F{0}", i + 18)), out canceled);
if (canceled) return true;
pas.PassengerPortOfDisembarkation = ReadLocode(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
if (canceled) return true;
pas.PassengerInTransit = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", i + 18));
pas.PassengerPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", i + 18));
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out _);
if (canceled) return true;
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 18));
pas.PassengerDateOfBirth = dateOfBirth;
pas.PassengerIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("M{0}", i + 18)), out canceled);
if (canceled) return true;
pas.PassengerIdentityDocumentId = reader.ReadCellAsText(sheetTitle, string.Format("N{0}", i + 18));
pas.PassengerIdentityDocumentExpiryDate = reader.ReadCellAsDateTime(sheetTitle, string.Format("P{0}", i + 18)) ?? (DateTime?)new DateTime(2100, 12, 31);
pas.PassengerVisaNumber = reader.ReadCellAsText(sheetTitle, string.Format("Q{0}", i + 18));
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 18));
pas.EmergencyContactNumber = reader.ReadCellAsText(sheetTitle, string.Format("S{0}", i + 18));
// pas.NotificationSchengen = pas.HasSchengenDetails;
Util.UIHelper.SetBusyState(); // dialog might reset busy state
}
bool mustPAX = newPasList.Count >= 12;
if (mustPAX)
{
foreach (PASD pasd in newPasList.Cast<PASD>())
pasd.NotificationPAX = mustPAX;
}
}
DBManager.Instance.DeleteAllPASForMessage(pasMessage.Id);
pasMessage.Elements.Clear();
foreach (PASD pas in newPasList.Cast<PASD>())
pasMessage.Elements.Add(pas);
return true;
}

View File

@ -76,12 +76,12 @@ namespace ENI2.Excel
this.WriteItineraries(bpol);
}
break;
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
this.WriteCREW(message, true, isRefSheet);
break;
//case Message.NotificationClass.CREWD: // XXX-TODO
// this.WriteCREW(message, false, isRefSheet);
// break;
case Message.NotificationClass.CREWD:
this.WriteCREW(message, false, isRefSheet);
break;
case Message.NotificationClass.HAZA:
this.WriteHAZ(message, true);
break;
@ -111,12 +111,12 @@ namespace ENI2.Excel
case Message.NotificationClass.NOA_NOD:
if (message.Elements[0] is NOA_NOD noa_nod) this.WriteNOA_NOD(noa_nod, core.IsTransit, isRefSheet);
break;
case Message.NotificationClass.PAS:
case Message.NotificationClass.PASA:
this.WritePAS(message, true, isRefSheet);
break;
//case Message.NotificationClass.PASD: // XXX - TODO
// this.WritePAS(message, false, isRefSheet);
// break;
case Message.NotificationClass.PASD:
this.WritePAS(message, false, isRefSheet);
break;
case Message.NotificationClass.POBA:
if (message.Elements[0] is POBA poba) this.WriteMessage(poba);
break;
@ -379,13 +379,11 @@ namespace ENI2.Excel
private void WriteCREW(Message crewMessage, bool isArrival, bool isRefSheet)
{
/* XXX - TODO
if (crewMessage.Elements.Count > 0)
{
WriteBoolean(string.Format("CREW{0}.NotificationSchengen", isArrival ? "" : "D"), ((CREW)crewMessage.Elements[0]).NotificationSchengen);
WriteBoolean(string.Format("CREW{0}.NotificationPAX", isArrival ? "" : "D"), ((CREW)crewMessage.Elements[0]).NotificationPAX);
}
*/
for(int i = 0; i<Math.Min(crewMessage.NumberOfExcelRows, crewMessage.Elements.Count); i++)
{
@ -795,13 +793,12 @@ namespace ENI2.Excel
private void WritePAS(Message pasMessage, bool isArrival, bool isRefSheet)
{
/* XXX - TODO
if(pasMessage.Elements.Count > 0)
{
WriteBoolean(string.Format("PAS{0}.NotificationSchengen", isArrival ? "" : "D"), ((PAS)pasMessage.Elements[0]).NotificationSchengen);
WriteBoolean(string.Format("PAS{0}.NotificationPAX", isArrival ? "" : "D"), ((PAS)pasMessage.Elements[0]).NotificationPAX);
}
*/
for(int i = 0; i < Math.Min(pasMessage.NumberOfExcelRows, pasMessage.Elements.Count); i++)
{

View File

@ -19,7 +19,7 @@ namespace ENI2.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
@ -1649,6 +1649,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Copy to CREWA.
/// </summary>
public static string textCopyToCREWA {
get {
return ResourceManager.GetString("textCopyToCREWA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy to CREWD.
/// </summary>
public static string textCopyToCREWD {
get {
return ResourceManager.GetString("textCopyToCREWD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy to HAZD.
/// </summary>
@ -1667,6 +1685,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Copy to PASA.
/// </summary>
public static string textCopyToPASA {
get {
return ResourceManager.GetString("textCopyToPASA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy to PASD.
/// </summary>
public static string textCopyToPASD {
get {
return ResourceManager.GetString("textCopyToPASD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Do you want to copy / overwrite disposal amounts using values from WAS?.
/// </summary>

View File

@ -1888,4 +1888,16 @@
<data name="textCopyToWASConfirmation" xml:space="preserve">
<value>Do you want to copy / overwrite disposal amounts using values from WAS?</value>
</data>
<data name="textCopyToCREWA" xml:space="preserve">
<value>Copy to CREWA</value>
</data>
<data name="textCopyToCREWD" xml:space="preserve">
<value>Copy to CREWD</value>
</data>
<data name="textCopyToPASA" xml:space="preserve">
<value>Copy to PASA</value>
</data>
<data name="textCopyToPASD" xml:space="preserve">
<value>Copy to PASD</value>
</data>
</root>

View File

@ -373,43 +373,50 @@ namespace ENI2.Report
switch (message.MessageNotificationClass)
{
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
case Message.NotificationClass.CREWD:
case Message.NotificationClass.PAS:
case Message.NotificationClass.PASA:
case Message.NotificationClass.PASD:
case Message.NotificationClass.TOWA:
case Message.NotificationClass.TOWD:
case Message.NotificationClass.HAZA when (message.Elements[0] is HAZ haz) && ((haz.IMDGPositions.Count > 0) || (haz.IBCPositions.Count > 0) || (haz.IGCPositions.Count > 0) || (haz.IMSBCPositions.Count > 0) || (haz.MARPOLPositions.Count > 0)):
case Message.NotificationClass.HAZD when (message.Elements[0] is HAZ hazd) && ((hazd.IMDGPositions.Count > 0) || (hazd.IBCPositions.Count > 0) || (hazd.IGCPositions.Count > 0) || (hazd.IMSBCPositions.Count > 0) || (hazd.MARPOLPositions.Count > 0)):
{
// Landscape if not set
if (_lastOrientation == Orientation.Portrait)
{
DefineContentSection(document, Orientation.Landscape, false);
_lastOrientation = Orientation.Landscape;
}
else
{
document.LastSection.AddPageBreak();
}
// Landscape if not set
if (_lastOrientation == Orientation.Portrait)
{
DefineContentSection(document, Orientation.Landscape, false);
_lastOrientation = Orientation.Landscape;
}
else
{
document.LastSection.AddPageBreak();
}
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Subtitle), "Heading3");
string title = messageParagraph.Title;
if (message.MessageNotificationClass == Message.NotificationClass.CREWA) title = "CREWA";
if (message.MessageNotificationClass == Message.NotificationClass.CREWD) title = "CREWD";
if (message.MessageNotificationClass == Message.NotificationClass.PASA) title = "PASA";
if (message.MessageNotificationClass == Message.NotificationClass.PASD) title = "PASD";
}
break;
document.LastSection.AddParagraph(ReplaceTitle(title), "Heading2");
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Subtitle), "Heading3");
}
break;
default:
{
if (_lastOrientation == Orientation.Landscape)
{
ReportDocument.DefineContentSection(document, Orientation.Portrait, false);
_lastOrientation = Orientation.Portrait;
}
if (_lastOrientation == Orientation.Landscape)
{
ReportDocument.DefineContentSection(document, Orientation.Portrait, false);
_lastOrientation = Orientation.Portrait;
}
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Subtitle), "Heading3");
}
break;
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(ReplaceTitle(messageParagraph.Subtitle), "Heading3");
}
break;
}
#endregion
@ -418,11 +425,11 @@ namespace ENI2.Report
switch(message.MessageNotificationClass)
{
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
case Message.NotificationClass.CREWD:
CreateCrewTable(document, message);
return;
case Message.NotificationClass.PAS:
case Message.NotificationClass.PASA:
case Message.NotificationClass.PASD:
CreatePassengerTable(document, message);
return;
@ -519,13 +526,27 @@ namespace ENI2.Report
#region CREW
private static void CreateCrewTable(Document document, Message message)
{
string textSchengen = "[ ] Schengen";
if(message.Elements.Count > 0)
{
CREW firstCREW = message.Elements[0] as CREW;
if(firstCREW.NotificationSchengen ?? false)
{
textSchengen = "[X] Schengen";
}
document.LastSection.AddParagraph(firstCREW.NotificationPAX ?? false ? "[X] PAX notification" : "[ ] PAX notification");
}
Table table = AddGrayTable(document);
table.Format.Font.Size = 9;
table.Format.Font.Size = 8;
// width: 25
Column column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(0.75);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column = table.AddColumn();
@ -533,17 +554,28 @@ namespace ENI2.Report
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column.Width = Unit.FromCentimeter(0.75);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
Row firstRow = table.AddRow();
firstRow.Cells[7].AddParagraph(textSchengen);
firstRow.Cells[7].Shading.Color = Colors.LightGray;
firstRow.Cells[7].MergeRight = 5;
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Last name");
@ -554,13 +586,16 @@ namespace ENI2.Report
hRow.Cells[6].AddParagraph("Nat.");
hRow.Cells[7].AddParagraph("Id doc. type");
hRow.Cells[8].AddParagraph("Id doc. number");
hRow.Cells[9].AddParagraph("Visa number");
hRow.Cells[10].AddParagraph("Duty");
hRow.Cells[9].AddParagraph("Iss. state");
hRow.Cells[10].AddParagraph("Exp. date");
hRow.Cells[11].AddParagraph("Visa number");
hRow.Cells[12].AddParagraph("Duty");
for (int i = 0; i < message.Elements.Count; i++)
{
CREW crew = message.Elements[i] as CREW;
Row row = table.AddRow();
row.Cells[0].AddParagraph((i + 1).ToString());
row.Cells[1].AddParagraph(crew.CrewMemberLastName ?? "");
row.Cells[2].AddParagraph(crew.CrewMemberFirstName ?? "");
@ -570,8 +605,10 @@ namespace ENI2.Report
row.Cells[6].AddParagraph(crew.CrewMemberNationality ?? "");
row.Cells[7].AddParagraph(crew.CrewMemberIdentityDocumentTypeDisplay);
row.Cells[8].AddParagraph(crew.CrewMemberIdentityDocumentId ?? "");
row.Cells[9].AddParagraph(crew.CrewMemberVisaNumber ?? "");
row.Cells[10].AddParagraph(crew.CrewMemberDuty ?? "");
row.Cells[9].AddParagraph(crew.CrewMemberIdentityDocumentIssuingState ?? "");
row.Cells[10].AddParagraph(crew.CrewMemberIdentityDocumentExpiryDateDisplay ?? "");
row.Cells[11].AddParagraph(crew.CrewMemberVisaNumber ?? "");
row.Cells[12].AddParagraph(crew.CrewMemberDuty ?? "");
}
}
#endregion
@ -579,17 +616,36 @@ namespace ENI2.Report
#region PAS
private static void CreatePassengerTable(Document document, Message message)
{
string textSchengen = "[ ] Schengen";
string textPAX = "[ ] PAX";
if (message.Elements.Count > 0)
{
PAS firstPAS = message.Elements[0] as PAS;
if (firstPAS.NotificationSchengen ?? false)
textSchengen = "[X] Schengen";
if (firstPAS.NotificationPAX ?? false)
textPAX = "[X] PAX";
}
Table table = AddGrayTable(document);
table.Format.Font.Size = 9;
table.Format.Font.Size = 7;
Column column = table.AddColumn();
column.Width = Unit.FromCentimeter(0.8);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
@ -599,15 +655,24 @@ namespace ENI2.Report
column = table.AddColumn();
column.Width = Unit.FromCentimeter(2);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(3);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.8);
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(0.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
column = table.AddColumn();
column.Width = Unit.FromCentimeter(1.5);
Row h1Row = table.AddRow();
h1Row.Cells[7].AddParagraph(textSchengen);
h1Row.Cells[7].MergeRight = 7;
h1Row.Cells[7].Shading.Color = Colors.LightGray;
h1Row.Cells[15].AddParagraph(textPAX);
h1Row.Cells[15].MergeRight = 1;
Row hRow = table.AddRow();
hRow.Cells[1].AddParagraph("Last name");
@ -618,10 +683,14 @@ namespace ENI2.Report
hRow.Cells[6].AddParagraph("Nat.");
hRow.Cells[7].AddParagraph("Id doc. type");
hRow.Cells[8].AddParagraph("Id doc. number");
hRow.Cells[9].AddParagraph("Visa number");
hRow.Cells[10].AddParagraph("Emb.");
hRow.Cells[11].AddParagraph("Disemb.");
hRow.Cells[12].AddParagraph("T");
hRow.Cells[9].AddParagraph("Iss. state");
hRow.Cells[10].AddParagraph("Exp. date");
hRow.Cells[11].AddParagraph("Visa number");
hRow.Cells[12].AddParagraph("Emb.");
hRow.Cells[13].AddParagraph("Disemb.");
hRow.Cells[14].AddParagraph("T");
hRow.Cells[15].AddParagraph("Em. care");
hRow.Cells[16].AddParagraph("Em. number");
for (int i = 0; i < message.Elements.Count; i++)
{
@ -636,10 +705,14 @@ namespace ENI2.Report
row.Cells[6].AddParagraph(pas.PassengerNationality ?? "");
row.Cells[7].AddParagraph(pas.PassengerIdentityDocumentTypeDisplay);
row.Cells[8].AddParagraph(pas.PassengerIdentityDocumentId ?? "");
row.Cells[9].AddParagraph(pas.PassengerVisaNumber ?? "");
row.Cells[10].AddParagraph(pas.PassengerPortOfEmbarkation ?? "");
row.Cells[11].AddParagraph(pas.PassengerPortOfDisembarkation ?? "");
row.Cells[12].AddParagraph(pas.PassengerInTransit ?? false ? "X" : "");
row.Cells[9].AddParagraph(pas.PassengerIdentityDocumentIssuingState ?? "");
row.Cells[10].AddParagraph(pas.PassengerIdentityDocumentExpiryDateDisplay);
row.Cells[11].AddParagraph(pas.PassengerVisaNumber ?? "");
row.Cells[12].AddParagraph(pas.PassengerPortOfEmbarkation ?? "");
row.Cells[13].AddParagraph(pas.PassengerPortOfDisembarkation ?? "");
row.Cells[14].AddParagraph(pas.PassengerInTransit ?? false ? "X" : "");
row.Cells[15].AddParagraph(pas.EmergencyCare ?? "");
row.Cells[16].AddParagraph(pas.EmergencyContactNumber ?? "");
}
}
#endregion

View File

@ -172,10 +172,10 @@ namespace ENI2.Util
aMessage.ENINotificationDetailIndex = 9;
break;
case Message.NotificationClass.BPOL:
case Message.NotificationClass.CREW:
case Message.NotificationClass.PAS:
//case Message.NotificationClass.CREWD: // XXX : TODO
//case Message.NotificationClass.PASD:
case Message.NotificationClass.CREWA:
case Message.NotificationClass.PASA:
case Message.NotificationClass.CREWD:
case Message.NotificationClass.PASD:
aMessage.ENINotificationIconString = "../Resources/policeman_german.png";
aMessage.ENINotificationDetailGroup = Properties.Resources.textBorderPolice;
aMessage.ENINotificationDetailIndex = 10;

View File

@ -146,14 +146,6 @@ namespace SendNSWMessageService
// "Virtuelle" Meldeklassen (bisher: DK) werden hier nicht versendet!
if (message.MessageNotificationClass == Message.NotificationClass.STO) continue;
// muss zum Go Live wieder einkommentiert werden, da CREWD und PASD vorerst nicht versendet werden
// XXX : TODO herausnehmen
if((message.MessageNotificationClass == Message.NotificationClass.CREWD) ||
(message.MessageNotificationClass == Message.NotificationClass.PASD))
continue;
if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) ||
(message.MessageNotificationClass == Message.NotificationClass.TRANSIT))
continue;

View File

@ -2332,6 +2332,7 @@ namespace bsmd.ExcelReadService
crew.Identifier = (i + 1).ToString();
crew.MessageHeader = crewMessage;
crewMessage.Elements.Add(crew);
crew.NotificationSchengen = true;
}
crew.CrewMemberLastName = lastName;
@ -2359,8 +2360,10 @@ namespace bsmd.ExcelReadService
}
// CREW DEPARTURE
crewMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.CREWD);
for (int i = 0; i < crewMessage.NumberOfExcelRows; i++)
crewdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.CREWD);
crewdMessage.DeleteElements();
for (int i = 0; i < crewdMessage.NumberOfExcelRows; i++)
{
string crewLastName = string.Format("CREWD.CrewMemberLastName_{0}", i + 1);
string crewFirstName = string.Format("CREWD.CrewMemberFirstName_{0}", i + 1);
@ -2376,12 +2379,13 @@ namespace bsmd.ExcelReadService
string lastName = reader.ReadText(crewLastName);
if (!lastName.IsNullOrEmpty())
{
if (!(crewMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREWD crew))
if (!(crewdMessage.GetSublistElementWithIdentifier((i + 1).ToString()) is CREWD crew))
{
crew = new CREWD();
crew.Identifier = (i + 1).ToString();
crew.MessageHeader = crewMessage;
crewMessage.Elements.Add(crew);
crew.MessageHeader = crewdMessage;
crewdMessage.Elements.Add(crew);
crew.NotificationSchengen = true;
}
crew.IsDeparture = true;
@ -2472,6 +2476,8 @@ namespace bsmd.ExcelReadService
// PASSENGER DEPARTURE
pasMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.PASD);
pasMessage.DeleteElements();
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
{
string pasLastName = string.Format("PASD.PassengerLastName_{0}", i + 1);
@ -2496,6 +2502,7 @@ namespace bsmd.ExcelReadService
pas.Identifier = (i + 1).ToString();
pas.MessageHeader = pasMessage;
pasMessage.Elements.Add(pas);
pas.NotificationSchengen = true;
}
pas.IsDeparture = true;

View File

@ -270,7 +270,7 @@ namespace bsmd.dakosy
}
}
break;
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
{
if (aMessage.Elements.Count > 0)
{
@ -425,7 +425,7 @@ namespace bsmd.dakosy
vList.Visit[0].NAME = new NAME();
vList.Visit[0].NAME.NameOfMaster = name.NameOfMaster;
break;
case Message.NotificationClass.PAS:
case Message.NotificationClass.PASA:
{
if (aMessage.Elements.Count > 0)
{

View File

@ -12,6 +12,8 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -50,6 +52,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WinSCPnet, Version=1.14.0.13797, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf, processorArchitecture=MSIL">
<HintPath>..\packages\WinSCP.6.1.2\lib\net40\WinSCPnet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\bsmd.database\Properties\AssemblyProductInfo.cs">
@ -88,6 +93,13 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\WinSCP.6.1.2\build\WinSCP.targets" Condition="Exists('..\packages\WinSCP.6.1.2\build\WinSCP.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WinSCP.6.1.2\build\WinSCP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinSCP.6.1.2\build\WinSCP.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

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

View File

@ -10,6 +10,10 @@
using log4net;
using System.Diagnostics;
using bsmd.database;
using WinSCP;
using System;
using System.Linq;
using System.Collections.Generic;
namespace bsmd.dakosy
{
@ -107,16 +111,102 @@ namespace bsmd.dakosy
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.RedirectStandardError = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.EnableRaisingEvents = true;
winscp.OutputDataReceived += (s, e) => { if (!e.Data.IsNullOrEmpty()) _log.Debug(e.Data); };
winscp.ErrorDataReceived += (s, e) => { if (!e.Data.IsNullOrEmpty()) _log.Warn(e.Data); };
//winscp.EnableRaisingEvents = true;
//winscp.OutputDataReceived += (s, e) => { if (!e.Data.IsNullOrEmpty()) _log.Debug(e.Data); };
//winscp.ErrorDataReceived += (s, e) => { if (!e.Data.IsNullOrEmpty()) _log.Warn(e.Data); };
winscp.Start();
winscp.BeginErrorReadLine();
winscp.BeginOutputReadLine();
//winscp.BeginErrorReadLine();
//winscp.BeginOutputReadLine();
return winscp;
}
public static void TransmitAllFiles(string remoteDir, string localDir, string host, string user, string keyPath, string hostkey)
{
try
{
SessionOptions sessionOptions = new SessionOptions();
sessionOptions.Protocol = Protocol.Sftp;
sessionOptions.HostName = host;
sessionOptions.UserName = user;
sessionOptions.SshPrivateKeyPath = keyPath;
sessionOptions.SshHostKeyFingerprint = hostkey;
using (Session session = new Session())
{
session.Open(sessionOptions);
// upload
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
TransferOperationResult transferResult = session.PutFiles(localDir, remoteDir, false, transferOptions);
transferResult.Check();
foreach(TransferEventArgs tea in transferResult.Transfers.Cast<TransferEventArgs>())
{
_log.InfoFormat("Upload of {0} successful", tea.FileName);
}
}
}
catch(Exception e)
{
_log.Error(e);
}
}
public static void ReceiveAllFiles(string remoteDir, string localDir, string host, string user, string keyPath, string hostkey)
{
try
{
SessionOptions sessionOptions = new SessionOptions();
sessionOptions.Protocol = Protocol.Sftp;
sessionOptions.HostName = host;
sessionOptions.UserName = user;
sessionOptions.SshPrivateKeyPath = keyPath;
sessionOptions.SshHostKeyFingerprint = hostkey;
using (Session session = new Session())
{
session.Open(sessionOptions);
// upload
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
TransferOperationResult transferResult = session.GetFiles(remoteDir, localDir, false, transferOptions);
transferResult.Check();
foreach (TransferEventArgs tea in transferResult.Transfers.Cast<TransferEventArgs>())
{
_log.InfoFormat("Download of {0} successful", tea.FileName);
}
if (transferResult.Transfers.Count > 0)
{
RemovalOperationResult removalResult = session.RemoveFiles(remoteDir + "/*.*");
if ((removalResult.IsSuccess) && (removalResult.Removals.Count > 0))
{
_log.InfoFormat("Removed {0} downloaded files on remote host", removalResult.Removals);
}
if (!removalResult.IsSuccess)
{
_log.WarnFormat("RemoveFiles was not successful, {0} failures", removalResult.Failures.Count);
}
}
}
}
catch (Exception e)
{
_log.Error(e);
}
}
public static void TransmitAll(string remoteDir, string localDir, Direction direction, string openCommand)
{
Process winscp = StartWinSCPProcess();
@ -135,8 +225,18 @@ namespace bsmd.dakosy
winscp.StandardInput.WriteLine("put *.xml");
winscp.StandardInput.Close();
// Collect all output
string output = winscp.StandardOutput.ReadToEnd();
_log.Debug(output);
output = winscp.StandardError.ReadToEnd();
if (!output.Trim().IsNullOrEmpty())
_log.Warn(output);
// Wait until WinSCP finishes
winscp.WaitForExit();
if(winscp.ExitCode != 0)
{
_log.Warn("WinSCP exited with an error");
}
}
public static void RemoveProcessedFile(string remoteDir, string filename, string openCommand)

View File

@ -11,6 +11,7 @@ using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
namespace bsmd.database
{
@ -48,9 +49,9 @@ namespace bsmd.database
[ENI2Validation]
public string CrewMemberPlaceOfBirth { get; set; }
// [Validation(ValidationCode.FLAG_CODE)]
[Validation(ValidationCode.FLAG_CODE)]
[MaxLength(2)]
[ENI2Validation] // XXX - TODO
[ENI2Validation]
public string CrewMemberCountryOfBirth { get; set; }
[Validation(ValidationCode.NOT_NULL)]
@ -122,12 +123,22 @@ namespace bsmd.database
[ENI2Validation]
public string CrewMemberIdentityDocumentIssuingState { get; set; }
[ShowReport]
[ReportDisplayName("Expiry date")]
[Validation(ValidationCode.PAST_DATE)]
[ENI2Validation]
public DateTime? CrewMemberIdentityDocumentExpiryDate { get; set; }
[ShowReport]
[ReportDisplayName("Doc. Expiry date")]
public string CrewMemberIdentityDocumentExpiryDateDisplay
{
get
{
if (CrewMemberIdentityDocumentExpiryDate.HasValue)
return this.CrewMemberIdentityDocumentExpiryDate.Value.ToShortDateString();
return string.Empty;
}
}
[ENI2Validation]
[MaxLength(256)]
public string Effects { get; set; }
@ -145,7 +156,7 @@ namespace bsmd.database
{
get
{
return CrewMemberIdentityDocumentType.HasValue && !CrewMemberIdentityDocumentId.IsNullOrEmpty() && CrewMemberIdentityDocumentExpiryDate.HasValue;
return CrewMemberIdentityDocumentType.HasValue && !CrewMemberIdentityDocumentId.IsNullOrEmpty() && !CrewMemberIdentityDocumentIssuingState.IsNullOrEmpty() && CrewMemberIdentityDocumentExpiryDate.HasValue;
}
}
@ -272,6 +283,8 @@ namespace bsmd.database
return result;
}
public override string Title => "CREWA";
#endregion
#region Validation
@ -281,41 +294,53 @@ namespace bsmd.database
if (this.CrewMemberIdentityDocumentType.HasValue)
{
if (this.CrewMemberIdentityDocumentType.Value == 5)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (this.CrewMemberIdentityDocumentIssuingState != null)
{
if (this.CrewMemberIdentityDocumentIssuingState.Equals("XX"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (this.CrewMemberNationality != null)
{
if (this.CrewMemberNationality.Equals("XX"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (this.CrewMemberIdentityDocumentExpiryDate.HasValue)
{
if (this.CrewMemberIdentityDocumentExpiryDate.Equals(new DateTime(2100, 12, 31)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
if ((this.CrewMemberIdentityDocumentExpiryDate >= CLAMPMAXDATE) || (this.CrewMemberIdentityDocumentExpiryDate <= CLAMPMINDATE))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check id doc expiry date", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check id doc expiry date", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (this.CrewMemberGender.HasValue)
{
if (this.CrewMemberGender == 0)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (this.CrewMemberDateOfBirth.HasValue && (this.CrewMemberDateOfBirth.Value > DateTime.Today))
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
if (this.CrewMemberDateOfBirth.HasValue && (this.CrewMemberDateOfBirth.Value <= CLAMPMINDATE))
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check date of birth", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check date of birth", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
// NSW 7.2 rules
if((this.NotificationSchengen ?? false) && (!this.HasSchengenDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V182, "Schengen flag set but no data", null, this.Title, null, this.IsDeparture ? "CREWD" : "CREWA"));
}
if (!(this.NotificationSchengen ?? false) && (this.HasSchengenDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V182, "Schengen data given but flag not set", null, this.Title, null, this.IsDeparture ? "CREWD" : "CREWA"));
}
}
@ -347,7 +372,7 @@ namespace bsmd.database
result.Columns.Add(new DataColumn { ColumnName = "CrewMemberCountryOfBirth", DataType = typeof(string), AllowDBNull = true });
result.Columns.Add(new DataColumn { ColumnName = "Effects", DataType = typeof(string), AllowDBNull = true });
foreach (CREW crew in databaseEntities)
foreach (CREW crew in databaseEntities.Cast<CREW>())
{
DataRow row = result.NewRow();
row[0] = crew.MessageHeader.Id;
@ -356,14 +381,20 @@ namespace bsmd.database
row[3] = crew.CrewMemberPlaceOfBirth ?? (object)DBNull.Value;
row[4] = crew.CrewMemberDateOfBirth ?? (object)DBNull.Value;
row[5] = crew.CrewMemberGender ?? (object)DBNull.Value;
row[6] = crew.CrewMemberNationality?.Substring(0,2) ?? (object)DBNull.Value;
if (crew.CrewMemberNationality?.Length == 2)
row[6] = crew.CrewMemberNationality;
else
row[6] = DBNull.Value;
row[7] = crew.CrewMemberIdentityDocumentType ?? (object)DBNull.Value;
row[8] = crew.CrewMemberIdentityDocumentId ?? (object)DBNull.Value;
row[9] = crew.CrewMemberVisaNumber ?? (object)DBNull.Value;
row[10] = crew.CrewMemberDuty ?? (object)DBNull.Value;
row[11] = crew.Identifier ?? (object)DBNull.Value;
row[12] = crew.IsDeparture;
row[13] = crew.CrewMemberIdentityDocumentIssuingState?.Substring(0,2) ?? (object)DBNull.Value;
if (crew.CrewMemberIdentityDocumentIssuingState?.Length == 2)
row[13] = crew.CrewMemberIdentityDocumentIssuingState;
else
row[13] = DBNull.Value;
row[14] = crew.CrewMemberIdentityDocumentExpiryDate ?? (object)DBNull.Value;
row[15] = crew.NotificationSchengen ?? (object)DBNull.Value;
row[16] = crew.NotificationPAX ?? (object)DBNull.Value;
@ -378,7 +409,7 @@ namespace bsmd.database
else
row[17] = crew.CrewMemberCountryOfBirth;
}
row[18] = crew.Effects ?? (object)DBNull.Value;
row[18] = crew.Effects ?? (object) DBNull.Value;
result.Rows.Add(row);
}
@ -403,6 +434,31 @@ namespace bsmd.database
#endregion
#region public copy func
public void CopyFromCREW(CREW crew)
{
if (crew == null) return;
this.CrewMemberLastName = crew.CrewMemberLastName;
this.CrewMemberFirstName = crew.CrewMemberFirstName;
this.CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
this.CrewMemberCountryOfBirth = crew.CrewMemberCountryOfBirth;
this.CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth;
this.CrewMemberGender = crew.CrewMemberGender;
this.CrewMemberNationality = crew.CrewMemberNationality;
this.CrewMemberIdentityDocumentType = crew.CrewMemberIdentityDocumentType;
this.CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
this.CrewMemberVisaNumber = crew.CrewMemberVisaNumber;
this.CrewMemberDuty = crew.CrewMemberDuty;
this.CrewMemberIdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
this.CrewMemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate;
this.Effects = crew.Effects;
this.NotificationPAX = crew.NotificationPAX;
this.NotificationSchengen = crew.NotificationSchengen;
}
#endregion
}
#region CREWD
@ -434,6 +490,8 @@ namespace bsmd.database
cmd.CommandText = query;
}
public override string Title => "CREWD";
public override List<DatabaseEntity> LoadList(System.Data.IDataReader reader)
{
List<DatabaseEntity> result = new List<DatabaseEntity>();

View File

@ -17,6 +17,7 @@ using log4net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Threading;
using System.Linq;
namespace bsmd.database
{
@ -142,7 +143,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores)
foreach (MessageCore core in cores.Cast<MessageCore>())
{
this.LoadCustomer(core);
result.Add(core);
@ -162,7 +163,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores)
foreach (MessageCore core in cores.Cast<MessageCore>())
{
this.LoadCustomer(core);
result.Add(core);
@ -182,7 +183,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores)
foreach (MessageCore core in cores.Cast<MessageCore>())
{
this.LoadCustomer(core);
@ -204,7 +205,7 @@ namespace bsmd.database
ih.PrepareLoadCommand(cmd, Message.LoadFilter.BY_CORE, messageCoreId);
SqlDataReader reader = this.PerformCommand(cmd);
List<ImportHeader> result = new List<ImportHeader>();
foreach (ImportHeader existingHeader in ih.LoadList(reader))
foreach (ImportHeader existingHeader in ih.LoadList(reader).Cast<ImportHeader>())
result.Add(existingHeader);
if (this._closeConnectionAfterUse) this.Disconnect();
@ -219,7 +220,7 @@ namespace bsmd.database
iv.PrepareLoadCommand(cmd, Message.LoadFilter.IMPORTHEADER_ID, importHeader.Id.Value);
SqlDataReader reader = this.PerformCommand(cmd);
List<ImportValue> result = new List<ImportValue>();
foreach (ImportValue existingValue in iv.LoadList(reader))
foreach (ImportValue existingValue in iv.LoadList(reader).Cast<ImportValue>())
result.Add(existingValue);
if (this._closeConnectionAfterUse) this.Disconnect();
@ -239,7 +240,7 @@ namespace bsmd.database
{
List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
foreach (MessageCore core in cores)
foreach (MessageCore core in cores.Cast<MessageCore>())
{
this.LoadCustomer(core);
result.Add(core);
@ -261,7 +262,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
if (reader != null)
{
foreach (MessageCore core in aMessageCore.LoadList(reader))
foreach (MessageCore core in aMessageCore.LoadList(reader).Cast<MessageCore>())
result.Add(core);
}
return result;
@ -292,7 +293,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> cores = aMessageCore.LoadList(reader);
List<MessageCore> result = new List<MessageCore>();
foreach (MessageCore core in cores)
foreach (MessageCore core in cores.Cast<MessageCore>())
{
this.LoadCustomer(core);
this.LoadSTATShipName(core);
@ -355,7 +356,7 @@ namespace bsmd.database
List<DatabaseEntity> messages = aMessage.LoadList(reader);
List<Message> messageList = new List<Message>();
foreach (Message message in messages)
foreach (Message message in messages.Cast<Message>())
{
message.MessageCore = core;
messageList.Add(message);
@ -413,7 +414,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> reportingParties = aRep.LoadList(reader);
DBManager.allReportingParties = new Dictionary<Guid, ReportingParty>();
foreach (ReportingParty rp in reportingParties)
foreach (ReportingParty rp in reportingParties.Cast<ReportingParty>())
DBManager.allReportingParties.Add(rp.Id.Value, rp);
}
return DBManager.allReportingParties;
@ -427,7 +428,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> allRules = vr.LoadList(reader);
List<ValidationRule> result = new List<ValidationRule>();
foreach (ValidationRule aVR in allRules)
foreach (ValidationRule aVR in allRules.Cast<ValidationRule>())
result.Add(aVR);
return result;
}
@ -443,7 +444,7 @@ namespace bsmd.database
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> portAreas = pa.LoadList(reader);
DBManager.allPortAreas = new Dictionary<string, PortArea>();
foreach (PortArea aPa in portAreas)
foreach (PortArea aPa in portAreas.Cast<PortArea>())
DBManager.allPortAreas[aPa.Code] = aPa; // TODO da gibt es doppelte Einträge
}
return DBManager.allPortAreas;
@ -460,7 +461,7 @@ namespace bsmd.database
List<DatabaseEntity> messages = aMessage.LoadList(reader);
List<Message> messageList = new List<Message>();
foreach (Message message in messages)
foreach (Message message in messages.Cast<Message>())
messageList.Add(message);
if (messageList.Count == 0) return null;
@ -483,7 +484,7 @@ namespace bsmd.database
List<DatabaseEntity> messages = aMessage.LoadList(reader);
List<Message> messageList = new List<Message>();
foreach (Message message in messages)
foreach (Message message in messages.Cast<Message>())
messageList.Add(message);
if (messageList.Count == 0) return null;
@ -756,7 +757,7 @@ namespace bsmd.database
agnt_template.PrepareLoadCommand(cmd, Message.LoadFilter.ALL);
IDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> a_list = agnt_template.LoadList(reader);
foreach (AGNT_Template aTemplate in a_list)
foreach (AGNT_Template aTemplate in a_list.Cast<AGNT_Template>())
result.Add(aTemplate);
reader.Close();
}
@ -1002,8 +1003,8 @@ namespace bsmd.database
case Message.NotificationClass.PRE72H: result = new PRE72H(); break;
case Message.NotificationClass.MDH: result = new MDH(); break;
case Message.NotificationClass.WAS: result = new WAS(); break;
case Message.NotificationClass.CREW: result = new CREW(); break;
case Message.NotificationClass.PAS: result = new PAS(); break;
case Message.NotificationClass.CREWA: result = new CREW(); break;
case Message.NotificationClass.PASA: result = new PAS(); break;
case Message.NotificationClass.BPOL: result = new BPOL(); break;
case Message.NotificationClass.TOWA: result = new TOWA(); break;
case Message.NotificationClass.TOWD: result = new TOWD(); break;
@ -1041,7 +1042,7 @@ namespace bsmd.database
poi.PrepareLoadCommand(cmd, Message.LoadFilter.BPOL_ID, bpol.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> pois = poi.LoadList(reader);
foreach (PortOfItinerary aPoi in pois)
foreach (PortOfItinerary aPoi in pois.Cast<PortOfItinerary>())
{
bpol.PortOfItineraries.Add(aPoi);
aPoi.BPOL = bpol;
@ -1061,7 +1062,7 @@ namespace bsmd.database
imdg.PrepareLoadCommand(cmd, Message.LoadFilter.HAZ_ID, haz.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> imdgs = imdg.LoadList(reader);
foreach (IMDGPosition imdgPosition in imdgs)
foreach (IMDGPosition imdgPosition in imdgs.Cast<IMDGPosition>())
{
haz.IMDGPositions.Add(imdgPosition);
imdgPosition.HAZ = haz;
@ -1072,7 +1073,7 @@ namespace bsmd.database
subsidiaryRisks.PrepareLoadCommand(srCmd, Message.LoadFilter.IMDG_ID, imdgPosition.Id);
SqlDataReader srReader = this.PerformCommand(srCmd);
List<DatabaseEntity> sRisks = subsidiaryRisks.LoadList(srReader);
foreach (SubsidiaryRisks subsidiaryRisk in sRisks)
foreach (SubsidiaryRisks subsidiaryRisk in sRisks.Cast<SubsidiaryRisks>())
{
imdgPosition.SubsidiaryRiskList.Add(subsidiaryRisk);
subsidiaryRisk.IMDGPosition = imdgPosition;
@ -1085,7 +1086,7 @@ namespace bsmd.database
ibc.PrepareLoadCommand(cmd, Message.LoadFilter.HAZ_ID, haz.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> ibcs = ibc.LoadList(reader);
foreach (IBCPosition ibcPosition in ibcs)
foreach (IBCPosition ibcPosition in ibcs.Cast<IBCPosition>())
{
haz.IBCPositions.Add(ibcPosition);
ibcPosition.HAZ = haz;
@ -1097,7 +1098,7 @@ namespace bsmd.database
igc.PrepareLoadCommand(cmd, Message.LoadFilter.HAZ_ID, haz.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> igcs = igc.LoadList(reader);
foreach (IGCPosition igcPosition in igcs)
foreach (IGCPosition igcPosition in igcs.Cast<IGCPosition>())
{
haz.IGCPositions.Add(igcPosition);
igcPosition.HAZ = haz;
@ -1109,7 +1110,7 @@ namespace bsmd.database
imsbc.PrepareLoadCommand(cmd, Message.LoadFilter.HAZ_ID, haz.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> imsbcs = imsbc.LoadList(reader);
foreach (IMSBCPosition imsbcPosition in imsbcs)
foreach (IMSBCPosition imsbcPosition in imsbcs.Cast<IMSBCPosition>())
{
haz.IMSBCPositions.Add(imsbcPosition);
imsbcPosition.HAZ = haz;
@ -1120,7 +1121,7 @@ namespace bsmd.database
marpol.PrepareLoadCommand(cmd, Message.LoadFilter.HAZ_ID, haz.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> marpols = marpol.LoadList(reader);
foreach (MARPOL_Annex_I_Position marpolPosition in marpols)
foreach (MARPOL_Annex_I_Position marpolPosition in marpols.Cast<MARPOL_Annex_I_Position>())
{
haz.MARPOLPositions.Add(marpolPosition);
marpolPosition.HAZ = haz;
@ -1140,7 +1141,7 @@ namespace bsmd.database
poc30.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID, mdh.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> poc30s = poc30.LoadList(reader);
foreach (PortOfCallLast30Days apoc30 in poc30s)
foreach (PortOfCallLast30Days apoc30 in poc30s.Cast<PortOfCallLast30Days>())
{
mdh.PortOfCallLast30Days.Add(apoc30);
apoc30.MDH = mdh;
@ -1151,7 +1152,7 @@ namespace bsmd.database
smd.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID, mdh.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> smds = smd.LoadList(reader);
foreach(SanitaryMeasuresDetail aSmd in smds)
foreach(SanitaryMeasuresDetail aSmd in smds.Cast<SanitaryMeasuresDetail>())
{
mdh.SanitaryMeasuresDetails.Add(aSmd);
aSmd.MDH = mdh;
@ -1161,7 +1162,7 @@ namespace bsmd.database
sjl.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID, mdh.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> sjls = sjl.LoadList(reader);
foreach(StowawaysJoiningLocation aSjl in sjls)
foreach(StowawaysJoiningLocation aSjl in sjls.Cast<StowawaysJoiningLocation>())
{
mdh.StowawaysJoiningLocations.Add(aSjl);
aSjl.MDH = mdh;
@ -1171,7 +1172,7 @@ namespace bsmd.database
ia.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID, mdh.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> ias = ia.LoadList(reader);
foreach(InfectedArea aIa in ias)
foreach(InfectedArea aIa in ias.Cast<InfectedArea>())
{
mdh.InfectedAreas.Add(aIa);
aIa.MDH = mdh;
@ -1190,7 +1191,7 @@ namespace bsmd.database
poc30s.PrepareLoadCommand(cmd, Message.LoadFilter.POC30_ID, poc30.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> poc30Names = poc30s.LoadList(reader);
foreach (PortOfCallLast30DaysCrewJoinedShip poc30Name in poc30Names)
foreach (PortOfCallLast30DaysCrewJoinedShip poc30Name in poc30Names.Cast<PortOfCallLast30DaysCrewJoinedShip>())
{
poc30.CrewJoinedShip.Add(poc30Name);
poc30Name.PortOfCallLast30Days = poc30;
@ -1208,7 +1209,7 @@ namespace bsmd.database
ltp.PrepareLoadCommand(cmd, Message.LoadFilter.SEC_ID, sec.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> ltps = ltp.LoadList(reader);
foreach (LastTenPortFacilitiesCalled altp in ltps)
foreach (LastTenPortFacilitiesCalled altp in ltps.Cast<LastTenPortFacilitiesCalled>())
{
sec.LastTenPortFacilitesCalled.Add(altp);
altp.SEC = sec;
@ -1219,7 +1220,7 @@ namespace bsmd.database
sts.PrepareLoadCommand(cmd, Message.LoadFilter.SEC_ID, sec.Id);
reader = this.PerformCommand(cmd);
List<DatabaseEntity> stss = sts.LoadList(reader);
foreach (ShipToShipActivitiesDuringLastTenPortFacilitiesCalled asts in stss)
foreach (ShipToShipActivitiesDuringLastTenPortFacilitiesCalled asts in stss.Cast<ShipToShipActivitiesDuringLastTenPortFacilitiesCalled>())
{
sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(asts);
asts.SEC = sec;
@ -1238,7 +1239,7 @@ namespace bsmd.database
wdsp.PrepareLoadCommand(cmd, Message.LoadFilter.WAS_ID, was.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> wdsps = wdsp.LoadList(reader);
foreach (WasteDisposalServiceProvider awdsp in wdsps)
foreach (WasteDisposalServiceProvider awdsp in wdsps.Cast<WasteDisposalServiceProvider>())
{
was.WasteDisposalServiceProvider.Add(awdsp);
awdsp.WAS = was;
@ -1249,7 +1250,7 @@ namespace bsmd.database
waste.PrepareLoadCommand(cmd, Message.LoadFilter.WAS_ID, was.Id);
SqlDataReader reader2 = this.PerformCommand(cmd);
List<DatabaseEntity> wastes = waste.LoadList(reader2);
foreach (Waste aWaste in wastes)
foreach (Waste aWaste in wastes.Cast<Waste>())
{
was.Waste.Add(aWaste);
aWaste.WAS = was;
@ -1268,7 +1269,7 @@ namespace bsmd.database
tfp.PrepareLoadCommand(cmd, Message.LoadFilter.WASRCPT_ID, was_rcpt.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> tfps = tfp.LoadList(reader);
foreach (TreatmentFacilityProvider aTfp in tfps)
foreach (TreatmentFacilityProvider aTfp in tfps.Cast<TreatmentFacilityProvider>())
{
was_rcpt.TreatmentFacilityProvider.Add(aTfp);
aTfp.WAS_RCPT = was_rcpt;
@ -1279,7 +1280,7 @@ namespace bsmd.database
wasteReceived.PrepareLoadCommand(cmd, Message.LoadFilter.WASRCPT_ID, was_rcpt.Id);
SqlDataReader reader2 = this.PerformCommand(cmd);
List<DatabaseEntity> wrs = wasteReceived.LoadList(reader2);
foreach (WasteReceived awrs in wrs)
foreach (WasteReceived awrs in wrs.Cast<WasteReceived>())
{
was_rcpt.WasteReceived.Add(awrs);
awrs.WAS_RCPT = was_rcpt;
@ -1298,7 +1299,7 @@ namespace bsmd.database
cp.PrepareLoadCommand(cmd, Message.LoadFilter.NOA_NODID, noa_nod.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> cps = cp.LoadList(reader);
foreach (CallPurpose callPurpose in cps)
foreach (CallPurpose callPurpose in cps.Cast<CallPurpose>())
{
noa_nod.CallPurposes.Add(callPurpose);
callPurpose.NOA_NOD = noa_nod;
@ -1334,7 +1335,7 @@ namespace bsmd.database
aMessageError.PrepareLoadCommand(cmd, Message.LoadFilter.MESSAGEHEADER, message.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> errorList = aMessageError.LoadList(reader);
foreach (MessageError error in errorList)
foreach (MessageError error in errorList.Cast<MessageError>())
message.ErrorList.Add(error);
}
@ -1345,7 +1346,7 @@ namespace bsmd.database
aMessageViolation.PrepareLoadCommand(cmd, Message.LoadFilter.MESSAGEHEADER, message.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> violationList = aMessageViolation.LoadList(reader);
foreach (MessageViolation violation in violationList)
foreach (MessageViolation violation in violationList.Cast<MessageViolation>())
message.ViolationList.Add(violation);
}
@ -1356,7 +1357,7 @@ namespace bsmd.database
aSystemError.PrepareLoadCommand(cmd, Message.LoadFilter.MESSAGEHEADER, message.Id);
SqlDataReader reader = this.PerformCommand(cmd);
List<DatabaseEntity> systemErrorList = aSystemError.LoadList(reader);
foreach (SystemError sError in systemErrorList)
foreach (SystemError sError in systemErrorList.Cast<SystemError>())
message.SystemErrorList.Add(sError);
}

View File

@ -44,8 +44,8 @@ namespace bsmd.database
NotificationClass.SEC,
NotificationClass.PRE72H,
NotificationClass.BPOL,
NotificationClass.CREW,
NotificationClass.PAS,
NotificationClass.CREWA,
NotificationClass.PASA,
NotificationClass.MDH,
NotificationClass.HAZA,
NotificationClass.HAZD,
@ -87,8 +87,8 @@ namespace bsmd.database
PRE72H,
MDH,
WAS,
CREW, // 20
PAS,
CREWA, // 20
PASA,
BPOL,
TOWA,
TOWD,
@ -610,10 +610,10 @@ namespace bsmd.database
{
case NotificationClass.BKRA:
case NotificationClass.BKRD:
case NotificationClass.CREW:
case NotificationClass.CREWA:
case NotificationClass.CREWD:
case NotificationClass.LADG:
case NotificationClass.PAS:
case NotificationClass.PASA:
case NotificationClass.PASD:
case NotificationClass.SERV:
case NotificationClass.STO:
@ -653,8 +653,6 @@ namespace bsmd.database
break;
case NotificationClass.VISIT:
case NotificationClass.TRANSIT:
case NotificationClass.CREWD:
case NotificationClass.PASD:
case NotificationClass.STO:
result = false;
break;
@ -693,9 +691,9 @@ namespace bsmd.database
case NotificationClass.BKRA: return 5;
case NotificationClass.BKRD: return 5;
case NotificationClass.LADG: return 36;
case NotificationClass.CREW: return 40;
case NotificationClass.CREWA: return 40;
case NotificationClass.CREWD: return 40;
case NotificationClass.PAS: return 40;
case NotificationClass.PASA: return 40;
case NotificationClass.PASD: return 40;
case NotificationClass.TOWA: return 5;
case NotificationClass.TOWD: return 5;
@ -826,8 +824,8 @@ namespace bsmd.database
{
switch (this.MessageNotificationClass)
{
case NotificationClass.CREW:
case NotificationClass.PAS:
case NotificationClass.CREWA:
case NotificationClass.PASA:
return true;
default:
return false;
@ -934,9 +932,9 @@ namespace bsmd.database
/// </summary>
private bool CanDoBulkSave()
{
if(this.MessageNotificationClass == NotificationClass.CREW ||
if(this.MessageNotificationClass == NotificationClass.CREWA ||
this.MessageNotificationClass == NotificationClass.CREWD ||
this.MessageNotificationClass == NotificationClass.PAS ||
this.MessageNotificationClass == NotificationClass.PASA ||
this.MessageNotificationClass == NotificationClass.PASD)
{
foreach (DatabaseEntity subEntity in this.Elements)

View File

@ -11,6 +11,7 @@ using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
namespace bsmd.database
{
@ -56,7 +57,8 @@ namespace bsmd.database
[ShowReport]
[ReportDisplayName("Date of birth")]
public string PassengerDateOfBirthDisplay {
public string PassengerDateOfBirthDisplay
{
get
{
if (this.PassengerDateOfBirth.HasValue)
@ -85,7 +87,7 @@ namespace bsmd.database
[ShowReport]
[ReportDisplayName("Identity document type")]
public string PassengerIdentityDocumentTypeDisplay { get { return Util.GetIdentityDocumentTypeDisplay(this.PassengerIdentityDocumentType); } }
public string PassengerIdentityDocumentTypeDisplay { get { return Util.GetIdentityDocumentTypeDisplay(this.PassengerIdentityDocumentType); } }
[ShowReport]
[ReportDisplayName("Identity document id")]
@ -127,21 +129,31 @@ namespace bsmd.database
public string PassengerIdentityDocumentIssuingState { get; set; }
[ShowReport]
[ReportDisplayName("Expiry date")]
[Validation(ValidationCode.PAST_DATE)]
[ENI2Validation]
public DateTime? PassengerIdentityDocumentExpiryDate { get; set; }
[ShowReport]
[ReportDisplayName("Expiry date")]
public string PassengerIdentityDocumentExpiryDateDisplay
{
get
{
if (this.PassengerIdentityDocumentExpiryDate.HasValue)
return this.PassengerIdentityDocumentExpiryDate.Value.ToShortDateString();
return string.Empty;
}
}
[ENI2Validation]
public bool? NotificationSchengen { get; set; }
[ENI2Validation]
public bool? NotificationPAX { get; set; }
//[Validation(ValidationCode.FLAG_CODE)]
[Validation(ValidationCode.FLAG_CODE)]
[MaxLength(2)]
[ENI2Validation] // XXX - TODO
[ENI2Validation]
public string PassengerCountryOfBirth { get; set; }
[ENI2Validation]
@ -161,7 +173,7 @@ namespace bsmd.database
{
get
{
return PassengerIdentityDocumentType.HasValue && !PassengerIdentityDocumentId.IsNullOrEmpty() &&
return PassengerIdentityDocumentType.HasValue && !PassengerIdentityDocumentId.IsNullOrEmpty() && !PassengerIdentityDocumentIssuingState.IsNullOrEmpty() &&
PassengerIdentityDocumentExpiryDate.HasValue && !PassengerPortOfEmbarkation.IsNullOrEmpty() && !PassengerPortOfDisembarkation.IsNullOrEmpty();
}
}
@ -311,6 +323,8 @@ namespace bsmd.database
return result;
}
public override string Title => "PASA";
#endregion
#region Validation
@ -323,55 +337,77 @@ namespace bsmd.database
if (this.PassengerPortOfDisembarkation != null)
{
if (this.PassengerPortOfDisembarkation.Equals("ZZUKN"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of disembarkation set to ZZUKN", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of disembarkation set to ZZUKN", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if (this.PassengerPortOfEmbarkation != null)
{
if (this.PassengerPortOfEmbarkation.Equals("ZZUKN"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of embarkation set to ZZUKN", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "Port of embarkation set to ZZUKN", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if(this.PassengerIdentityDocumentType.HasValue)
if (this.PassengerIdentityDocumentType.HasValue)
{
if(this.PassengerIdentityDocumentType.Value == 5)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.Tablename));
if (this.PassengerIdentityDocumentType.Value == 5)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Doc. type set to OTHER_LEGAL_IDENTITY_DOCUMENT", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if(this.PassengerNationality != null)
if (this.PassengerNationality != null)
{
if (this.PassengerNationality.Equals("XX"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Nationality set to XX", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if (this.PassengerIdentityDocumentIssuingState != null)
{
if (this.PassengerIdentityDocumentIssuingState.Equals("XX"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id. doc issuing state set to XX", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if (this.PassengerIdentityDocumentExpiryDate.HasValue)
{
if(this.PassengerIdentityDocumentExpiryDate.Equals(new DateTime(2100, 12, 31)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.Tablename));
if (this.PassengerIdentityDocumentExpiryDate.Equals(new DateTime(2100, 12, 31)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Id doc expiry date set to 31/12/2100", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
if ((this.PassengerIdentityDocumentExpiryDate >= CREW.CLAMPMAXDATE) || (this.PassengerIdentityDocumentExpiryDate <= CREW.CLAMPMINDATE))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check identity document expiry date", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Check identity document expiry date", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if(this.PassengerGender.HasValue)
if (this.PassengerGender.HasValue)
{
if(this.PassengerGender == 0)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.Tablename));
if (this.PassengerGender == 0)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gender set to unknown", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
if (this.PassengerDateOfBirth.HasValue)
{
if (this.PassengerDateOfBirth.Value > DateTime.Today)
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
if(this.PassengerDateOfBirth <= CREW.CLAMPMINDATE)
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check date of birth", null, this.Title, this.Identifier, this.Tablename));
if (this.PassengerDateOfBirth <= CREW.CLAMPMINDATE)
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check date of birth", null, this.Title, this.Identifier, this.IsDeparture ? "PASD" : "PASA"));
}
// NSW 7.2 rules
if ((this.NotificationSchengen ?? false) && (!this.HasSchengenDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V202, "Schengen flag set but no data", null, this.Title, null, this.IsDeparture ? "PASD" : "PASA"));
}
if (!(this.NotificationSchengen ?? false) && (this.HasSchengenDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V202, "Schengen data given but flag not set", null, this.Title, null, this.IsDeparture ? "PASD" : "PASA"));
}
if ((this.NotificationPAX ?? false) && (!this.HasPAXDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V203, "PAX flag set but no data", null, this.Title, null, this.IsDeparture ? "PASD" : "PASA"));
}
if (!(this.NotificationPAX ?? false) && (this.HasPAXDetails))
{
errors.Add(RuleEngine.CreateError(ValidationCode.V203, "PAX data given but flag not set", null, this.Title, null, this.IsDeparture ? "PASD" : "PASA"));
}
}
@ -407,7 +443,7 @@ namespace bsmd.database
result.Columns.Add(new DataColumn { ColumnName = "EmergencyContactNumber", DataType = typeof(string), AllowDBNull = true });
result.Columns.Add(new DataColumn { ColumnName = "PassengerCountryOfBirth", DataType = typeof(string), AllowDBNull = true });
foreach (PAS pas in databaseEntities)
foreach (PAS pas in databaseEntities.Cast<PAS>())
{
DataRow row = result.NewRow();
@ -458,6 +494,33 @@ namespace bsmd.database
#endregion
#region public copy func
public void CopyFromPAS(PAS pas)
{
if (pas == null) return;
this.PassengerLastName = pas.PassengerLastName;
this.PassengerFirstName = pas.PassengerFirstName;
this.PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth;
this.PassengerDateOfBirth = pas.PassengerDateOfBirth;
this.PassengerGender = pas.PassengerGender;
this.PassengerNationality = pas.PassengerNationality;
this.PassengerIdentityDocumentType = pas.PassengerIdentityDocumentType;
this.PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId;
this.PassengerVisaNumber = pas.PassengerVisaNumber;
this.PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation;
this.PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation;
this.PassengerInTransit = pas.PassengerInTransit;
this.PassengerIdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState;
this.PassengerIdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate;
this.NotificationSchengen = pas.NotificationSchengen;
this.NotificationPAX = pas.NotificationPAX;
this.PassengerCountryOfBirth = pas.PassengerCountryOfBirth;
this.EmergencyCare = pas.EmergencyCare;
this.EmergencyContactNumber = pas.EmergencyContactNumber;
}
#endregion
}
#region class PASD
@ -488,6 +551,8 @@ namespace bsmd.database
cmd.CommandText = query;
}
public override string Title => "PASD";
public override List<DatabaseEntity> LoadList(System.Data.IDataReader reader)
{
List<DatabaseEntity> result = new List<DatabaseEntity>();

View File

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

View File

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

View File

@ -208,7 +208,7 @@ namespace bsmd.database
if(((value.Length >= 90) && isStandardML) || ((mla.MaxLength == value.Length) && (value.Length > 20) && !isStandardML))
{
// put out a warning this might be truncated
violations.Add(RuleEngine.CreateViolation(ValidationCode.TRUNCATE, property.Name, value, entity.Title, identifier, entity.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.TRUNCATE, property.Name, value, entity.Title, identifier, entity.Title));
}
}
@ -220,7 +220,7 @@ namespace bsmd.database
if (value.MaxLenNoWS() > mwla.MaxWordLength)
{
// put out a warning this might be overflowing in the report
violations.Add(RuleEngine.CreateViolation(ValidationCode.WORDOVERFLOW, property.Name, value, entity.Title, identifier, entity.Tablename));
violations.Add(RuleEngine.CreateViolation(ValidationCode.WORDOVERFLOW, property.Name, value, entity.Title, identifier, entity.Title));
}
}
@ -229,68 +229,68 @@ namespace bsmd.database
switch (validationCode)
{
case ValidationCode.NOT_NULL:
if (value.Length == 0) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (value.Length == 0) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
break;
case ValidationCode.LOCODE:
{
Regex rgx = new Regex("^[A-Z]{2}[A-Z0-9]{3}$");
if (!rgx.IsMatch(value))
{
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
else if (_locodeChecker != null)
{
if (!_locodeChecker(value, LocodeMode.STANDARD))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
}
break;
case ValidationCode.LOCODE_NOPORT:
{
Regex rgx = new Regex("^[A-Z]{2}[A-Z0-9]{3}$");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
if (_locodeChecker != null)
if (!_locodeChecker(value, LocodeMode.NO_PORT_FLAG))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.LOCODE_SSN:
{
Regex rgx = new Regex("^[A-Z]{2}[A-Z0-9]{3}$");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
if (_locodeChecker != null)
if (!_locodeChecker(value, LocodeMode.SSN))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.LOCODE_GER:
{
if(!RuleEngine.gerLocodeList.Contains(value))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.INT_GT_ZERO:
{
if (!Int32.TryParse(value, out int intVal) || intVal <= 0)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.DOUBLE_GT_ZERO:
{
if (!Double.TryParse(value, out double dVal) || dVal <= 0)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.GISIS:
{
Regex rgx = new Regex("[0-9]{4}");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.FLAG_CODE:
{
if(!RuleEngine.NationalityChecker(value))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.OPTIONAL_FLAG_CODE:
@ -298,14 +298,14 @@ namespace bsmd.database
if(!value.IsNullOrEmpty())
{
if (!RuleEngine.NationalityChecker(value))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
}
break;
case ValidationCode.TWO_DIGIT:
{
Regex rgx = new Regex("[0-9]{2}");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.STRING_EXACT_LEN:
@ -313,54 +313,54 @@ namespace bsmd.database
if (!value.IsNullOrEmpty())
{
if (value.Length != maxlen)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
}
break;
case ValidationCode.STRING_MAXLEN:
{
if (value.Length > maxlen)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.STRING_IMOCLASS:
{
Regex rgx = new Regex(@"[1-9]{1}(\.[1-9]{1})?");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.STRING_UNNUMBER:
{
Regex rgx = new Regex("[0-9]{4}");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.DRAUGHT_IMPLAUSIBLE:
{
if (!Double.TryParse(value, out double dVal) || dVal <= 0)
errors.Add(RuleEngine.CreateError(ValidationCode.DOUBLE_GT_ZERO, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(ValidationCode.DOUBLE_GT_ZERO, property.Name, value, entity.Title, identifier, entity.Title));
else
if ((dVal < 20) || (dVal > 150))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
case ValidationCode.TIME_IMPLAUSIBLE:
{
if (value.Length == 0) errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
if (value.Length == 0) errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Title));
if (DateTime.TryParse(value, out DateTime aTime))
{
if ((aTime - DateTime.UtcNow).Minutes > 15)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
}
break;
case ValidationCode.PAST_DATE:
{
if (value.Length == 0) violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
if (value.Length == 0) violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Title));
if (DateTime.TryParse(value, out DateTime aTime))
{
if (aTime < DateTime.UtcNow)
violations.Add(RuleEngine.CreateViolation(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
violations.Add(RuleEngine.CreateViolation(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
}
break;
@ -368,11 +368,11 @@ namespace bsmd.database
{
if(!value.IsNullOrEmpty() && (value.Contains(",")))
{
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
}
if(!value.IsNullOrEmpty() && !value.Trim().Any(char.IsDigit)) // falls "-" oder keine Zahl enthalten, Fehler!
{
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
}
@ -380,25 +380,25 @@ namespace bsmd.database
{
if((value.Length == 0) || (STAT.VesselTypeDict?.ContainsKey(value) == false))
{
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Title));
}
break;
}
case ValidationCode.NOT_NULL_MAX_LEN:
if ((value.Length > maxlen) || (value.Length == 0))
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
break;
case ValidationCode.FRZ:
{
Regex rgx = new Regex("^[A-Z,a-z,0-9]{4,7}$");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
break;
}
case ValidationCode.MMSI:
{
Regex rgx = new Regex("^[0-9]{9}$");
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
if (!rgx.IsMatch(value)) errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
break;
}
case ValidationCode.INVALID_NUMBER_CHARS:
@ -409,7 +409,7 @@ namespace bsmd.database
{
if((elems[i].Length > 50) || (elems[i].IndexOfAny(invalidChars) >= 0))
{
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Title));
break;
}
}
@ -505,20 +505,20 @@ namespace bsmd.database
#region private helper
internal static MessageError CreateError(ValidationCode validationCode, string p, string value, string entityName,
public static MessageError CreateError(ValidationCode validationCode, string property, string value, string entityName,
string identifier = "", string notificationClass = "")
{
MessageError error = new MessageError();
if (identifier.IsNullOrEmpty())
error.FullName = string.Format("{0}.{1}", entityName, p);
error.FullName = string.Format("{0}.{1}", entityName, property);
else
error.FullName = string.Format("{0}.{1}_{2}", entityName, p, identifier);
error.FullName = string.Format("{0}.{1}_{2}", entityName, property, identifier);
error.ErrorCode = (int)validationCode;
error.Identifier = identifier;
error.PropertyName = p;
error.PropertyName = property;
var match = Regex.Match(notificationClass, @"\[*\]\.\[(.*)\]");
if (match.Success)
@ -528,11 +528,11 @@ namespace bsmd.database
if (errorTextList.ContainsKey((int)validationCode))
{
error.ErrorText = string.Format(errorTextList[(int)validationCode], p, value);
error.ErrorText = string.Format(errorTextList[(int)validationCode], property, value);
}
else
{
error.ErrorText = p;
error.ErrorText = property;
if (value != null)
error.ErrorText += " - " + value;
}

View File

@ -51,6 +51,7 @@ namespace bsmd.database
WORDOVERFLOW,
VALUE_TOO_LARGE,
PAST_DATE,
NO_PAX,
V181 = 181,
V182,
E121 = 121,

View File

@ -65,7 +65,7 @@ namespace bsmd.database
_validationFields.AddRange(GetFieldsForClass(typeof(BRKD), true, Message.NotificationClass.BKRD));
_validationFields.AddRange(GetFieldsForClass(typeof(BPOL), false, Message.NotificationClass.BPOL));
_validationFields.AddRange(GetFieldsForClass(typeof(CallPurpose), true, null));
_validationFields.AddRange(GetFieldsForClass(typeof(CREW), true, Message.NotificationClass.CREW));
_validationFields.AddRange(GetFieldsForClass(typeof(CREW), true, Message.NotificationClass.CREWA));
_validationFields.AddRange(GetFieldsForClass(typeof(Customer), false, null));
_validationFields.AddRange(GetFieldsForClass(typeof(HAZ), false, Message.NotificationClass.HAZA));
@ -89,7 +89,7 @@ namespace bsmd.database
_validationFields.AddRange(GetFieldsForClass(typeof(MDH), false, Message.NotificationClass.MDH));
_validationFields.AddRange(GetFieldsForClass(typeof(NAME), false, Message.NotificationClass.NAME));
_validationFields.AddRange(GetFieldsForClass(typeof(NOA_NOD), false, Message.NotificationClass.NOA_NOD));
_validationFields.AddRange(GetFieldsForClass(typeof(PAS), true, Message.NotificationClass.PAS));
_validationFields.AddRange(GetFieldsForClass(typeof(PAS), true, Message.NotificationClass.PASA));
_validationFields.AddRange(GetFieldsForClass(typeof(POBA), false, Message.NotificationClass.POBA));
_validationFields.AddRange(GetFieldsForClass(typeof(POBD), false, Message.NotificationClass.POBD));
_validationFields.AddRange(GetFieldsForClass(typeof(PortArea), true, null));

View File

@ -84,10 +84,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
<HintPath>..\ENI2\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />

View File

@ -117,7 +117,10 @@ namespace bsmd.dbh
public static void SendAndReceive()
{
// sent unsent messages in output folder
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteIncomingFolder, Properties.Settings.Default.OutgoingFolder, dakosy.SFtp.Direction.OUTGOING, Properties.Settings.Default.SFTPOpenCommand);
dakosy.SFtp.TransmitAllFiles(Properties.Settings.Default.RemoteIncomingFolder, Properties.Settings.Default.OutgoingFolder,
Properties.Settings.Default.SFTPHost, Properties.Settings.Default.SFTPUsername, Properties.Settings.Default.SFTPrivateKeyPath, Properties.Settings.Default.SFTPHostKey);
//bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteIncomingFolder, Properties.Settings.Default.OutgoingFolder, dakosy.SFtp.Direction.OUTGOING, Properties.Settings.Default.SFTPOpenCommand);
// move files from output folder to archive folder
foreach(string sentFile in Directory.GetFiles(Properties.Settings.Default.OutgoingFolder))
{
@ -130,7 +133,9 @@ namespace bsmd.dbh
// receive files from remote host
// SFTP verbindung öffnen und alle Dateien herunterladen
bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder, dakosy.SFtp.Direction.INCOMING, Properties.Settings.Default.SFTPOpenCommand);
//bsmd.dakosy.SFtp.TransmitAll(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder, dakosy.SFtp.Direction.INCOMING, Properties.Settings.Default.SFTPOpenCommand);
dakosy.SFtp.ReceiveAllFiles(Properties.Settings.Default.RemoteOutgoingFolder, Properties.Settings.Default.IncomingFolder, Properties.Settings.Default.SFTPHost,
Properties.Settings.Default.SFTPUsername, Properties.Settings.Default.SFTPrivateKeyPath, Properties.Settings.Default.SFTPHostKey);
foreach (string inputFile in Directory.GetFiles(Properties.Settings.Default.IncomingFolder))
{
@ -150,8 +155,9 @@ namespace bsmd.dbh
File.Copy(inputFile, archivePath, true);
File.Delete(inputFile);
}
// remote Dateien löschen
bsmd.dakosy.SFtp.RemoveProcessedFile(Properties.Settings.Default.RemoteOutgoingFolder, Path.GetFileName(inputFile), Properties.Settings.Default.SFTPOpenCommand);
// bsmd.dakosy.SFtp.RemoveProcessedFile(Properties.Settings.Default.RemoteOutgoingFolder, Path.GetFileName(inputFile), Properties.Settings.Default.SFTPOpenCommand);
}
}

View File

@ -12,7 +12,7 @@ namespace bsmd.dbh.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -88,18 +88,7 @@ namespace bsmd.dbh.Properties {
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("dbh")]
public string SFTPOpenCommand {
get {
return ((string)(this["SFTPOpenCommand"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("sftp://f-000333@fx.dbh.de/ -hostkey=\"ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5" +
"fXsUyZsVCSufyATbGKLh+ak\" -privatekey=\"C:\\work\\Services\\SendNSWMessageService\\dbh" +
"\\sshkeynp.ppk\"")]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\temp\\dbh\\in_error")]
public string IncomingErrorFolder {
get {
return ((string)(this["IncomingErrorFolder"]));
@ -114,5 +103,41 @@ namespace bsmd.dbh.Properties {
return ((string)(this["SenderMaersk"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("fx.dbh.de")]
public string SFTPHost {
get {
return ((string)(this["SFTPHost"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\work\\Services\\SendNSWMessageService\\dbh\\sshkeynp.ppk")]
public string SFTPrivateKeyPath {
get {
return ((string)(this["SFTPrivateKeyPath"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5fXsUyZsVCSufyATbGKLh+ak")]
public string SFTPHostKey {
get {
return ((string)(this["SFTPHostKey"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("f-000333")]
public string SFTPUsername {
get {
return ((string)(this["SFTPUsername"]));
}
}
}
}

View File

@ -23,14 +23,23 @@
<Setting Name="RemoteOutgoingFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">test/dbh_2_bsmd</Value>
</Setting>
<Setting Name="SFTPOpenCommand" Type="System.String" Scope="Application">
<Value Profile="(Default)">dbh</Value>
</Setting>
<Setting Name="IncomingErrorFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)">sftp://f-000333@fx.dbh.de/ -hostkey="ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5fXsUyZsVCSufyATbGKLh+ak" -privatekey="C:\work\Services\SendNSWMessageService\dbh\sshkeynp.ppk"</Value>
<Value Profile="(Default)">e:\temp\dbh\in_error</Value>
</Setting>
<Setting Name="SenderMaersk" Type="System.String" Scope="Application">
<Value Profile="(Default)">00006017</Value>
</Setting>
<Setting Name="SFTPHost" Type="System.String" Scope="Application">
<Value Profile="(Default)">fx.dbh.de</Value>
</Setting>
<Setting Name="SFTPrivateKeyPath" Type="System.String" Scope="Application">
<Value Profile="(Default)">C:\work\Services\SendNSWMessageService\dbh\sshkeynp.ppk</Value>
</Setting>
<Setting Name="SFTPHostKey" Type="System.String" Scope="Application">
<Value Profile="(Default)">ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5fXsUyZsVCSufyATbGKLh+ak</Value>
</Setting>
<Setting Name="SFTPUsername" Type="System.String" Scope="Application">
<Value Profile="(Default)">f-000333</Value>
</Setting>
</Settings>
</SettingsFile>

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,8 @@ namespace bsmd.dbh
try
{
Root root = new Root();
root.Version = RootVersion.Item71;
root.SourceDocumentVersion = "7.1";
root.Version = RootVersion.Item72;
root.SourceDocumentVersion = "7.2";
root.Timestamp = DateTime.Now;
string filenameComponent;
@ -461,38 +461,43 @@ namespace bsmd.dbh
#endregion
#region CREW
#region CREWA
case Message.NotificationClass.CREW:
case Message.NotificationClass.CREWA:
{
RootCREW rootCREW = new RootCREW();
RootCREWA rootCREW = new RootCREWA();
rootCREW.CrewMember = new RootCREWCrewMember[message.Elements.Count];
rootCREW.CrewMember = new RootCREWACrewMember[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
CREW crew = message.Elements[i] as CREW;
rootCREW.CrewMember[i] = new RootCREWCrewMember();
rootCREW.CrewMember[i] = new RootCREWACrewMember();
if (crew.CrewMemberDateOfBirth.HasValue)
rootCREW.CrewMember[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value;
rootCREW.CrewMember[i].CrewMemberDuty = crew.CrewMemberDuty;
rootCREW.CrewMember[i].CrewMemberFirstName = crew.CrewMemberFirstName;
rootCREW.CrewMember[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue;
if (crew.CrewMemberGender.HasValue)
rootCREW.CrewMember[i].CrewMemberGender = SetGender(crew.CrewMemberGender.Value);
rootCREW.CrewMember[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
if (crew.CrewMemberIdentityDocumentType.HasValue)
rootCREW.CrewMember[i].CrewMemberIdentityDocumentType = (IdDocType)crew.CrewMemberIdentityDocumentType.Value;
rootCREW.CrewMember[i].CrewMemberLastName = crew.CrewMemberLastName;
rootCREW.CrewMember[i].CrewMemberNationality = crew.CrewMemberNationality;
rootCREW.CrewMember[i].CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
rootCREW.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber;
if (crew.CrewMemberIdentityDocumentIssuingState.Trim().Length == 2)
rootCREW.CrewMember[i].CrewMemberIdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
if (crew.CrewMemberIdentityDocumentExpiryDate.HasValue)
rootCREW.CrewMember[i].CrewMemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate.Value;
rootCREW.CrewMember[i].DateOfBirth = crew.CrewMemberDateOfBirth.Value;
rootCREW.CrewMember[i].DutyOnBoard = crew.CrewMemberDuty;
rootCREW.CrewMember[i].FirstName = crew.CrewMemberFirstName;
rootCREW.CrewMember[i].LastName = crew.CrewMemberLastName;
rootCREW.CrewMember[i].Nationality = crew.CrewMemberNationality;
rootCREW.CrewMember[i].PlaceOfBirth = crew.CrewMemberPlaceOfBirth;
rootCREW.CrewMember[i].CountryOfBirth = crew.CrewMemberCountryOfBirth;
rootCREW.CrewMember[i].Gender = SetGender(crew.CrewMemberGender.Value);
if (crew.NotificationSchengen ?? false)
{
rootCREW.CrewMember[i].DetailsSchengen = new RootCREWACrewMemberDetailsSchengen();
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentId = crew.CrewMemberIdentityDocumentId;
if (crew.CrewMemberIdentityDocumentType.HasValue)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentType = (IdDocType)crew.CrewMemberIdentityDocumentType.Value;
if(!crew.CrewMemberVisaNumber.IsNullOrEmpty())
rootCREW.CrewMember[i].DetailsSchengen.VisaNumber = crew.CrewMemberVisaNumber;
if (crew.CrewMemberIdentityDocumentIssuingState.Trim().Length == 2)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
if (crew.CrewMemberIdentityDocumentExpiryDate.HasValue)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate.Value;
}
}
// rootCREW.ReportingParty = rp;
root.Items = new object[1];
root.Items[0] = rootCREW;
@ -501,41 +506,157 @@ namespace bsmd.dbh
#endregion
#region PAS
case Message.NotificationClass.PAS:
#region CREWD
case Message.NotificationClass.CREWD:
{
RootPAS rootPAS = new RootPAS();
rootPAS.Passenger = new RootPASPassenger[message.Elements.Count];
RootCREWD rootCREW = new RootCREWD();
rootCREW.CrewMember = new RootCREWDCrewMember[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
CREW crew = message.Elements[i] as CREW;
rootCREW.CrewMember[i] = new RootCREWDCrewMember();
if (crew.CrewMemberDateOfBirth.HasValue)
rootCREW.CrewMember[i].DateOfBirth = crew.CrewMemberDateOfBirth.Value;
rootCREW.CrewMember[i].DutyOnBoard = crew.CrewMemberDuty;
rootCREW.CrewMember[i].FirstName = crew.CrewMemberFirstName;
rootCREW.CrewMember[i].LastName = crew.CrewMemberLastName;
rootCREW.CrewMember[i].Nationality = crew.CrewMemberNationality;
rootCREW.CrewMember[i].PlaceOfBirth = crew.CrewMemberPlaceOfBirth;
rootCREW.CrewMember[i].CountryOfBirth = crew.CrewMemberCountryOfBirth;
rootCREW.CrewMember[i].Gender = SetGender(crew.CrewMemberGender.Value);
if (crew.NotificationSchengen ?? false)
{
rootCREW.CrewMember[i].DetailsSchengen = new RootCREWDCrewMemberDetailsSchengen();
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentId = crew.CrewMemberIdentityDocumentId;
if (crew.CrewMemberIdentityDocumentType.HasValue)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentType = (IdDocType)crew.CrewMemberIdentityDocumentType.Value;
if(!crew.CrewMemberVisaNumber.IsNullOrEmpty())
rootCREW.CrewMember[i].DetailsSchengen.VisaNumber = crew.CrewMemberVisaNumber;
if (crew.CrewMemberIdentityDocumentIssuingState.Trim().Length == 2)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
if (crew.CrewMemberIdentityDocumentExpiryDate.HasValue)
rootCREW.CrewMember[i].DetailsSchengen.IdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate.Value;
}
}
root.Items = new object[1];
root.Items[0] = rootCREW;
}
break;
#endregion
#region PASA
case Message.NotificationClass.PASA:
{
RootPASA rootPAS = new RootPASA();
rootPAS.Passenger = new RootPASAPassenger[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
PAS pas = message.Elements[i] as PAS;
rootPAS.Passenger[i] = new RootPASPassenger();
rootPAS.Passenger[i].PassengerLastName = pas.PassengerLastName;
rootPAS.Passenger[i].PassengerFirstName = pas.PassengerFirstName;
rootPAS.Passenger[i].PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth;
rootPAS.Passenger[i] = new RootPASAPassenger();
rootPAS.Passenger[i].LastName = pas.PassengerLastName;
rootPAS.Passenger[i].FirstName = pas.PassengerFirstName;
rootPAS.Passenger[i].PlaceOfBirth = pas.PassengerPlaceOfBirth;
rootPAS.Passenger[i].CountryOfBirth = pas.PassengerCountryOfBirth;
if (pas.PassengerDateOfBirth.HasValue)
rootPAS.Passenger[i].PassengerDateOfBirth = pas.PassengerDateOfBirth.Value;
rootPAS.Passenger[i].PassengerGenderSpecified = pas.PassengerGender.HasValue;
if (pas.PassengerGender.HasValue)
rootPAS.Passenger[i].PassengerGender = SetGender(pas.PassengerGender.Value);
rootPAS.Passenger[i].PassengerNationality = pas.PassengerNationality;
if (pas.PassengerIdentityDocumentType.HasValue)
rootPAS.Passenger[i].PassengerIdentityDocumentType = (IdDocType)pas.PassengerIdentityDocumentType.Value;
rootPAS.Passenger[i].PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId;
rootPAS.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
rootPAS.Passenger[i].PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation;
rootPAS.Passenger[i].PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation;
rootPAS.Passenger[i].PassengerInTransit = pas.PassengerInTransit ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
if (pas.PassengerIdentityDocumentIssuingState.Trim().Length == 2)
rootPAS.Passenger[i].PassengerIdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState;
if (pas.PassengerIdentityDocumentExpiryDate.HasValue)
rootPAS.Passenger[i].PassengerIdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate.Value;
rootPAS.Passenger[i].DateOfBirth = pas.PassengerDateOfBirth.Value;
rootPAS.Passenger[i].Gender = SetGender(pas.PassengerGender.Value);
rootPAS.Passenger[i].Nationality = pas.PassengerNationality;
if (pas.NotificationSchengen ?? false)
{
rootPAS.Passenger[i].DetailsSchengen = new RootPASAPassengerDetailsSchengen();
if (pas.PassengerIdentityDocumentType.HasValue)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentType = (IdDocType)pas.PassengerIdentityDocumentType.Value;
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentId = pas.PassengerIdentityDocumentId;
if(!pas.PassengerVisaNumber.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsSchengen.VisaNumber = pas.PassengerVisaNumber;
rootPAS.Passenger[i].DetailsSchengen.PortOfEmbarkation = pas.PassengerPortOfEmbarkation;
rootPAS.Passenger[i].DetailsSchengen.PortOfDisembarkation = pas.PassengerPortOfDisembarkation;
rootPAS.Passenger[i].DetailsSchengen.InTransit = pas.PassengerInTransit ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
if (pas.PassengerIdentityDocumentIssuingState.Trim().Length == 2)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState;
if (pas.PassengerIdentityDocumentExpiryDate.HasValue)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate.Value;
}
if(pas.NotificationPAX ?? false)
{
rootPAS.Passenger[i].DetailsPAX = new RootPASAPassengerDetailsPAX();
if (!pas.EmergencyCare.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsPAX.EmergencyCare = pas.EmergencyCare;
if (!pas.EmergencyContactNumber.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsPAX.EmergencyContactNumber = pas.EmergencyContactNumber;
}
}
// rootPAS.ReportingParty = rp;
root.Items = new object[1];
root.Items[0] = rootPAS;
}
break;
#endregion
#region PASD
case Message.NotificationClass.PASD:
{
RootPASD rootPAS = new RootPASD();
rootPAS.Passenger = new RootPASDPassenger[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
PAS pas = message.Elements[i] as PAS;
rootPAS.Passenger[i] = new RootPASDPassenger();
rootPAS.Passenger[i].LastName = pas.PassengerLastName;
rootPAS.Passenger[i].FirstName = pas.PassengerFirstName;
rootPAS.Passenger[i].CountryOfBirth = pas.PassengerCountryOfBirth;
rootPAS.Passenger[i].PlaceOfBirth = pas.PassengerPlaceOfBirth;
if (pas.PassengerDateOfBirth.HasValue)
rootPAS.Passenger[i].DateOfBirth = pas.PassengerDateOfBirth.Value;
rootPAS.Passenger[i].Gender = SetGender(pas.PassengerGender.Value);
rootPAS.Passenger[i].Nationality = pas.PassengerNationality;
if (pas.NotificationSchengen ?? false)
{
rootPAS.Passenger[i].DetailsSchengen = new RootPASDPassengerDetailsSchengen();
if (pas.PassengerIdentityDocumentType.HasValue)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentType = (IdDocType)pas.PassengerIdentityDocumentType.Value;
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentId = pas.PassengerIdentityDocumentId;
if (!pas.PassengerVisaNumber.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsSchengen.VisaNumber = pas.PassengerVisaNumber;
rootPAS.Passenger[i].DetailsSchengen.PortOfEmbarkation = pas.PassengerPortOfEmbarkation;
rootPAS.Passenger[i].DetailsSchengen.PortOfDisembarkation = pas.PassengerPortOfDisembarkation;
rootPAS.Passenger[i].DetailsSchengen.InTransit = pas.PassengerInTransit ?? false ? RootSECValidISSCOnBoard.Y : RootSECValidISSCOnBoard.N;
if (pas.PassengerIdentityDocumentIssuingState.Trim().Length == 2)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState;
if (pas.PassengerIdentityDocumentExpiryDate.HasValue)
rootPAS.Passenger[i].DetailsSchengen.IdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate.Value;
}
if (pas.NotificationPAX ?? false)
{
rootPAS.Passenger[i].DetailsPAX = new RootPASDPassengerDetailsPAX();
if (!pas.EmergencyCare.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsPAX.EmergencyCare = pas.EmergencyCare;
if (!pas.EmergencyContactNumber.IsNullOrEmpty())
rootPAS.Passenger[i].DetailsPAX.EmergencyContactNumber = pas.EmergencyContactNumber;
}
}
root.Items = new object[1];
root.Items[0] = rootPAS;
}
break;
#endregion
#region BKRA

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:2.0.50727.9151
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
@ -11,14 +11,14 @@
using System.Xml.Serialization;
//
// This source code was auto-generated by xsd, Version=2.0.50727.312.
// Dieser Quellcode wurde automatisch generiert von xsd, Version=4.8.3928.0.
//
namespace bsmd.dbh.Response
{
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -257,7 +257,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootVersion
@ -265,11 +265,11 @@ namespace bsmd.dbh.Response
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("1.0")]
Item70,
Item72,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootType
@ -292,7 +292,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -318,7 +318,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
public enum ReportingClassCode
{
@ -384,10 +384,16 @@ namespace bsmd.dbh.Response
WAS_RCPT,
/// <remarks/>
CREW,
CREWA,
/// <remarks/>
PAS,
CREWD,
/// <remarks/>
PASA,
/// <remarks/>
PASD,
/// <remarks/>
BPOL,
@ -406,7 +412,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -432,7 +438,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -458,7 +464,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -484,7 +490,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -510,7 +516,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
@ -580,7 +586,7 @@ namespace bsmd.dbh.Response
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.312")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public enum RootMessageType

View File

@ -170,7 +170,11 @@ namespace bsmd.dbh
DBManager.Instance.Save(mv);
break;
case Response.RootMessageType.XSD_ERROR:
// TODO
MessageError me_xsd = new MessageError();
me_xsd.MessageHeaderId = sentMessage.Id.Value;
me_xsd.MessageHeader = sentMessage;
me_xsd.ErrorText = rootMessage.Text;
DBManager.Instance.Save(me_xsd);
break;
case Response.RootMessageType.INFO:
// TODO

View File

@ -28,15 +28,24 @@
<setting name="RemoteOutgoingFolder" serializeAs="String">
<value>test/dbh_2_bsmd</value>
</setting>
<setting name="SFTPOpenCommand" serializeAs="String">
<value>dbh</value>
</setting>
<setting name="IncomingErrorFolder" serializeAs="String">
<value>sftp://f-000333@fx.dbh.de/ -hostkey="ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5fXsUyZsVCSufyATbGKLh+ak" -privatekey="C:\work\Services\SendNSWMessageService\dbh\sshkeynp.ppk"</value>
<value>e:\temp\dbh\in_error</value>
</setting>
<setting name="SenderMaersk" serializeAs="String">
<value>00006017</value>
</setting>
<setting name="SFTPHost" serializeAs="String">
<value>fx.dbh.de</value>
</setting>
<setting name="SFTPrivateKeyPath" serializeAs="String">
<value>C:\work\Services\SendNSWMessageService\dbh\sshkeynp.ppk</value>
</setting>
<setting name="SFTPHostKey" serializeAs="String">
<value>ecdsa-sha2-nistp256 256 453JBU8hAOOQ7wEvmTw5fXsUyZsVCSufyATbGKLh+ak</value>
</setting>
<setting name="SFTPUsername" serializeAs="String">
<value>f-000333</value>
</setting>
</bsmd.dbh.Properties.Settings>
</applicationSettings>
</configuration>

View File

@ -14,3 +14,8 @@ generierten Service-Klassen den Namespace auf "" gesetzt.wsdl.exe war nicht notw
so:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.openuri.org/submit", RequestNamespace="", ResponseElementName="submitResponse", ResponseNamespace="", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
13.11.23
Anpassung Timestamp Root Objekt als String(!) statt serialisiertem DateTime um die Nano-Sekunden
wegzubekommen und die DBH String Formatierung hinzukriegen. War vorher zwar auch nicht so aber Heinz-Dieter hat
es so angemerkt.
Achtung: Bei einer Neugenerierung muss man es vermutlich wieder nachziehen.

View File

@ -49,8 +49,8 @@ namespace bsmd.hisnord
XNamespace servNS = "http://api.national-single-window.de/serv";
XNamespace pre72hNS = "http://api.national-single-window.de/pre72h";
XNamespace wasNS = "http://api.national-single-window.de/was";
XNamespace crewNS = "http://api.national-single-window.de/crew";
XNamespace pasNS = "http://api.national-single-window.de/pas";
XNamespace crewaNS = "http://api.national-single-window.de/crewa";
XNamespace pasaNS = "http://api.national-single-window.de/pasa";
XNamespace bpolNS = "http://api.national-single-window.de/bpol";
XNamespace towaNS = "http://api.national-single-window.de/towa";
XNamespace towdNS = "http://api.national-single-window.de/towd";
@ -206,11 +206,11 @@ namespace bsmd.hisnord
case Message.NotificationClass.WAS:
lookupName = wasNS + "WASResponse";
break;
case Message.NotificationClass.CREW:
lookupName = crewNS + "CREWResponse";
case Message.NotificationClass.CREWA:
lookupName = crewaNS + "CREWAResponse";
break;
case Message.NotificationClass.PAS:
lookupName = pasNS + "PASResponse";
case Message.NotificationClass.PASA:
lookupName = pasaNS + "PASAResponse";
break;
case Message.NotificationClass.BPOL:
lookupName = bpolNS + "BPOLResponse";
@ -294,8 +294,7 @@ namespace bsmd.hisnord
foreach(XElement anElem in elem)
{
MessageViolation mv = new MessageViolation();
int vCode = -1;
if (!Int32.TryParse(anElem.Element(vCodeName).Value, out vCode))
if (!Int32.TryParse(anElem.Element(vCodeName).Value, out int vCode))
_log.WarnFormat("cannot convert violation code to int: {0}", anElem.Element(vCodeName).Value);
else
mv.ViolationCode = vCode;
@ -311,8 +310,7 @@ namespace bsmd.hisnord
foreach (XElement anElem in elem)
{
MessageError me = new MessageError();
int eCode = -1;
if (!Int32.TryParse(anElem.Element(eCodeName).Value, out eCode))
if (!Int32.TryParse(anElem.Element(eCodeName).Value, out int eCode))
_log.WarnFormat("cannot convert error code to int: {0}", anElem.Element(eCodeName).Value);
else
me.ErrorCode = eCode;

View File

@ -1373,56 +1373,70 @@ namespace bsmd.hisnord
#endregion
#region PAS
#region PASA
// TODO: Da bei mir PAS = PASA (keine eigene Meldeklasse) kann das hier erst direkt zum Stichtag umgesetzt werden
if (message.MessageNotificationClass == Message.NotificationClass.PAS)
if (message.MessageNotificationClass == Message.NotificationClass.PASA)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_PAS);
items1ChoiceType.Add(Items1ChoiceType.RESET_PASA);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
global::pastype hn_pastype = new pastype();
PAS apasa = message.Elements[0] as PAS;
global::pas hn_pas = new pas();
hn_pas.Passenger = new passenger[message.Elements.Count];
hn_pastype.NotificationPAX = (apasa.NotificationPAX ?? false) ? yorntype.Y : yorntype.N;
hn_pastype.NotificationSchengen = (apasa.NotificationSchengen ?? false) ? yorntype.Y : yorntype.N;
hn_pastype.Passenger = new pastypePassenger[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
PAS pas = message.Elements[i] as PAS;
pastypePassenger hn_pas = new pastypePassenger();
PAS pasa = message.Elements[i] as PAS;
hn_pas.Passenger[i] = new passenger();
if (pas.PassengerDateOfBirth.HasValue)
hn_pas.Passenger[i].PassengerDateOfBirth = pas.PassengerDateOfBirth.Value;
hn_pas.Passenger[i].PassengerFirstName = pas.PassengerFirstName;
if (pas.PassengerGender.HasValue)
hn_pas.Passenger[i].PassengerGender = GenderTypeFromEnumByte(pas.PassengerGender);
hn_pas.Passenger[i].PassengerGenderSpecified = pas.PassengerGender.HasValue;
hn_pas.Passenger[i].PassengerIdentityDocumentId = pas.PassengerIdentityDocumentId;
if (pas.PassengerIdentityDocumentType.HasValue)
hn_pas.Passenger[i].PassengerIdentityDocumentType = (documenttype)pas.PassengerIdentityDocumentType.Value;
if (pas.PassengerInTransit.HasValue)
hn_pas.Passenger[i].PassengerInTransit = pas.PassengerInTransit.Value ? yorntype.Y : yorntype.N;
hn_pas.Passenger[i].PassengerLastName = pas.PassengerLastName;
hn_pas.Passenger[i].PassengerNationality = pas.PassengerNationality;
hn_pas.Passenger[i].PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth;
hn_pas.Passenger[i].PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation;
hn_pas.Passenger[i].PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation;
if(!pas.PassengerVisaNumber.IsNullOrEmpty())
hn_pas.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
hn_pas.Passenger[i].PassengerIdentityDocumentExpiryDateSpecified = pas.PassengerIdentityDocumentExpiryDate.HasValue;
if (pas.PassengerIdentityDocumentExpiryDate.HasValue)
hn_pas.Passenger[i].PassengerIdentityDocumentExpiryDate = pas.PassengerIdentityDocumentExpiryDate.Value;
if(pas.PassengerIdentityDocumentIssuingState?.Trim().Length == 2)
hn_pas.Passenger[i].PassengerIdentityDocumentIssuingState = pas.PassengerIdentityDocumentIssuingState;
hn_pas.CountryOfBirth = pasa.PassengerCountryOfBirth;
if (pasa.PassengerDateOfBirth.HasValue)
hn_pas.DateOfBirth = pasa.PassengerDateOfBirth.Value;
if (pasa.NotificationPAX ?? false)
{
hn_pas.DetailsPAX = new pastypePassengerDetailsPAX();
hn_pas.DetailsPAX.EmergencyCare = pasa.EmergencyCare;
hn_pas.DetailsPAX.EmergencyContactNumber = pasa.EmergencyContactNumber;
}
if (pasa.NotificationSchengen ?? false)
{
hn_pas.DetailsSchengen = new pastypePassengerDetailsSchengen();
if (pasa.PassengerIdentityDocumentExpiryDate.HasValue)
hn_pas.DetailsSchengen.IdentityDocumentExpiryDate = pasa.PassengerIdentityDocumentExpiryDate.Value;
hn_pas.DetailsSchengen.IdentityDocumentId = pasa.PassengerIdentityDocumentId;
hn_pas.DetailsSchengen.IdentityDocumentIssuingState = pasa.PassengerIdentityDocumentIssuingState;
if (pasa.PassengerIdentityDocumentType.HasValue)
hn_pas.DetailsSchengen.IdentityDocumentType = (documenttype)pasa.PassengerIdentityDocumentType.Value;
hn_pas.DetailsSchengen.InTransit = (pasa.PassengerInTransit ?? false) ? yorntype.Y : yorntype.N;
hn_pas.DetailsSchengen.PortOfDisembarkation = pasa.PassengerPortOfDisembarkation;
hn_pas.DetailsSchengen.PortOfEmbarkation = pasa.PassengerPortOfEmbarkation;
if(!pasa.PassengerVisaNumber.IsNullOrEmpty())
hn_pas.DetailsSchengen.VisaNumber = pasa.PassengerVisaNumber;
}
hn_pas.FirstName = pasa.PassengerFirstName;
if (pasa.PassengerGender.HasValue)
hn_pas.Gender = GenderTypeFromEnumByte(pasa.PassengerGender);
hn_pas.LastName = pasa.PassengerLastName;
hn_pas.Nationality = pasa.PassengerNationality;
hn_pas.PlaceOfBirth = pasa.PassengerPlaceOfBirth;
hn_pastype.Passenger[i] = hn_pas;
}
items1ChoiceType.Add(Items1ChoiceType.PAS);
items1.Add(hn_pas);
items1ChoiceType.Add(Items1ChoiceType.PASA);
items1.Add(hn_pastype);
}
}
}
@ -1477,7 +1491,8 @@ namespace bsmd.hisnord
hn_pas.DetailsSchengen.InTransit = (pasd.PassengerInTransit ?? false) ? yorntype.Y : yorntype.N;
hn_pas.DetailsSchengen.PortOfDisembarkation = pasd.PassengerPortOfDisembarkation;
hn_pas.DetailsSchengen.PortOfEmbarkation = pasd.PassengerPortOfEmbarkation;
hn_pas.DetailsSchengen.VisaNumber = pasd.PassengerVisaNumber;
if(!pasd.PassengerVisaNumber.IsNullOrEmpty())
hn_pas.DetailsSchengen.VisaNumber = pasd.PassengerVisaNumber;
}
hn_pas.FirstName = pasd.PassengerFirstName;
@ -1498,50 +1513,57 @@ namespace bsmd.hisnord
#endregion
#region CREW
#region CREWA
// das ist bei mir dasselbe wie CREWA und muss daher zum Zeitpunkt X geändert werden
// ACHTUNG! CREWA ist bei HIS Nord anders aufgebaut als das CREW hier
if (message.MessageNotificationClass == Message.NotificationClass.CREW)
if (message.MessageNotificationClass == Message.NotificationClass.CREWA)
{
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_CREW);
items1ChoiceType.Add(Items1ChoiceType.RESET_CREWA);
items1.Add(ytype.Y);
}
else
{
if (message.Elements.Count > 0)
{
global::crew hn_crew = new crew();
hn_crew.CrewMember = new crewmember[message.Elements.Count];
global::crewtype hn_crewtype = new crewtype();
CREW acrewa = message.Elements[0] as CREW;
hn_crewtype.NotificationPAX = (acrewa.NotificationPAX ?? false) ? yorntype.Y : yorntype.N;
hn_crewtype.NotificationSchengen = (acrewa.NotificationSchengen ?? false) ? yorntype.Y : yorntype.N;
hn_crewtype.CrewMember = new crewtypeCrewMember[message.Elements.Count];
for (int i = 0; i < message.Elements.Count; i++)
{
CREW crew = message.Elements[i] as CREW;
hn_crew.CrewMember[i] = new crewmember();
if (crew.CrewMemberDateOfBirth.HasValue)
hn_crew.CrewMember[i].CrewMemberDateOfBirth = crew.CrewMemberDateOfBirth.Value;
hn_crew.CrewMember[i].CrewMemberDuty = crew.CrewMemberDuty;
hn_crew.CrewMember[i].CrewMemberFirstName = crew.CrewMemberFirstName;
if (crew.CrewMemberGender.HasValue)
hn_crew.CrewMember[i].CrewMemberGender = GenderTypeFromEnumByte(crew.CrewMemberGender);
hn_crew.CrewMember[i].CrewMemberGenderSpecified = crew.CrewMemberGender.HasValue;
hn_crew.CrewMember[i].CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
if (crew.CrewMemberIdentityDocumentType.HasValue)
hn_crew.CrewMember[i].CrewMemberIdentityDocumentType = (documenttype)crew.CrewMemberIdentityDocumentType.Value;
hn_crew.CrewMember[i].CrewMemberLastName = crew.CrewMemberLastName;
hn_crew.CrewMember[i].CrewMemberNationality = crew.CrewMemberNationality;
hn_crew.CrewMember[i].CrewMemberPlaceOfBirth = crew.CrewMemberPlaceOfBirth;
hn_crew.CrewMember[i].CrewMemberVisaNumber = crew.CrewMemberVisaNumber.IsNullOrEmpty() ? "-" : crew.CrewMemberVisaNumber;
if (crew.CrewMemberIdentityDocumentExpiryDate.HasValue)
hn_crew.CrewMember[i].CrewmemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate.Value;
if(crew.CrewMemberIdentityDocumentIssuingState?.Trim().Length == 2)
hn_crew.CrewMember[i].CrewMemberIdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
crewtypeCrewMember hn_crew = new crewtypeCrewMember();
CREW crewa = message.Elements[i] as CREW;
hn_crew.CountryOfBirth = crewa.CrewMemberCountryOfBirth;
if (crewa.CrewMemberDateOfBirth.HasValue)
hn_crew.DateOfBirth = crewa.CrewMemberDateOfBirth.Value;
if (acrewa.NotificationSchengen ?? false)
{
hn_crew.DetailsSchengen = new crewtypeCrewMemberDetailsSchengen();
if (crewa.CrewMemberIdentityDocumentExpiryDate.HasValue)
hn_crew.DetailsSchengen.IdentityDocumentExpiryDate = crewa.CrewMemberIdentityDocumentExpiryDate.Value;
hn_crew.DetailsSchengen.IdentityDocumentId = crewa.CrewMemberIdentityDocumentId;
hn_crew.DetailsSchengen.IdentityDocumentIssuingState = crewa.CrewMemberIdentityDocumentIssuingState;
if (crewa.CrewMemberIdentityDocumentType.HasValue)
hn_crew.DetailsSchengen.IdentityDocumentType = (documenttype)crewa.CrewMemberIdentityDocumentType.Value;
if(!crewa.CrewMemberVisaNumber.IsNullOrEmpty())
hn_crew.DetailsSchengen.VisaNumber = crewa.CrewMemberVisaNumber;
}
hn_crew.DutyOnBoard = crewa.CrewMemberDuty;
hn_crew.FirstName = crewa.CrewMemberFirstName;
if (crewa.CrewMemberGender.HasValue)
hn_crew.Gender = GenderTypeFromEnumByte(crewa.CrewMemberGender);
hn_crew.LastName = crewa.CrewMemberLastName;
hn_crew.Nationality = crewa.CrewMemberNationality;
hn_crew.PlaceOfBirth = crewa.CrewMemberPlaceOfBirth;
hn_crewtype.CrewMember[i] = hn_crew;
}
items1ChoiceType.Add(Items1ChoiceType.CREW);
items1.Add(hn_crew);
items1ChoiceType.Add(Items1ChoiceType.CREWA);
items1.Add(hn_crewtype);
}
}
}
@ -1583,7 +1605,8 @@ namespace bsmd.hisnord
hn_crew.DetailsSchengen.IdentityDocumentIssuingState = crewd.CrewMemberIdentityDocumentIssuingState;
if (crewd.CrewMemberIdentityDocumentType.HasValue)
hn_crew.DetailsSchengen.IdentityDocumentType = (documenttype)crewd.CrewMemberIdentityDocumentType.Value;
hn_crew.DetailsSchengen.VisaNumber = crewd.CrewMemberVisaNumber;
if(!crewd.CrewMemberVisaNumber.IsNullOrEmpty())
hn_crew.DetailsSchengen.VisaNumber = crewd.CrewMemberVisaNumber;
}
hn_crew.DutyOnBoard = crewd.CrewMemberDuty;
hn_crew.FirstName = crewd.CrewMemberFirstName;

View File

@ -198,7 +198,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("BKRA", typeof(bkra), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("BKRD", typeof(bkrd), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("BPOL", typeof(bpol), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("CREW", typeof(crew), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("CREWA", typeof(crewtype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("CREWD", typeof(crewtype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("HAZA", typeof(haza), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -208,7 +207,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("MDH", typeof(mdh), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("NOANOD", typeof(noanod), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("NameOfMaster", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("PAS", typeof(pas), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("PASA", typeof(pastype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("PASD", typeof(pastype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("POBA", typeof(poba), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -220,7 +218,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("RESET_BKRA", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_BKRD", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_BPOL", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_CREW", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_CREWA", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_CREWD", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_HAZA", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -230,7 +227,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("RESET_MDH", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_NOANOD", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_NameOfMaster", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_PAS", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_PASA", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_PASD", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("RESET_POBA", typeof(ytype), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -1389,204 +1385,6 @@ public enum documenttype {
OTHER_LEGAL_IDENTITY_DOCUMENT,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class crew {
private crewmember[] crewMemberField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("CrewMember", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public crewmember[] CrewMember {
get {
return this.crewMemberField;
}
set {
this.crewMemberField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class crewmember {
private string crewMemberLastNameField;
private string crewMemberFirstNameField;
private string crewMemberPlaceOfBirthField;
private System.DateTime crewMemberDateOfBirthField;
private GenderType crewMemberGenderField;
private bool crewMemberGenderFieldSpecified;
private string crewMemberNationalityField;
private documenttype crewMemberIdentityDocumentTypeField;
private string crewMemberIdentityDocumentIdField;
private string crewMemberIdentityDocumentIssuingStateField;
private System.DateTime crewmemberIdentityDocumentExpiryDateField;
private string crewMemberVisaNumberField;
private string crewMemberDutyField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberLastName {
get {
return this.crewMemberLastNameField;
}
set {
this.crewMemberLastNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberFirstName {
get {
return this.crewMemberFirstNameField;
}
set {
this.crewMemberFirstNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberPlaceOfBirth {
get {
return this.crewMemberPlaceOfBirthField;
}
set {
this.crewMemberPlaceOfBirthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
public System.DateTime CrewMemberDateOfBirth {
get {
return this.crewMemberDateOfBirthField;
}
set {
this.crewMemberDateOfBirthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public GenderType CrewMemberGender {
get {
return this.crewMemberGenderField;
}
set {
this.crewMemberGenderField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool CrewMemberGenderSpecified {
get {
return this.crewMemberGenderFieldSpecified;
}
set {
this.crewMemberGenderFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberNationality {
get {
return this.crewMemberNationalityField;
}
set {
this.crewMemberNationalityField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public documenttype CrewMemberIdentityDocumentType {
get {
return this.crewMemberIdentityDocumentTypeField;
}
set {
this.crewMemberIdentityDocumentTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberIdentityDocumentId {
get {
return this.crewMemberIdentityDocumentIdField;
}
set {
this.crewMemberIdentityDocumentIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberIdentityDocumentIssuingState {
get {
return this.crewMemberIdentityDocumentIssuingStateField;
}
set {
this.crewMemberIdentityDocumentIssuingStateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
public System.DateTime CrewmemberIdentityDocumentExpiryDate {
get {
return this.crewmemberIdentityDocumentExpiryDateField;
}
set {
this.crewmemberIdentityDocumentExpiryDateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberVisaNumber {
get {
return this.crewMemberVisaNumberField;
}
set {
this.crewMemberVisaNumberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CrewMemberDuty {
get {
return this.crewMemberDutyField;
}
set {
this.crewMemberDutyField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
@ -1909,243 +1707,6 @@ public partial class pastypePassengerDetailsPAX {
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class pas {
private passenger[] passengerField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Passenger", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public passenger[] Passenger {
get {
return this.passengerField;
}
set {
this.passengerField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class passenger {
private string passengerLastNameField;
private string passengerFirstNameField;
private string passengerPlaceOfBirthField;
private System.DateTime passengerDateOfBirthField;
private GenderType passengerGenderField;
private bool passengerGenderFieldSpecified;
private string passengerNationalityField;
private documenttype passengerIdentityDocumentTypeField;
private string passengerIdentityDocumentIdField;
private string passengerIdentityDocumentIssuingStateField;
private System.DateTime passengerIdentityDocumentExpiryDateField;
private bool passengerIdentityDocumentExpiryDateFieldSpecified;
private string passengerVisaNumberField;
private string passengerPortOfEmbarkationField;
private string passengerPortOfDisembarkationField;
private yorntype passengerInTransitField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerLastName {
get {
return this.passengerLastNameField;
}
set {
this.passengerLastNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerFirstName {
get {
return this.passengerFirstNameField;
}
set {
this.passengerFirstNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerPlaceOfBirth {
get {
return this.passengerPlaceOfBirthField;
}
set {
this.passengerPlaceOfBirthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
public System.DateTime PassengerDateOfBirth {
get {
return this.passengerDateOfBirthField;
}
set {
this.passengerDateOfBirthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public GenderType PassengerGender {
get {
return this.passengerGenderField;
}
set {
this.passengerGenderField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool PassengerGenderSpecified {
get {
return this.passengerGenderFieldSpecified;
}
set {
this.passengerGenderFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerNationality {
get {
return this.passengerNationalityField;
}
set {
this.passengerNationalityField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public documenttype PassengerIdentityDocumentType {
get {
return this.passengerIdentityDocumentTypeField;
}
set {
this.passengerIdentityDocumentTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerIdentityDocumentId {
get {
return this.passengerIdentityDocumentIdField;
}
set {
this.passengerIdentityDocumentIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerIdentityDocumentIssuingState {
get {
return this.passengerIdentityDocumentIssuingStateField;
}
set {
this.passengerIdentityDocumentIssuingStateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
public System.DateTime PassengerIdentityDocumentExpiryDate {
get {
return this.passengerIdentityDocumentExpiryDateField;
}
set {
this.passengerIdentityDocumentExpiryDateField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool PassengerIdentityDocumentExpiryDateSpecified {
get {
return this.passengerIdentityDocumentExpiryDateFieldSpecified;
}
set {
this.passengerIdentityDocumentExpiryDateFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerVisaNumber {
get {
return this.passengerVisaNumberField;
}
set {
this.passengerVisaNumberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerPortOfEmbarkation {
get {
return this.passengerPortOfEmbarkationField;
}
set {
this.passengerPortOfEmbarkationField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PassengerPortOfDisembarkation {
get {
return this.passengerPortOfDisembarkationField;
}
set {
this.passengerPortOfDisembarkationField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public yorntype PassengerInTransit {
get {
return this.passengerInTransitField;
}
set {
this.passengerInTransitField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")]
[System.SerializableAttribute()]
@ -6448,9 +6009,6 @@ public enum Items1ChoiceType {
/// <remarks/>
BPOL,
/// <remarks/>
CREW,
/// <remarks/>
CREWA,
@ -6478,9 +6036,6 @@ public enum Items1ChoiceType {
/// <remarks/>
NameOfMaster,
/// <remarks/>
PAS,
/// <remarks/>
PASA,
@ -6514,9 +6069,6 @@ public enum Items1ChoiceType {
/// <remarks/>
RESET_BPOL,
/// <remarks/>
RESET_CREW,
/// <remarks/>
RESET_CREWA,
@ -6544,9 +6096,6 @@ public enum Items1ChoiceType {
/// <remarks/>
RESET_NameOfMaster,
/// <remarks/>
RESET_PAS,
/// <remarks/>
RESET_PASA,

View File

@ -1,9 +1,17 @@
1) copyprod.cmd ausführen (damit app.config richtig überschrieben wird)
2) Prüfen ob das ENI App logo richtig ist
3) VS: Publish: Folder Location und Url richtig auswählen
4) Signing: "Sign the ClickOnce manifests": Hier für Prod das Zertifikat
Schiffsmelder CA auswählen, das am 02/24 abläuft.
Auswahl über "Select from Store.."
5) Release Build einstellen
6) komplett neu bauen (clean!)
7) In Description bei Product name "ENI" statt "ENI Testversion"
8) MainWindow.xaml: "ENI 2 Testversion" -> "ENI 2"
9) ENI2 Project Properties -> Application -> Assembly Name: "ENI2Test" -> "ENI2"
10) Wo Ressourcen verwendet werden in XAML Referenz umbiegen: "/ENI2Test;" -> "/ENI2;"