weitergehende Korrekturen
This commit is contained in:
parent
89d33a261d
commit
da7b586258
@ -741,7 +741,7 @@ namespace ENI2
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWA", crewa.Identifier, "CREWA");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -763,7 +763,7 @@ namespace ENI2
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWD", crewd.Identifier, "CREWD");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -772,7 +772,7 @@ namespace ENI2
|
||||
PAS pasFirst = pasaMessage.Elements[0] as PAS;
|
||||
bool pasIsSchengen = pasFirst.NotificationSchengen ?? false;
|
||||
bool pasIsPAX = pasFirst.NotificationPAX ?? false;
|
||||
if (!((pasFirst.NotificationPAX ?? false) || pasIsSchengen)) // mindestens eins der beiden
|
||||
if (!(pasIsPAX || pasIsSchengen)) // mindestens eins der beiden
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V201, "Wrong selection", null, "PASA", null, "PASA");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
@ -786,13 +786,13 @@ namespace ENI2
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,7 +801,7 @@ namespace ENI2
|
||||
PASD pasdFirst = pasdMessage.Elements[0] as PASD;
|
||||
bool pasdIsSchengen = pasdFirst.NotificationSchengen ?? false;
|
||||
bool pasdIsPAX = pasdFirst.NotificationPAX ?? false;
|
||||
if (!((pasdFirst.NotificationPAX ?? false) || pasdIsSchengen)) // mindestens eins der beiden
|
||||
if (!(pasdIsPAX || pasdIsSchengen)) // mindestens eins der beiden
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V201, "Wrong selection", null, "PASD", null, "PASD");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
@ -815,13 +815,13 @@ namespace ENI2
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -833,17 +833,20 @@ namespace ENI2
|
||||
|
||||
foreach (WAS_RCPT was_rcpt in was_rcptMessage.Elements)
|
||||
{
|
||||
|
||||
if (identDict.ContainsKey(was_rcpt.IdentificationNumber))
|
||||
if (!was_rcpt.IdentificationNumber.IsNullOrEmpty())
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V221, "Identification number", null, "WAS_RCPT", was_rcpt.Identifier, "WAS_RCPT");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
vViolations.Add(mv);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
identDict.Add(was_rcpt.IdentificationNumber, "");
|
||||
// auf doppelte Ident Nummern prüfen
|
||||
if (identDict.ContainsKey(was_rcpt.IdentificationNumber))
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V221, "Identification number", null, "WAS_RCPT", was_rcpt.Identifier, "WAS_RCPT");
|
||||
mv.MessageGroupName = Properties.Resources.textOverview;
|
||||
vViolations.Add(mv);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
identDict.Add(was_rcpt.IdentificationNumber, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,16 +73,16 @@
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding CrewMemberPlaceOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding CrewMemberDateOfBirth, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding CrewMemberIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding CrewMemberIdentityDocumentIssuingState, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding CrewMemberIdentityDocumentExpiryDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<!--<DataGridTextColumn Header="{x:Static p:Resources.textEffects}" Binding="{Binding Effects, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />-->
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
@ -113,16 +113,16 @@
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding CrewMemberPlaceOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding CrewMemberDateOfBirth, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding CrewMemberIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding CrewMemberIdentityDocumentIssuingState, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding CrewMemberIdentityDocumentExpiryDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding CrewMemberCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
</Grid>
|
||||
@ -152,20 +152,21 @@
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfEmbarkation}" Binding="{Binding PassengerPortOfEmbarkation}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDisembarkation}" Binding="{Binding PassengerPortOfDisembarkation}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textTransitPassenger}" Binding="{Binding PassengerInTransit}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding PassengerPlaceOfBirth}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding PassengerDateOfBirth, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding PassengerIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding PassengerIdentityDocumentId}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding PassengerIdentityDocumentIssuingState}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding PassengerIdentityDocumentExpiryDate, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyCare}" Binding="{Binding EmergencyCare, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyContactNumber}" Binding="{Binding EmergencyContactNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
</Grid>
|
||||
@ -195,20 +196,20 @@
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfEmbarkation}" Binding="{Binding PassengerPortOfEmbarkation}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDisembarkation}" Binding="{Binding PassengerPortOfDisembarkation}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textTransitPassenger}" Binding="{Binding PassengerInTransit}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding PassengerPlaceOfBirth}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding PassengerDateOfBirth, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding PassengerIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding PassengerIdentityDocumentId}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentIssuingState}" Binding="{Binding PassengerIdentityDocumentIssuingState}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDocumentExpiryDate}" Binding="{Binding PassengerIdentityDocumentExpiryDate, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyCare}" Binding="{Binding EmergencyCare, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyContactNumber}" Binding="{Binding EmergencyContactNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountryOfBirth}" Binding="{Binding PassengerCountryOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
</Grid>
|
||||
|
||||
@ -730,7 +730,7 @@ namespace ENI2.DetailViewControls
|
||||
return;
|
||||
}
|
||||
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
using (IExcelDataReader reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
List<CREW> importCrew = new List<CREW>();
|
||||
|
||||
@ -740,27 +740,26 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if(((IExcelDataReader) reader).FieldCount < 10)
|
||||
if(reader.FieldCount < 13)
|
||||
{
|
||||
throw new InvalidDataException("Sheet must have at least 10 Columns of data");
|
||||
throw new InvalidDataException("Sheet must have 13 columns of data");
|
||||
}
|
||||
CREW crew = new CREW();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
|
||||
if (crew.CrewMemberLastName.Equals("Family Name") || (crew.CrewMemberLastName.Trim().Length == 0)) continue;
|
||||
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberNationality = reader.GetString(3).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberDuty = reader.GetString(4);
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3);
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberNationality = reader.GetString(4).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6)) crew.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);
|
||||
|
||||
if(((IExcelDataReader) reader).FieldCount > 11) {
|
||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||
}
|
||||
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 9);
|
||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 12);
|
||||
|
||||
crew.MessageHeader = this._crewMessage;
|
||||
crew.IsDirty = true;
|
||||
@ -806,7 +805,7 @@ namespace ENI2.DetailViewControls
|
||||
return;
|
||||
}
|
||||
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
using (IExcelDataReader reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
List<CREWD> importCrew = new List<CREWD>();
|
||||
|
||||
@ -816,30 +815,28 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if (((IExcelDataReader)reader).FieldCount < 10)
|
||||
if (reader.FieldCount < 13)
|
||||
{
|
||||
throw new InvalidDataException("Sheet must have at least 10 Columns of data");
|
||||
throw new InvalidDataException("Sheet must have 13 columns of data");
|
||||
}
|
||||
CREWD crew = new CREWD();
|
||||
crew.IsDeparture = true;
|
||||
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
|
||||
if (crew.CrewMemberLastName.Equals("Family Name") || (crew.CrewMemberLastName.Trim().Length == 0)) continue;
|
||||
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberNationality = reader.GetString(3).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberDuty = reader.GetString(4);
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberDuty = reader.GetString(3);
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberNationality = reader.GetString(4).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6)) crew.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);
|
||||
|
||||
if (((IExcelDataReader)reader).FieldCount > 11)
|
||||
{
|
||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||
}
|
||||
if (!reader.IsDBNull(6)) crew.CrewMemberCountryOfBirth = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(7)) crew.CrewMemberDateOfBirth = reader.GetDateTime(7);
|
||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(8));
|
||||
if (!reader.IsDBNull(9)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 9);
|
||||
if (!reader.IsDBNull(10)) crew.CrewMemberIdentityDocumentIssuingState = reader.GetString(10).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(11)) crew.CrewMemberIdentityDocumentExpiryDate = reader.GetDateTime(11);
|
||||
if (!reader.IsDBNull(12)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 12);
|
||||
|
||||
crew.MessageHeader = this._crewMessage;
|
||||
crew.IsDirty = true;
|
||||
@ -895,38 +892,35 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if (((IExcelDataReader)reader).FieldCount < 11)
|
||||
if (((IExcelDataReader)reader).FieldCount < 17)
|
||||
{
|
||||
throw new InvalidDataException("Sheet must have at least 11 Columns of data");
|
||||
throw new InvalidDataException("Sheet must have 17 columns of data");
|
||||
}
|
||||
|
||||
PAS pas = new PAS();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetValue(0).ToString();
|
||||
if (pas.PassengerLastName.Equals("Family Name") || (pas.PassengerLastName.Trim().Length == 0)) continue;
|
||||
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetValue(1).ToString();
|
||||
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) pas.PassengerNationality = reader.GetString(3).Substring(0, 2).ToUpper();
|
||||
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfEmbarkation = reader.GetString(4);
|
||||
if (!reader.IsDBNull(3)) pas.PassengerPortOfEmbarkation = reader.GetString(3);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||
pas.PassengerPortOfEmbarkation = null;
|
||||
|
||||
if (!reader.IsDBNull(5)) pas.PassengerPortOfDisembarkation = reader.GetString(5);
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfDisembarkation = reader.GetString(4);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||
pas.PassengerPortOfDisembarkation = null;
|
||||
|
||||
if (!reader.IsDBNull(6)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(6));
|
||||
if (!reader.IsDBNull(5)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(5));
|
||||
if (!reader.IsDBNull(6)) pas.PassengerNationality = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
|
||||
if (!reader.IsDBNull(8)) pas.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);
|
||||
|
||||
if (((IExcelDataReader)reader).FieldCount > 12)
|
||||
{
|
||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||
}
|
||||
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 11);
|
||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = this.getValueAsString(reader, 14);
|
||||
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15);
|
||||
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = this.getValueAsString(reader, 16);
|
||||
|
||||
pas.MessageHeader = this._pasMessage;
|
||||
pas.IsDirty = true;
|
||||
@ -981,39 +975,35 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
if (((IExcelDataReader)reader).FieldCount < 11)
|
||||
if (((IExcelDataReader)reader).FieldCount < 17)
|
||||
{
|
||||
throw new InvalidDataException("Sheet must have at least 11 Columns of data");
|
||||
throw new InvalidDataException("Sheet must have 17 columns of data");
|
||||
}
|
||||
|
||||
PASD pas = new PASD();
|
||||
pas.IsDeparture = true;
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetValue(0).ToString();
|
||||
if (pas.PassengerLastName.Equals("Family Name") || (pas.PassengerLastName.Trim().Length == 0)) continue;
|
||||
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetValue(1).ToString();
|
||||
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) pas.PassengerNationality = reader.GetString(3).Substring(0, 2).ToUpper();
|
||||
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfEmbarkation = reader.GetString(4);
|
||||
if (!reader.IsDBNull(3)) pas.PassengerPortOfEmbarkation = reader.GetString(3);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||
pas.PassengerPortOfEmbarkation = null;
|
||||
|
||||
if (!reader.IsDBNull(5)) pas.PassengerPortOfDisembarkation = reader.GetString(5);
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfDisembarkation = reader.GetString(4);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||
pas.PassengerPortOfDisembarkation = null;
|
||||
|
||||
if (!reader.IsDBNull(6)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(6));
|
||||
if (!reader.IsDBNull(5)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(5));
|
||||
if (!reader.IsDBNull(6)) pas.PassengerNationality = reader.GetString(6).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
|
||||
if (!reader.IsDBNull(8)) pas.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);
|
||||
|
||||
if (((IExcelDataReader)reader).FieldCount > 12)
|
||||
{
|
||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||
}
|
||||
if (!reader.IsDBNull(8)) pas.PassengerCountryOfBirth = reader.GetString(8).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(9)) pas.PassengerDateOfBirth = reader.GetDateTime(9);
|
||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(10));
|
||||
if (!reader.IsDBNull(11)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 11);
|
||||
if (!reader.IsDBNull(12)) pas.PassengerIdentityDocumentIssuingState = reader.GetString(12).Substring(0, 2).ToUpper();
|
||||
if (!reader.IsDBNull(13)) pas.PassengerIdentityDocumentExpiryDate = reader.GetDateTime(13);
|
||||
if (!reader.IsDBNull(14)) pas.PassengerVisaNumber = this.getValueAsString(reader, 14);
|
||||
if (!reader.IsDBNull(15)) pas.EmergencyCare = reader.GetString(15);
|
||||
if (!reader.IsDBNull(16)) pas.EmergencyContactNumber = this.getValueAsString(reader, 16);
|
||||
|
||||
pas.MessageHeader = this._pasMessage;
|
||||
pas.IsDirty = true;
|
||||
|
||||
@ -89,9 +89,12 @@ namespace ENI2.DetailViewControls
|
||||
|
||||
private void buttonWasteReceivedAddMissingEntries_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this._selectedWAS_RCPT.AddMissingWasteReceived();
|
||||
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||
this.dataGridWasteReceived.Items.Refresh();
|
||||
if (this._selectedWAS_RCPT != null)
|
||||
{
|
||||
this._selectedWAS_RCPT.AddMissingWasteReceived();
|
||||
this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
|
||||
this.dataGridWasteReceived.Items.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>2</ApplicationRevision>
|
||||
<ApplicationVersion>7.0.0.2</ApplicationVersion>
|
||||
<ApplicationRevision>3</ApplicationRevision>
|
||||
<ApplicationVersion>7.0.0.3</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
|
||||
@ -250,12 +250,12 @@ namespace ENI2.Excel
|
||||
|
||||
if(val!= null)
|
||||
{
|
||||
if (val == "I") result = 1;
|
||||
if (val == "1") result = 1;
|
||||
if (val == "II") result = 2;
|
||||
if (val == "2") result = 2;
|
||||
if (val == "III") result = 3;
|
||||
if (val == "3") result = 3;
|
||||
if (val == "I") result = 0;
|
||||
if (val == "1") result = 0;
|
||||
if (val == "II") result = 1;
|
||||
if (val == "2") result = 1;
|
||||
if (val == "III") result = 2;
|
||||
if (val == "3") result = 2;
|
||||
if (val.Equals("NONE", StringComparison.OrdinalIgnoreCase)) result = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -31,10 +31,11 @@ namespace ENI2.Excel
|
||||
{
|
||||
readMessage = "Id not matching in import sheet";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// load messages if already present
|
||||
List<Message> messages = DBManager.Instance.GetMessagesForCore(messageCore, DBManager.MessageLoad.ALL);
|
||||
messages.Sort();
|
||||
|
||||
// parse selected classes
|
||||
try
|
||||
@ -114,7 +115,7 @@ namespace ENI2.Excel
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SaveMessage(Message message)
|
||||
{
|
||||
@ -239,7 +240,7 @@ namespace ENI2.Excel
|
||||
#region BPOL
|
||||
|
||||
private static bool ScanBPOL(Message bpolMessage, List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
||||
{
|
||||
{
|
||||
if (bpolMessage.Elements.Count == 0)
|
||||
{
|
||||
BPOL newBPOL = new BPOL();
|
||||
@ -252,12 +253,12 @@ namespace ENI2.Excel
|
||||
|
||||
// 19.12.16: Einschleicher-Feld von Klasse POBA übernehmen (anderes ist nicht im Sheet!)
|
||||
// (1.12.21: bezweifle ob das so wie gedacht funktioniert..)
|
||||
Message pobaMessage = ExcelUtil.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBA);
|
||||
if(pobaMessage.Elements.Count > 0)
|
||||
Message pobaMessage = ExcelUtil.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBA);
|
||||
if (pobaMessage.Elements.Count > 0)
|
||||
{
|
||||
POBA poba = pobaMessage.Elements[0] as POBA;
|
||||
bpol.StowawaysOnBoard = (poba.TotalStowawaysOnBoardUponArrival ?? 0) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
bpol.DeleteElements();
|
||||
|
||||
@ -301,7 +302,7 @@ namespace ENI2.Excel
|
||||
#region POBA
|
||||
|
||||
private static bool ScanPOBA(Message pobaMessage, ExcelReader reader)
|
||||
{
|
||||
{
|
||||
if(pobaMessage.Elements.Count == 0)
|
||||
{
|
||||
POBA newPoba = new POBA();
|
||||
@ -312,7 +313,7 @@ namespace ENI2.Excel
|
||||
POBA poba = pobaMessage.Elements[0] as POBA;
|
||||
ScanMessage(poba, reader);
|
||||
if (((poba.TotalPersonsOnBoardUponArrival ?? 0) == 0) && poba.IsNew)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -392,7 +393,7 @@ namespace ENI2.Excel
|
||||
|
||||
string unNumber = reader.ReadText(imdg_unno);
|
||||
if(unNumber.IsNullOrEmpty()) // if unnumber is not set ignore this row
|
||||
{
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1301,6 +1302,12 @@ namespace ENI2.Excel
|
||||
|
||||
wr.WasteCode = reader.ReadText(wtype); // hier muss immer was stehen, ist ein festes Beschreibungsfeld
|
||||
wr.WasteDescription = reader.ReadText(wDescr);
|
||||
if(wr.WasteDescription.IsNullOrEmpty())
|
||||
{
|
||||
if (wr.WasteCode.Equals("999") || wr.WasteCode.Equals("201") || wr.WasteCode.Equals("202") || wr.WasteCode.Equals("203") ||
|
||||
wr.WasteCode.Equals("204") || wr.WasteCode.Equals("510") || wr.WasteCode.Equals("511"))
|
||||
wr.WasteDescription = "-";
|
||||
}
|
||||
wr.AmountWasteReceived_MTQ = reader.ReadNumber(wAmount);
|
||||
if (!wr.AmountWasteReceived_MTQ.HasValue) wr.AmountWasteReceived_MTQ = 0; // Default ist 0, nicht nix ;-)
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ namespace bsmd.database
|
||||
List<DatabaseEntity> portAreas = pa.LoadList(reader);
|
||||
DBManager.allPortAreas = new Dictionary<string, PortArea>();
|
||||
foreach (PortArea aPa in portAreas)
|
||||
DBManager.allPortAreas.Add(aPa.Locode + aPa.Code, aPa);
|
||||
DBManager.allPortAreas.Add(aPa.Code, aPa);
|
||||
}
|
||||
return DBManager.allPortAreas;
|
||||
}
|
||||
|
||||
@ -865,13 +865,6 @@ namespace bsmd.database
|
||||
return this.MessageNotificationClass.CompareTo(other.MessageNotificationClass);
|
||||
}
|
||||
|
||||
/*
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.Id.GetHashCode() * 17 + this.messageCoreId.GetHashCode() * 17 + this.MessageNotificationClass.GetHashCode();
|
||||
}
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
#region IClonable implementation
|
||||
|
||||
@ -134,12 +134,26 @@ namespace bsmd.database
|
||||
{
|
||||
Identifier = DatabaseEntity.GetNewIdentifier(this.WasteReceived),
|
||||
WAS_RCPT = this,
|
||||
WasteDescription = "-",
|
||||
AmountWasteReceived_MTQ = 0,
|
||||
WasteCode = wasteCode
|
||||
};
|
||||
switch(wasteCode)
|
||||
{
|
||||
case "999":
|
||||
case "201":
|
||||
case "202":
|
||||
case "203":
|
||||
case "204":
|
||||
case "510":
|
||||
case "511":
|
||||
newWasteReceived.WasteDescription = "-";
|
||||
break;
|
||||
default:
|
||||
newWasteReceived.WasteDescription = "";
|
||||
break;
|
||||
}
|
||||
this.WasteReceived.Add(newWasteReceived);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user