Fixed test comments and bumped version to 7.2.6.2

This commit is contained in:
Daniel Schick 2025-01-30 07:44:14 +01:00
parent 0d80f6e514
commit 006a253fd7
9 changed files with 44 additions and 43 deletions

View File

@ -37,7 +37,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>7.2.6.1</ApplicationVersion>
<ApplicationVersion>7.2.6.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -2871,35 +2871,38 @@ namespace ENI2.Excel
}
else // we cannot find whatever this is..
{
FixImportDialog fid = new FixImportDialog();
fid.Value = nationality;
fid.ValueType = "Nationality";
fid.SelectionValues = CREW.NationalityDict;
if (fid.ShowDialog() ?? false)
if (setPlaceHolder) // only show import dialog if this is a required field..
{
if (!fid.SelectedValue.IsNullOrEmpty())
FixImportDialog fid = new FixImportDialog();
fid.Value = nationality;
fid.ValueType = "Nationality";
fid.SelectionValues = CREW.NationalityDict;
if (fid.ShowDialog() ?? false)
{
if(!ValueMapping.InvalidKeys[ValueMapping.MappingType.COUNTRY].Contains(nationality))
if (!fid.SelectedValue.IsNullOrEmpty())
{
string selectedValue = fid.SelectedValue;
Task<bool> createResult = Task.Run(async () => await ValueMapping.Create(ValueMapping.MappingType.COUNTRY, nationality, selectedValue));
if(!createResult.Result)
_log.WarnFormat("Error saving nationality value mapping {0} -> {1}", nationality, selectedValue);
if (!ValueMapping.InvalidKeys[ValueMapping.MappingType.COUNTRY].Contains(nationality))
{
string selectedValue = fid.SelectedValue;
Task<bool> createResult = Task.Run(async () => await ValueMapping.Create(ValueMapping.MappingType.COUNTRY, nationality, selectedValue));
if (!createResult.Result)
_log.WarnFormat("Error saving nationality value mapping {0} -> {1}", nationality, selectedValue);
}
else
{
// add temporary
ValueMapping vm = ValueMapping.Create(ValueMapping.MappingType.COUNTRY);
vm.Key = nationality;
vm.Value = fid.SelectedValue;
ValueMapping.Dicts[ValueMapping.MappingType.COUNTRY].Add(nationality, vm);
}
result = fid.SelectedValue.Substring(0, 2); // attention manual entry
}
else
{
// add temporary
ValueMapping vm = ValueMapping.Create(ValueMapping.MappingType.COUNTRY);
vm.Key = nationality;
vm.Value = fid.SelectedValue;
ValueMapping.Dicts[ValueMapping.MappingType.COUNTRY].Add(nationality, vm);
}
result = fid.SelectedValue.Substring(0, 2); // attention manual entry
}
}
else
{
canceled = true;
else
{
canceled = true;
}
}
}

View File

@ -43,12 +43,11 @@ namespace bsmd.database
public string CrewMemberFirstName { get; set; }
[ShowReport]
[ReportDisplayName("Place of birth")]
[ReportDisplayName("Place of birth")]
[MaxLength(100)]
[ENI2Validation]
public string CrewMemberPlaceOfBirth { get; set; }
[Validation(ValidationCode.FLAG_CODE)]
[MaxLength(2)]
[ENI2Validation]
public string CrewMemberCountryOfBirth { get; set; }
@ -82,7 +81,7 @@ namespace bsmd.database
[MaxLength(2)]
[ENI2Validation]
public string CrewMemberNationality { get; set; }
[Validation(ValidationCode.NOT_NULL)]
[ENI2Validation]
public byte? CrewMemberIdentityDocumentType { get; set; }
@ -121,7 +120,7 @@ namespace bsmd.database
[MaxLength(2)]
[ENI2Validation]
public string CrewMemberIdentityDocumentIssuingState { get; set; }
[Validation(ValidationCode.PAST_DATE)]
[ENI2Validation]
public DateTime? CrewMemberIdentityDocumentExpiryDate { get; set; }
@ -324,12 +323,12 @@ namespace bsmd.database
}
if (this.CrewMemberDateOfBirth.HasValue && (this.CrewMemberDateOfBirth.Value > DateTime.Today))
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Date of birth is in the future", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
if (this.CrewMemberDateOfBirth.HasValue && (this.CrewMemberDateOfBirth.Value <= CLAMPMINDATE))
violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "Check date of birth", null, this.Title, this.Identifier, this.IsDeparture ? "CREWD" : "CREWA"));
// NSW 7.2 rules
// NSW 7.2 rules
if((this.NotificationSchengen ?? false) && (!this.HasSchengenDetails))
{
@ -382,14 +381,14 @@ namespace bsmd.database
row[5] = crew.CrewMemberGender ?? (object)DBNull.Value;
if (crew.CrewMemberNationality?.Length == 2)
row[6] = crew.CrewMemberNationality;
else
else
row[6] = DBNull.Value;
row[7] = crew.CrewMemberIdentityDocumentType ?? (object)DBNull.Value;
row[8] = crew.CrewMemberIdentityDocumentId ?? (object)DBNull.Value;
row[9] = crew.CrewMemberVisaNumber ?? (object)DBNull.Value;
row[10] = crew.CrewMemberDuty ?? (object)DBNull.Value;
row[11] = crew.Identifier ?? (object)DBNull.Value;
row[12] = crew.IsDeparture;
row[12] = crew.IsDeparture;
if (crew.CrewMemberIdentityDocumentIssuingState?.Length == 2)
row[13] = crew.CrewMemberIdentityDocumentIssuingState;
else
@ -448,7 +447,7 @@ namespace bsmd.database
this.CrewMemberIdentityDocumentType = crew.CrewMemberIdentityDocumentType;
this.CrewMemberIdentityDocumentId = crew.CrewMemberIdentityDocumentId;
this.CrewMemberVisaNumber = crew.CrewMemberVisaNumber;
this.CrewMemberDuty = crew.CrewMemberDuty;
this.CrewMemberDuty = crew.CrewMemberDuty;
this.CrewMemberIdentityDocumentIssuingState = crew.CrewMemberIdentityDocumentIssuingState;
this.CrewMemberIdentityDocumentExpiryDate = crew.CrewMemberIdentityDocumentExpiryDate;
this.Effects = crew.Effects;
@ -462,7 +461,7 @@ namespace bsmd.database
public static CREW CreateCommon(List<CREW> crewList)
{
CREW crew = new CREW(); // template entity
CREW crew = new CREW(); // template entity
if(crewList.IsNullOrEmpty())
return crew;

View File

@ -268,7 +268,7 @@ namespace bsmd.database
{
if(this.Quantity_KGM >= 1000000000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value == 2) &&
this.Flashpoint_CEL.IsNullOrEmpty())

View File

@ -202,7 +202,7 @@ namespace bsmd.database
{
if(this.Quantity_KGM >= 1000000000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
if (!this.UNNumber.IsNullOrEmpty() && !unNumberRegex.IsMatch(this.UNNumber))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "UNNumber", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));

View File

@ -499,7 +499,7 @@ namespace bsmd.database
if((this.NetQuantity_KGM >= 1000000000) ||
(this.GrossQuantity_KGM >= 1000000000) ||
(this.Volume_MTQ >= 1000000000))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
foreach (SubsidiaryRisks sr in this.SubsidiaryRiskList)

View File

@ -236,7 +236,7 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if(this.Quantity_KGM >= 1000000000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
if (!MHB ?? false)
{

View File

@ -189,7 +189,7 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.Quantity_KGM >= 1000000000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value == 2) &&
this.Flashpoint_CEL.IsNullOrEmpty())

View File

@ -149,8 +149,7 @@ namespace bsmd.database
[ENI2Validation]
public bool? NotificationPAX { get; set; }
[Validation(ValidationCode.FLAG_CODE)]
[MaxLength(2)]
[ENI2Validation]
public string PassengerCountryOfBirth { get; set; }