CREW/PAS Import und viele kleine Fehlerkorrekturen!

This commit is contained in:
Daniel Schick 2017-08-16 16:57:23 +00:00
parent c6d021ad60
commit 551ecb3332
28 changed files with 713 additions and 71 deletions

View File

@ -26,12 +26,12 @@
<value>1000</value> <value>1000</value>
</setting> </setting>
<setting name="LockingServerAddress" serializeAs="String"> <setting name="LockingServerAddress" serializeAs="String">
<!--value>http://192.168.2.4/LockingService/LockingService.svc</value--> <value>http://192.168.2.4/LockingService/LockingService.svc</value>
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value> <!--value>http://heupferd/bsmd.LockingService/LockingService.svc</value-->
</setting> </setting>
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<!--value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value--> <value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
<value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value> <!--value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
</setting> </setting>
</ENI2.Properties.Settings> </ENI2.Properties.Settings>
</applicationSettings> </applicationSettings>

View File

@ -164,12 +164,7 @@ namespace ENI2
{ {
foreach (Message message in currentControl.ControlMessages) foreach (Message message in currentControl.ControlMessages)
{ {
if (message.IsDirty) this.SaveMessage(message);
{
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
}
} }
this.buttonSave.Visibility = Visibility.Hidden; this.buttonSave.Visibility = Visibility.Hidden;
@ -179,7 +174,18 @@ namespace ENI2
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(currentControl.Core);
} }
} }
}
}
private void SaveMessage(Message message)
{
if (message.IsDirty)
{
if ((message.Status == Message.MessageStatus.ACCEPTED) && (message.InternalStatus == Message.BSMDStatus.CONFIRMED))
message.InternalStatus = Message.BSMDStatus.UPDATED;
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
} }
} }
@ -191,15 +197,10 @@ namespace ENI2
{ {
foreach(Message message in this._messages) foreach(Message message in this._messages)
{ {
if (message.IsDirty) this.SaveMessage(message);
{
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
this.buttonSaveAll.Visibility = Visibility.Hidden;
this.buttonSave.Visibility = Visibility.Hidden;
}
} }
this.buttonSaveAll.Visibility = Visibility.Hidden;
this.buttonSave.Visibility = Visibility.Hidden;
} }
} }

View File

@ -48,7 +48,12 @@
<TabItem Header="{x:Static p:Resources.textTabCrewList}" Name="tabCrewList"> <TabItem Header="{x:Static p:Resources.textTabCrewList}" Name="tabCrewList">
<GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}"> <GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}">
<Grid> <Grid>
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Name="buttonImportExcelCrew" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0"> SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> <DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
@ -69,7 +74,12 @@
<TabItem Header="{x:Static p:Resources.textTabPassengerList}" Name="tabPassengerList"> <TabItem Header="{x:Static p:Resources.textTabPassengerList}" Name="tabPassengerList">
<GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}"> <GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}">
<Grid> <Grid>
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<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" />
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0"> SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> <DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />

View File

@ -2,10 +2,16 @@
// Description: Detailansicht für BPOL, CREW(D), PAS(D) // Description: Detailansicht für BPOL, CREW(D), PAS(D)
// //
using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Win32;
using System.Windows; using System.Windows;
using System.IO;
using System.Windows.Controls; using System.Windows.Controls;
using ENI2.EditControls; using ENI2.EditControls;
using ENI2.Util;
using bsmd.ExcelReadService;
using ExcelDataReader;
using bsmd.database; using bsmd.database;
@ -330,5 +336,138 @@ namespace ENI2.DetailViewControls
#endregion #endregion
#region Excel import
private string getValueAsString(IExcelDataReader reader, int index)
{
Type fieldType = reader.GetFieldType(index);
if (fieldType == null) return null;
if (fieldType == typeof(double))
return reader.GetDouble(index).ToString();
if (fieldType == typeof(int))
return reader.GetInt32(index).ToString();
return reader.GetString(index);
}
private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if(ofd.ShowDialog() ?? false)
{
using (var stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read))
{
using (var reader = ExcelReaderFactory.CreateReader(stream))
{
List<CREW> importCrew = new List<CREW>();
try
{
do
{
while (reader.Read())
{
CREW crew = new CREW();
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
if (!reader.IsDBNull(3)) crew.CrewMemberNationality = reader.GetString(3).Substring(0, 2);
if (!reader.IsDBNull(4)) crew.CrewMemberDuty = reader.GetString(4);
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
if (!reader.IsDBNull(6))
{
crew.CrewMemberDateOfBirth = reader.GetDateTime(6);
}
if (!reader.IsDBNull(7)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(7));
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 8);
if (!reader.IsDBNull(9)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 9);
crew.MessageHeader = this._crewMessage;
crew.Identifier = CREW.GetNewIdentifier(this._crewMessage.Elements);
importCrew.Add(crew);
}
} while (reader.NextResult());
}
catch(Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
if(importCrew.Count > 0)
{
this._crewMessage.Elements.AddRange(importCrew);
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
}
}
}
}
private void buttonImportExcelPassenger_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if (ofd.ShowDialog() ?? false)
{
using (var stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read))
{
using (var reader = ExcelReaderFactory.CreateReader(stream))
{
List<PAS> importPassenger = new List<PAS>();
try
{
do
{
while (reader.Read())
{
PAS pas = new PAS();
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetString(0);
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetString(1);
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
if (!reader.IsDBNull(3)) pas.PassengerNationality = reader.GetString(3).Substring(0, 2);
if (!reader.IsDBNull(4)) pas.PassengerPortOfEmbarkation = reader.GetString(4);
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
pas.PassengerPortOfEmbarkation = null;
if (!reader.IsDBNull(5)) pas.PassengerPortOfDisembarkation = reader.GetString(5);
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
pas.PassengerPortOfDisembarkation = null;
if (!reader.IsDBNull(6)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(6));
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
if (!reader.IsDBNull(8))
{
pas.PassengerDateOfBirth = reader.GetDateTime(8);
}
if (!reader.IsDBNull(9)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(9));
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 10);
if (!reader.IsDBNull(11)) pas.PassengerVisaNumber = this.getValueAsString(reader, 11);
pas.MessageHeader = this._pasMessage;
pas.Identifier = PAS.GetNewIdentifier(this._pasMessage.Elements);
importPassenger.Add(pas);
}
} while (reader.NextResult());
}
catch (Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
if (importPassenger.Count > 0)
{
this._pasMessage.Elements.AddRange(importPassenger);
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
}
}
}
}
#endregion
} }
} }

View File

@ -65,29 +65,22 @@
<CheckBox Name="checkSimplification" IsChecked="{Binding MDHSimplification}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkSimplification" IsChecked="{Binding MDHSimplification}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<enictrl:LocodeControl x:Name="locodePortWhereHealthDeclarationWasGiven" Grid.Row="1" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteMDHNotified}" />
<CheckBox Name="checkBoxHavePersonsDied" IsChecked="{Binding NonAccidentalDeathsDuringVoyage}" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxHavePersonsDied" IsChecked="{Binding NonAccidentalDeathsDuringVoyage}" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"/>
<xctk:IntegerUpDown Name="integerUpDownNumberOfDeaths" Grid.Row="3" Grid.Column="3" Value="{Binding NonAccidentalDeathsDuringVoyageCount}" Margin="2" ShowButtonSpinner="False" />
<CheckBox Name="checkBoxIsSuspectedInfectious" IsChecked="{Binding SuspisionInfectiousNature}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxIsSuspectedInfectious" IsChecked="{Binding SuspisionInfectiousNature}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxTotalNumberSickHigherThan" IsChecked="{Binding NumberOfIllPersonsHigherThanExpected}" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxTotalNumberSickHigherThan" IsChecked="{Binding NumberOfIllPersonsHigherThanExpected}" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center"/>
<xctk:IntegerUpDown Name="integerUpDownNumberOfIllPersons" Grid.Row="7" Grid.Column="3" Value="{Binding NumberOfIllPersons}" Margin="2" ShowButtonSpinner="False" />
<CheckBox Name="checkBoxSickPersonsOnBoard" IsChecked="{Binding SickPersonsOnBoard}" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxSickPersonsOnBoard" IsChecked="{Binding SickPersonsOnBoard}" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxWasMedicalConsulted" IsChecked="{Binding MedicalConsulted}" Grid.Row="8" Grid.Column="3" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxAwareOfConditions" IsChecked="{Binding AwareOfFurtherInfections}" Grid.Row="9" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxAwareOfConditions" IsChecked="{Binding AwareOfFurtherInfections}" Grid.Row="9" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxStowawaysOnBoard" IsChecked="{Binding StowawaysDetected}" Grid.Row="11" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxStowawaysOnBoard" IsChecked="{Binding StowawaysDetected}" Grid.Row="11" Grid.Column="1" VerticalAlignment="Center"/>
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" />
<CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxSickAnimalsOrPets" IsChecked="{Binding SickAnimalOrPetOnBoard}" Grid.Row="12" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxSanitaryControlExemption" IsChecked="{Binding ValidSanitaryControlExemptionOrCertificateOnBoard}" Grid.Row="13" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxReinspectionSanitary" IsChecked="{Binding SanitaryControlReinspectionRequired}" Grid.Row="15" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxWasMedicalConsulted" IsChecked="{Binding MedicalConsulted}" Grid.Row="8" Grid.Column="3" VerticalAlignment="Center"/>
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" /> <TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" />
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" /> <DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding DateOfIssue}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" />
<CheckBox Name="checkBoxReinspectionSanitary" IsChecked="{Binding SanitaryControlReinspectionRequired}" Grid.Row="15" Grid.Column="1" VerticalAlignment="Center"/>
<DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" />
<enictrl:LocodeControl x:Name="locodePortWhereHealthDeclarationWasGiven" Grid.Row="1" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteMDHNotified}" />
<xctk:IntegerUpDown Name="integerUpDownNumberOfDeaths" Grid.Row="3" Grid.Column="3" Value="{Binding NonAccidentalDeathsDuringVoyageCount}" Margin="2" ShowButtonSpinner="False" />
<xctk:IntegerUpDown Name="integerUpDownNumberOfIllPersons" Grid.Row="7" Grid.Column="3" Value="{Binding NumberOfIllPersons}" Margin="2" ShowButtonSpinner="False" />
</Grid> </Grid>
</GroupBox> </GroupBox>
</TabItem> </TabItem>

View File

@ -53,6 +53,30 @@ namespace ENI2.DetailViewControls
_mdhMessage.Elements.Add(mdh); _mdhMessage.Elements.Add(mdh);
} }
#region Checkbox enable / disable controls
this.checkBoxHasShipVisited.Checked += CheckBoxHasShipVisited_Checked;
this.checkBoxHasShipVisited.Unchecked += CheckBoxHasShipVisited_Checked;
this.CheckBoxHasShipVisited_Checked(null, null);
this.checkBoxHavePersonsDied.Checked += CheckBoxHavePersonsDied_Checked;
this.checkBoxHavePersonsDied.Unchecked += CheckBoxHavePersonsDied_Checked;
this.CheckBoxHavePersonsDied_Checked(null, null);
this.checkBoxTotalNumberSickHigherThan.Checked += CheckBoxTotalNumberSickHigherThan_Checked;
this.checkBoxTotalNumberSickHigherThan.Unchecked += CheckBoxTotalNumberSickHigherThan_Checked;
this.CheckBoxTotalNumberSickHigherThan_Checked(null, null);
this.checkBoxStowawaysOnBoard.Checked += CheckBoxStowawaysOnBoard_Checked;
this.checkBoxStowawaysOnBoard.Unchecked += CheckBoxStowawaysOnBoard_Checked;
this.CheckBoxStowawaysOnBoard_Checked(null, null);
this.checkBoxSanitaryControlExemption.Checked += CheckBoxSanitaryControlExemption_Checked;
this.checkBoxSanitaryControlExemption.Unchecked += CheckBoxSanitaryControlExemption_Checked;
this.CheckBoxSanitaryControlExemption_Checked(null, null);
#endregion
this.portCallGroupBox.DataContext = mdh; this.portCallGroupBox.DataContext = mdh;
this._mdh = mdh; this._mdh = mdh;
@ -65,8 +89,7 @@ namespace ENI2.DetailViewControls
this.dataGridInfectedAreas.Initialize(); this.dataGridInfectedAreas.Initialize();
this.dataGridInfectedAreas.IsReadOnly = !(mdh.InfectedAreaVisited ?? false); this.dataGridInfectedAreas.IsReadOnly = !(mdh.InfectedAreaVisited ?? false);
this.checkBoxHasShipVisited.Checked += CheckBoxHasShipVisited_Checked;
this.checkBoxHasShipVisited.Unchecked += CheckBoxHasShipVisited_Checked;
this.dataGridInfectedAreas.ItemsSource = mdh.InfectedAreas; this.dataGridInfectedAreas.ItemsSource = mdh.InfectedAreas;
this.dataGridInfectedAreas.AddingNewItem += DataGridInfectedAreas_AddingNewItem; this.dataGridInfectedAreas.AddingNewItem += DataGridInfectedAreas_AddingNewItem;
this.dataGridInfectedAreas.EditRequested += DataGridInfectedAreas_EditRequested; this.dataGridInfectedAreas.EditRequested += DataGridInfectedAreas_EditRequested;
@ -83,10 +106,73 @@ namespace ENI2.DetailViewControls
this.dataGridSanitaryMeasures.DeleteRequested += DataGridSanitaryMeasures_DeleteRequested; this.dataGridSanitaryMeasures.DeleteRequested += DataGridSanitaryMeasures_DeleteRequested;
this.dataGridSanitaryMeasures.CreateRequested += DataGridSanitaryMeasures_CreateRequested; this.dataGridSanitaryMeasures.CreateRequested += DataGridSanitaryMeasures_CreateRequested;
this.checkSimplification.Checked += CheckSimplification_Checked;
this.checkSimplification.Unchecked += CheckSimplification_Checked;
#endregion #endregion
} }
private void CheckBoxHasShipVisited_Checked1(object sender, RoutedEventArgs e)
{
throw new System.NotImplementedException();
}
private void CheckBoxSanitaryControlExemption_Checked(object sender, RoutedEventArgs e)
{
this.textBoxPlaceOfIssue.IsEnabled = this.checkBoxSanitaryControlExemption.IsChecked ?? false;
this.textBoxPlaceOfIssue.IsReadOnly = !(this.checkBoxSanitaryControlExemption.IsChecked ?? false);
this.datePickerDateOfIssue.IsEnabled = this.checkBoxSanitaryControlExemption.IsChecked ?? false;
this.checkBoxReinspectionSanitary.IsEnabled = this.checkBoxSanitaryControlExemption.IsChecked ?? false;
}
private void CheckBoxStowawaysOnBoard_Checked(object sender, RoutedEventArgs e)
{
this.textBoxStowawaysJoiningLocation.IsEnabled = this.checkBoxStowawaysOnBoard.IsChecked ?? false;
this.textBoxStowawaysJoiningLocation.IsReadOnly = !(this.checkBoxStowawaysOnBoard.IsChecked ?? false);
}
private void CheckBoxTotalNumberSickHigherThan_Checked(object sender, RoutedEventArgs e)
{
this.integerUpDownNumberOfIllPersons.IsEnabled = this.checkBoxTotalNumberSickHigherThan.IsChecked ?? false;
this.integerUpDownNumberOfDeaths.IsReadOnly = !(this.checkBoxTotalNumberSickHigherThan.IsChecked ?? false);
}
private void CheckBoxHavePersonsDied_Checked(object sender, RoutedEventArgs e)
{
this.integerUpDownNumberOfDeaths.IsEnabled = this.checkBoxHavePersonsDied.IsChecked ?? false;
this.integerUpDownNumberOfDeaths.IsReadOnly = !(this.checkBoxHavePersonsDied.IsChecked ?? false);
}
private void CheckSimplification_Checked(object sender, RoutedEventArgs e)
{
bool simplified = this.checkSimplification.IsChecked ?? false;
this.locodePortWhereHealthDeclarationWasGiven.IsEnabled = simplified;
this.checkBoxAwareOfConditions.IsEnabled = !simplified;
this.checkBoxHasShipVisited.IsEnabled = !simplified;
this.checkBoxHavePersonsDied.IsEnabled = !simplified;
this.checkBoxIsSuspectedInfectious.IsEnabled = !simplified;
this.checkBoxReinspectionSanitary.IsEnabled = !simplified;
this.checkBoxSanitaryControlExemption.IsEnabled = !simplified;
this.checkBoxSanitaryMeasuresApplied.IsEnabled = !simplified;
this.checkBoxSickAnimalsOrPets.IsEnabled = !simplified;
this.checkBoxSickPersonsOnBoard.IsEnabled = !simplified;
this.checkBoxStowawaysOnBoard.IsEnabled = !simplified;
this.checkBoxTotalNumberSickHigherThan.IsEnabled = !simplified;
this.checkBoxWasMedicalConsulted.IsEnabled = !simplified;
this.dataGridInfectedAreas.IsEnabled = !simplified;
this.dataGridPortOfCallLast30Days.IsEnabled = !simplified;
this.dataGridSanitaryMeasures.IsEnabled = !simplified;
this.datePickerDateOfIssue.IsEnabled = !simplified;
this.textBoxPlaceOfIssue.IsEnabled = !simplified;
this.textBoxStowawaysJoiningLocation.IsEnabled = !simplified;
this.integerUpDownNumberOfDeaths.IsEnabled = !simplified;
this.integerUpDownNumberOfIllPersons.IsEnabled = !simplified;
}
private void CheckBoxHasShipVisited_Checked(object sender, RoutedEventArgs e) private void CheckBoxHasShipVisited_Checked(object sender, RoutedEventArgs e)
{ {
this.dataGridInfectedAreas.IsReadOnly = !(this.checkBoxHasShipVisited.IsChecked ?? false); this.dataGridInfectedAreas.IsReadOnly = !(this.checkBoxHasShipVisited.IsChecked ?? false);

View File

@ -193,6 +193,13 @@
</Style> </Style>
</DataGridTextColumn.ElementStyle> </DataGridTextColumn.ElementStyle>
</DataGridTextColumn> </DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textReceivedAt}" Binding="{Binding ReceivedAt}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.5*"> <DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.5*">
<DataGridTextColumn.ElementStyle> <DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">

View File

@ -35,7 +35,7 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion> <MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>4</ApplicationRevision> <ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>3.6.12.%2a</ApplicationVersion> <ApplicationVersion>3.6.12.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
@ -93,16 +93,19 @@
<SignManifests>true</SignManifests> <SignManifests>true</SignManifests>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ExcelDataReader, Version=3.1.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.1.0\lib\net45\ExcelDataReader.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> <HintPath>packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.105.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.105.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\System.Data.SQLite.Core.1.0.105.0\lib\net451\System.Data.SQLite.dll</HintPath> <HintPath>packages\System.Data.SQLite.Core.1.0.105.2\lib\net451\System.Data.SQLite.dll</HintPath>
<Private>True</Private> <Private>True</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
@ -120,28 +123,28 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.AvalonDock, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Xceed.Wpf.DataGrid, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.DataGrid, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL"> <Reference Include="Xceed.Wpf.Toolkit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath> <HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
@ -278,6 +281,9 @@
<Compile Include="EditControls\ErrorListDialog.xaml.cs"> <Compile Include="EditControls\ErrorListDialog.xaml.cs">
<DependentUpon>ErrorListDialog.xaml</DependentUpon> <DependentUpon>ErrorListDialog.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="EditControls\NewWithIdDialog.xaml.cs">
<DependentUpon>NewWithIdDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\SimplePropertyViewDialog.xaml.cs"> <Compile Include="EditControls\SimplePropertyViewDialog.xaml.cs">
<DependentUpon>SimplePropertyViewDialog.xaml</DependentUpon> <DependentUpon>SimplePropertyViewDialog.xaml</DependentUpon>
</Compile> </Compile>
@ -462,6 +468,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="EditControls\NewWithIdDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\SimplePropertyViewDialog.xaml"> <Page Include="EditControls\SimplePropertyViewDialog.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -570,6 +580,7 @@
<Resource Include="Resources\hand_point.png" /> <Resource Include="Resources\hand_point.png" />
<Resource Include="Resources\nav_refresh_green.png" /> <Resource Include="Resources\nav_refresh_green.png" />
<Resource Include="Resources\recycle.png" /> <Resource Include="Resources\recycle.png" />
<Resource Include="Resources\check.png" />
<Content Include="x64\SQLite.Interop.dll"> <Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
@ -704,12 +715,12 @@
<WCFMetadataStorage Include="Service References\LockingServiceReference\" /> <WCFMetadataStorage Include="Service References\LockingServiceReference\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets')" /> <Import Project="packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.Data.SQLite.Core.1.0.105.0\build\net451\System.Data.SQLite.Core.targets'))" /> <Error Condition="!Exists('packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -0,0 +1,61 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.NewWithIdDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
Title="{x:Static p:Resources.textNewWithId}" Height="192" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize">
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="28" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textVisitTransitId}" />
<TextBox Name="textBoxVisitTransitId" Margin="2" Grid.Row="0" Grid.Column="1" TextChanged="textBoxVisitTransitId_TextChanged"/>
<Image Grid.Row="0" Grid.Column="2" Name="okCheckMark" Source="pack://application:,,,/Resources/check.png" Margin="2" Visibility="Hidden" />
<Label Name="labelIMO" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textIMO}" />
<Label Name="labelENI" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textENI}" />
<Label Name="labelETA" Grid.Row="3" Grid.Column="0" Content="ETA" />
<xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True"
ShowButtonSpinner="False"
AllowSpin="True"
AllowTextInput="True"
IsReadOnly="False"
MouseWheelActiveOnFocus="True"
FormatString="G"
Increment="1"
DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer"
Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged"/>
<xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True"
ShowButtonSpinner="False"
AllowSpin="True"
AllowTextInput="True"
IsReadOnly="False"
MouseWheelActiveOnFocus="True"
FormatString="00000000"
Increment="1"
DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer"
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged"/>
<DatePicker Name="datePickerETA" Grid.Row="3" Grid.Column="1" Margin="2" Grid.ColumnSpan="2"
SelectedDateChanged="datePickerETA_SelectedDateChanged" />
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,81 @@
// Copyright (c) 2017 schick Informatik
// Description: Simpler Eingabedialog zur Anlage einer Anmeldung mit einer bekannten VIsit/Transit Id
//
//
using System.Windows;
using System.Windows.Controls;
using ENI2.Controls;
using System;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for NewWithIdDialog.xaml
/// </summary>
public partial class NewWithIdDialog : EditWindowBase
{
public NewWithIdDialog()
{
InitializeComponent();
Loaded += NewWithIdDialog_Loaded;
}
private void NewWithIdDialog_Loaded(object sender, RoutedEventArgs e)
{
this.EnableOK(false);
}
public bool ValidId { get; set; }
public string VisitTransitId { get { return this.textBoxVisitTransitId.Text; } }
public string IMO { get { if (this.doubleUpDownIMO.Value.HasValue) return this.doubleUpDownIMO.Value.ToString(); else return null; } }
public string ENI { get { if (this.doubleUpDownENI.Value.HasValue) return this.doubleUpDownENI.Value.ToString(); else return null; } }
public DateTime? ETA { get { return this.datePickerETA.SelectedDate; } }
private void textBoxVisitTransitId_TextChanged(object sender, TextChangedEventArgs e)
{
this.CheckComplete();
}
private void CheckComplete()
{
bool isComplete = true;
bool isValidId = bsmd.database.Util.IsVisitId(textBoxVisitTransitId.Text) || bsmd.database.Util.IsTransitId(textBoxVisitTransitId.Text);
this.okCheckMark.Visibility = isValidId ? Visibility.Visible : Visibility.Hidden;
isComplete &= isValidId;
isComplete &= this.datePickerETA.SelectedDate.HasValue; // ETA
bool imo_OR_eni = ((doubleUpDownIMO.Value.HasValue) && (doubleUpDownIMO.Value >= 1000000) && (doubleUpDownIMO.Value <= 9999999)) ||
((doubleUpDownENI.Value.HasValue) && (doubleUpDownENI.Value >= 100000) && (doubleUpDownENI.Value <= 99999999));
isComplete &= imo_OR_eni;
this.EnableOK(isComplete);
this.ValidId = isComplete;
}
private void datePickerETA_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
{
this.CheckComplete();
}
private void doubleUpDownENI_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
this.CheckComplete();
}
private void doubleUpDownIMO_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
this.CheckComplete();
}
}
}

View File

@ -57,11 +57,13 @@
<ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image Grid.Column="0" x:Name="logoImage" HorizontalAlignment="Left" Height="75" Width="75" Source="Resources/EUREPORT.png" Stretch="Fill" MouseUp="logoImage_MouseUp" Margin="2"/> <Image Grid.Column="0" x:Name="logoImage" HorizontalAlignment="Left" Height="75" Width="75" Source="Resources/EUREPORT.png" Stretch="Fill" MouseUp="logoImage_MouseUp" Margin="2"/>
<Button Grid.Column="1" x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="buttonNewTransitIdClick" Background="Transparent" Margin="2"/> <Button Grid.Column="1" x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="buttonNewTransitIdClick" Background="Transparent" Margin="2"/>
<Button Grid.Column="2" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="buttonUserAdmin_Click" Background="Transparent" Visibility="Hidden" Margin="2"/> <Button Grid.Column="2" x:Name="buttonNewWithId" Content="{x:Static p:Resources.textNewWithId}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="buttonNewWithIdClick" Background="Transparent" Margin="2"/>
<Button Grid.Column="3" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="buttonUserAdmin_Click" Background="Transparent" Visibility="Hidden" Margin="2"/>
</Grid> </Grid>
<Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF"> <Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF">

View File

@ -19,6 +19,7 @@ using ENI2.Util;
using log4net; using log4net;
using System.ComponentModel; using System.ComponentModel;
using bsmd.ExcelReadService;
namespace ENI2 namespace ENI2
{ {
@ -320,6 +321,65 @@ namespace ENI2
visitIdDialog.Show(); visitIdDialog.Show();
} }
/// <summary>
/// Callback Neuanlage mit vorhandener ID (zur Abfrage der verfügbaren Meldeklassen)
/// </summary>
private void buttonNewWithIdClick(object sender, RoutedEventArgs e)
{
NewWithIdDialog newWithIdDialog = new NewWithIdDialog();
newWithIdDialog.IsModal = false;
newWithIdDialog.OKClicked += new Action(() =>
{
if (newWithIdDialog.ValidId)
{
MessageCore newCore = new MessageCore();
newCore.Incoming = true;
newCore.InitialHIS = Message.NSWProvider.DUDR_TEST;
bool alreadyInSystem = false;
if (bsmd.database.Util.IsTransitId(newWithIdDialog.VisitTransitId))
{
newCore.TransitId = newWithIdDialog.VisitTransitId;
newCore.IsTransit = true;
alreadyInSystem = (DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreByTransitId(newWithIdDialog.VisitTransitId) != null);
}
else
{
newCore.VisitId = newWithIdDialog.VisitTransitId;
newCore.IsTransit = false;
alreadyInSystem = (DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreByVisitId(newWithIdDialog.VisitTransitId) != null);
}
if (alreadyInSystem)
{
MessageBox.Show(Properties.Resources.textVisitTransitAlreadyInDatabase, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
else
{
newCore.DefaultReportingPartyId = this.userEntity.Id;
newCore.PoC = newWithIdDialog.VisitTransitId.Substring(0, 5);
newCore.Portname = LocodeDB.PortNameFromLocode(newCore.PoC);
newCore.IMO = newWithIdDialog.IMO;
newCore.ENI = newWithIdDialog.ENI;
if (newCore.IsTransit)
newCore.ETAKielCanal = newWithIdDialog.ETA;
else
newCore.ETA = newWithIdDialog.ETA;
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(newCore);
// Meldeklassen für neuen Anlauf erzeugen:
bsmd.database.Util.CreateMessagesForCore(newCore, userEntity);
this.AnmeldungenControl_MessageCoreSelected(newCore); // in einem neuen Reiter öffnen
}
}
});
newWithIdDialog.Show();
}
private void closeButton_Click(object sender, RoutedEventArgs e) private void closeButton_Click(object sender, RoutedEventArgs e)
{ {
// close particular tab // close particular tab

View File

@ -160,6 +160,16 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap check {
get {
object obj = ResourceManager.GetObject("check", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary> /// </summary>
@ -838,6 +848,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Error.
/// </summary>
public static string textCaptionError {
get {
return ResourceManager.GetString("textCaptionError", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Information. /// Looks up a localized string similar to Information.
/// </summary> /// </summary>
@ -847,6 +866,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Warning.
/// </summary>
public static string textCaptionWarning {
get {
return ResourceManager.GetString("textCaptionWarning", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Code (NST). /// Looks up a localized string similar to Code (NST).
/// </summary> /// </summary>
@ -1873,6 +1901,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Import from Excel file.
/// </summary>
public static string textImportFromExcel {
get {
return ResourceManager.GetString("textImportFromExcel", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to IMSBC item. /// Looks up a localized string similar to IMSBC item.
/// </summary> /// </summary>
@ -1963,6 +2000,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Id has invalid format!.
/// </summary>
public static string textInvalidFormat {
get {
return ResourceManager.GetString("textInvalidFormat", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to ISM company. /// Looks up a localized string similar to ISM company.
/// </summary> /// </summary>
@ -2440,6 +2486,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to New with Id.
/// </summary>
public static string textNewWithId {
get {
return ResourceManager.GetString("textNewWithId", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Next Port. /// Looks up a localized string similar to Next Port.
/// </summary> /// </summary>
@ -2989,6 +3044,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Received at.
/// </summary>
public static string textReceivedAt {
get {
return ResourceManager.GetString("textReceivedAt", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Refresh. /// Looks up a localized string similar to Refresh.
/// </summary> /// </summary>
@ -3790,6 +3854,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to A data record with this Visit / TransitId is already in the database!.
/// </summary>
public static string textVisitTransitAlreadyInDatabase {
get {
return ResourceManager.GetString("textVisitTransitAlreadyInDatabase", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Visit / transit id. /// Looks up a localized string similar to Visit / transit id.
/// </summary> /// </summary>

View File

@ -135,4 +135,7 @@
<data name="textNewVisitTransitId" xml:space="preserve"> <data name="textNewVisitTransitId" xml:space="preserve">
<value>Neue Id erstellen</value> <value>Neue Id erstellen</value>
</data> </data>
<data name="textNewWithId" xml:space="preserve">
<value>Neu mit Id</value>
</data>
</root> </root>

View File

@ -1393,4 +1393,28 @@
<data name="textAlreadyCancelled" xml:space="preserve"> <data name="textAlreadyCancelled" xml:space="preserve">
<value>Declaration is already cancelled!</value> <value>Declaration is already cancelled!</value>
</data> </data>
<data name="textNewWithId" xml:space="preserve">
<value>New with Id</value>
</data>
<data name="textInvalidFormat" xml:space="preserve">
<value>Id has invalid format!</value>
</data>
<data name="check" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\check.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="textCaptionError" xml:space="preserve">
<value>Error</value>
</data>
<data name="textCaptionWarning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="textImportFromExcel" xml:space="preserve">
<value>Import from Excel file</value>
</data>
<data name="textReceivedAt" xml:space="preserve">
<value>Received at</value>
</data>
<data name="textVisitTransitAlreadyInDatabase" xml:space="preserve">
<value>A data record with this Visit / TransitId is already in the database!</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -149,5 +149,51 @@ namespace ENI2.Util
cmb.SelectedItem = itemsViewOriginal.GetItemAt(0); cmb.SelectedItem = itemsViewOriginal.GetItemAt(0);
} }
} }
internal static byte? ParseGender(string val)
{
byte? result = null;
if (val != null)
{
if (val.Equals("m", StringComparison.CurrentCultureIgnoreCase) || val.Equals("male", StringComparison.CurrentCultureIgnoreCase))
{
result = 0;
}
else if (val.Equals("f", StringComparison.CurrentCultureIgnoreCase) || val.Equals("female", StringComparison.CurrentCultureIgnoreCase))
{
result = 1;
}
else
{
result = 2;
}
}
return result;
}
internal static byte? ReadIdentityDocumentType(string val)
{
byte? result = null;
if (val != null)
{
if (val.Equals("identity_card", StringComparison.CurrentCultureIgnoreCase)) result = 0;
if (val.Equals("passport", StringComparison.CurrentCultureIgnoreCase)) result = 1;
if (val.Equals("muster_book", StringComparison.CurrentCultureIgnoreCase)) result = 2;
if (val.Equals("picture_id", StringComparison.CurrentCultureIgnoreCase)) result = 3;
if (val.Equals("residental_permit", StringComparison.CurrentCultureIgnoreCase)) result = 4;
if (val.Equals("other_legal_identity_document", StringComparison.CurrentCultureIgnoreCase)) result = 5;
if (val.Equals("ic", StringComparison.CurrentCultureIgnoreCase)) result = 0;
}
return result;
}
internal static bool? ReadBoolean(string val)
{
if ((val == "y") || (val == "Y") || val.Equals("yes", StringComparison.OrdinalIgnoreCase) || (val == "1") || (val == "x") || (val == "X"))
return true;
return false;
}
} }
} }

View File

@ -3,7 +3,8 @@
Sample license text. Sample license text.
--> -->
<packages> <packages>
<package id="Extended.Wpf.Toolkit" version="3.0" targetFramework="net452" /> <package id="ExcelDataReader" version="3.1.0" targetFramework="net452" />
<package id="Extended.Wpf.Toolkit" version="3.1" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" /> <package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.105.0" targetFramework="net452" /> <package id="System.Data.SQLite.Core" version="1.0.105.2" targetFramework="net452" />
</packages> </packages>

Binary file not shown.

View File

@ -92,6 +92,7 @@ namespace bsmd.database
bpol.id = reader.GetGuid(0); bpol.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) bpol.StowawaysOnBoard = reader.GetBoolean(1); if (!reader.IsDBNull(1)) bpol.StowawaysOnBoard = reader.GetBoolean(1);
if (!reader.IsDBNull(2)) bpol.CruiseShip = reader.GetBoolean(2);
result.Add(bpol); result.Add(bpol);
} }
reader.Close(); reader.Close();

View File

@ -166,11 +166,13 @@ namespace bsmd.database
/// </summary> /// </summary>
/// <param name="sublist">Vorhandene Position</param> /// <param name="sublist">Vorhandene Position</param>
/// <returns>Name des neuen Identifiers, der so nicht in der Liste vorkommt</returns> /// <returns>Name des neuen Identifiers, der so nicht in der Liste vorkommt</returns>
public static string GetNewIdentifier(IEnumerable<ISublistElement> sublist) public static string GetNewIdentifier(IEnumerable<DatabaseEntity> sublist)
{ {
int maxVal = -1; int maxVal = -1;
string maxString = null; string maxString = null;
// das sieht riskanter aus als es ist, diese Funktion wird aber nur für Elemente angewendet, die
// ISublistElement implementieren
foreach(ISublistElement element in sublist) foreach(ISublistElement element in sublist)
{ {
if (element.Identifier.IsNullOrEmpty()) continue; if (element.Identifier.IsNullOrEmpty()) continue;

View File

@ -157,7 +157,8 @@ namespace bsmd.database
VIOLATION, VIOLATION,
ERROR, ERROR,
SUSPENDED = 8, SUSPENDED = 8,
IN_USE IN_USE,
UPDATED
} }
/// <summary> /// <summary>

View File

@ -123,7 +123,7 @@ namespace bsmd.database
{ {
List<Message> result = new List<Message>(); List<Message> result = new List<Message>();
bool isDE, isDK; bool isDE, isDK;
if(core != null) if((core != null) && (core.PoC != null))
{ {
isDE = core.PoC.Equals("ZZNOK") || core.PoC.StartsWith("DE"); isDE = core.PoC.Equals("ZZNOK") || core.PoC.StartsWith("DE");
isDK = core.PoC.StartsWith("DK"); isDK = core.PoC.StartsWith("DK");

View File

@ -55,10 +55,13 @@ namespace bsmd.database
if (haz != null) if (haz != null)
{ {
if (haz.NoDPGOnBoardOnArrival ?? false) return false; if (haz.NoDPGOnBoardOnArrival ?? false) return false;
// Diese Einstellung wird im EU-NOAD Tool gemacht, muss bei anderen Quellen überarbeitet werden! // Diese Einstellung wird im EU-NOAD Tool gemacht, muss bei anderen Quellen überarbeitet werden!
if (haz.TransmissionType != "EU-NOAD") return false; // if (haz.TransmissionType != "EU-NOAD") return false;
// Schiffe nach Hamburg keine Gefahrgutmeldung, geht über GEGIS (26.11.2015) // Schiffe nach Hamburg keine Gefahrgutmeldung, geht über GEGIS (26.11.2015)
if (message.MessageCore.PoC.Equals("DEHAM")) return false; // Nach Rückmeldung vom Test ENI-2 wieder entfernt (16.8.2017)
// if (message.MessageCore.PoC.Equals("DEHAM")) return false;
} }
} }
} }

View File

@ -1143,11 +1143,15 @@ namespace bsmd.hisnord
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined = (mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined ?? false) ? yorntype.Y : yorntype.N; pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined = (mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined ?? false) ? yorntype.Y : yorntype.N;
if (mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count > 0) if (mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count > 0)
{ {
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = new string[mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count]; pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = new poc30CrewJoinedShip();
List<string> crewJoinedShipList = new List<string>();
for (int k = 0; k < mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count; k++) for (int k = 0; k < mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count; k++)
{ {
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip[k] = mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName; if (!mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName.IsNullOrEmpty())
crewJoinedShipList.Add(mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName);
} }
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip.PortOfCallLast30DaysCrewJoinedShipName = crewJoinedShipList.ToArray();
} }
} }
@ -1256,6 +1260,10 @@ namespace bsmd.hisnord
hn_was.Items = was_items.ToArray(); hn_was.Items = was_items.ToArray();
hn_was.ItemsElementName = was_item_names.ToArray(); hn_was.ItemsElementName = was_item_names.ToArray();
} }
items1.Add(hn_was);
items1ChoiceType.Add(Items1ChoiceType.WAS);
} }
} }
} }

View File

@ -127,6 +127,8 @@ namespace bsmd.hisnord
bool isAccepted = (nswResponse.Status == "ACCEPTED"); bool isAccepted = (nswResponse.Status == "ACCEPTED");
aMessage.Status = isAccepted ? Message.MessageStatus.ACCEPTED : Message.MessageStatus.REJECTED; aMessage.Status = isAccepted ? Message.MessageStatus.ACCEPTED : Message.MessageStatus.REJECTED;
aMessage.InternalStatus = isAccepted ? Message.BSMDStatus.CONFIRMED : Message.BSMDStatus.ERROR; aMessage.InternalStatus = isAccepted ? Message.BSMDStatus.CONFIRMED : Message.BSMDStatus.ERROR;
if(isAccepted)
aMessage.ReceivedAt = nswResponse.ReceiveAt;
DBManager.Instance.Save(aMessage); DBManager.Instance.Save(aMessage);
} }

View File

@ -1877,7 +1877,7 @@ public partial class portofcallmdh {
private yorntype portOfCallLast30DaysCrewMembersJoinedField; private yorntype portOfCallLast30DaysCrewMembersJoinedField;
private string[] portOfCallLast30DaysCrewJoinedShipField; private poc30CrewJoinedShip portOfCallLast30DaysCrewJoinedShipField;
/// <remarks/> /// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -1914,7 +1914,7 @@ public partial class portofcallmdh {
/// <remarks/> /// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShip", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShip", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] PortOfCallLast30DaysCrewJoinedShip { public poc30CrewJoinedShip PortOfCallLast30DaysCrewJoinedShip {
get { get {
return this.portOfCallLast30DaysCrewJoinedShipField; return this.portOfCallLast30DaysCrewJoinedShipField;
} }
@ -1924,6 +1924,33 @@ public partial class portofcallmdh {
} }
} }
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class poc30CrewJoinedShip
{
private string[] portOfCallLast30DaysCrewJoinedShipNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShipName", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] PortOfCallLast30DaysCrewJoinedShipName
{
get
{
return this.portOfCallLast30DaysCrewJoinedShipNameField;
}
set
{
this.portOfCallLast30DaysCrewJoinedShipNameField = value;
}
}
}
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()] [System.SerializableAttribute()]

View File

@ -53,7 +53,7 @@ namespace bsmd.hisnord
public static result GetResult(string filenameFullPath) public static result GetResult(string filenameFullPath)
{ {
// now we should read the response message... // now we should read the response message...
string resultFilename = string.Format("{0}.result", Path.GetFileName(filenameFullPath)); // hier war früher noch ein .xml dran am Ende string resultFilename = string.Format("{0}.result.xml", Path.GetFileName(filenameFullPath));
string resultFullPath = Path.Combine(Properties.Settings.Default.ResultDir, resultFilename); string resultFullPath = Path.Combine(Properties.Settings.Default.ResultDir, resultFilename);
return result.ReadResult(resultFullPath); return result.ReadResult(resultFullPath);
} }