Fixed test comments
This commit is contained in:
parent
b2062c3227
commit
b1051546b7
@ -740,7 +740,7 @@ namespace ENI2.Excel
|
||||
pas.PassengerLastName = lastName;
|
||||
pas.PassengerFirstName = reader.ReadCellAsText("passenger departure", string.Format("C{0}", i + 16));
|
||||
pas.PassengerPlaceOfBirth = reader.ReadCellAsText("passenger departure", string.Format("D{0}", i + 16));
|
||||
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger departure", string.Format("E{0}", i + 16)), out bool canceled);
|
||||
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger departure", string.Format("E{0}", i + 16)), out bool canceled, false);
|
||||
if (canceled) return false;
|
||||
pas.PassengerDateOfBirth = reader.ReadCellAsDateTime("passenger departure", string.Format("F{0}", i + 16));
|
||||
pas.PassengerGender = ParseGender(reader.ReadCellAsText("passenger departure", string.Format("G{0}", i + 16)));
|
||||
@ -802,7 +802,7 @@ namespace ENI2.Excel
|
||||
pas.PassengerLastName = lastName;
|
||||
pas.PassengerFirstName = reader.ReadCellAsText("passenger arrival", string.Format("C{0}", i + 16));
|
||||
pas.PassengerPlaceOfBirth = reader.ReadCellAsText("passenger arrival", string.Format("D{0}", i + 16));
|
||||
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger arrival", string.Format("E{0}", i + 16)), out bool canceled);
|
||||
pas.PassengerCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("passenger arrival", string.Format("E{0}", i + 16)), out bool canceled, false);
|
||||
if (canceled) return false;
|
||||
pas.PassengerDateOfBirth = reader.ReadCellAsDateTime("passenger arrival", string.Format("F{0}", i + 16));
|
||||
pas.PassengerGender = ParseGender(reader.ReadCellAsText("passenger arrival", string.Format("G{0}", i + 16)));
|
||||
@ -1207,7 +1207,7 @@ namespace ENI2.Excel
|
||||
crew.CrewMemberLastName = lastName;
|
||||
crew.CrewMemberFirstName = reader.ReadCellAsText("crew departure", string.Format("C{0}", i + 15));
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText("crew departure", string.Format("D{0}", i + 15));
|
||||
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew departure", string.Format("E{0}", i + 15)), out bool canceled);
|
||||
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew departure", string.Format("E{0}", i + 15)), out bool canceled, false);
|
||||
if (canceled) return false;
|
||||
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime("crew departure", string.Format("F{0}", i + 15));
|
||||
string gender = reader.ReadCellAsText("crew departure", string.Format("G{0}", i + 15));
|
||||
@ -1257,7 +1257,7 @@ namespace ENI2.Excel
|
||||
crew.CrewMemberLastName = lastName;
|
||||
crew.CrewMemberFirstName = reader.ReadCellAsText("crew arrival", string.Format("C{0}", i + 15));
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText("crew arrival", string.Format("D{0}", i + 15));
|
||||
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew arrival", string.Format("E{0}", i + 15)), out bool canceled);
|
||||
crew.CrewMemberCountryOfBirth = ExcelUtil.ReadNationality(reader.ReadCellAsText("crew arrival", string.Format("E{0}", i + 15)), out bool canceled, false);
|
||||
if (canceled) return false;
|
||||
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime("crew arrival", string.Format("F{0}", i + 15));
|
||||
string gender = reader.ReadCellAsText("crew arrival", string.Format("G{0}", i + 15));
|
||||
|
||||
@ -2133,7 +2133,7 @@ namespace ENI2.Excel
|
||||
crew.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||
if (canceled) return true;
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18), 100);
|
||||
crew.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _);
|
||||
crew.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _, false);
|
||||
|
||||
crew.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
|
||||
|
||||
@ -2252,7 +2252,7 @@ namespace ENI2.Excel
|
||||
crewd.CrewMemberNationality = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("G{0}", i + 18)), out canceled);
|
||||
if (canceled) return true;
|
||||
crewd.CrewMemberPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("H{0}", i + 18), 100);
|
||||
crewd.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _);
|
||||
crewd.CrewMemberCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("I{0}", i + 18)), out _, false);
|
||||
crewd.CrewMemberDateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("J{0}", i + 18));
|
||||
|
||||
crewd.CrewMemberIdentityDocumentType = ReadDocumentType(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out canceled);
|
||||
@ -2374,7 +2374,7 @@ namespace ENI2.Excel
|
||||
pas.PassengerInTransit = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", i + 17));
|
||||
|
||||
pas.PassengerPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", i + 17), 100);
|
||||
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 17)), out _);
|
||||
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 17)), out _, false);
|
||||
|
||||
if (canceled) return true;
|
||||
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 17));
|
||||
@ -2515,7 +2515,7 @@ namespace ENI2.Excel
|
||||
pas.PassengerInTransit = reader.ReadCellAsBool(sheetTitle, string.Format("H{0}", i + 18));
|
||||
|
||||
pas.PassengerPlaceOfBirth = reader.ReadCellAsText(sheetTitle, string.Format("J{0}", i + 18), 100);
|
||||
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out _);
|
||||
pas.PassengerCountryOfBirth = ReadNationality(reader.ReadCellAsText(sheetTitle, string.Format("K{0}", i + 18)), out _, false);
|
||||
|
||||
if (canceled) return true;
|
||||
DateTime? dateOfBirth = reader.ReadCellAsDateTime(sheetTitle, string.Format("L{0}", i + 18));
|
||||
@ -2848,12 +2848,12 @@ namespace ENI2.Excel
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string ReadNationality(string nationality, out bool canceled)
|
||||
public static string ReadNationality(string nationality, out bool canceled, bool setPlaceHolder = true)
|
||||
{
|
||||
string result = null;
|
||||
canceled = false;
|
||||
nationality = nationality.Trim();
|
||||
if (nationality.IsNullOrEmpty())
|
||||
if (nationality.IsNullOrEmpty() && setPlaceHolder)
|
||||
{
|
||||
result = "XX";
|
||||
}
|
||||
|
||||
@ -266,6 +266,10 @@ 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"));
|
||||
|
||||
if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value == 2) &&
|
||||
this.Flashpoint_CEL.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V804, "Flashpoint_CEL", null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
@ -201,6 +201,9 @@ 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"));
|
||||
|
||||
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"));
|
||||
|
||||
|
||||
@ -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.V809, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
|
||||
foreach (SubsidiaryRisks sr in this.SubsidiaryRiskList)
|
||||
|
||||
@ -235,7 +235,10 @@ namespace bsmd.database
|
||||
|
||||
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
|
||||
{
|
||||
if(!MHB ?? false)
|
||||
if(this.Quantity_KGM >= 1000000000)
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, null, null, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
if (!MHB ?? false)
|
||||
{
|
||||
if(this.UNNumber.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V803, "UNNumber", this.UNNumber, this.Title, this.Identifier, this.HAZ.IsDeparture ? "HAZD" : "HAZA"));
|
||||
|
||||
@ -188,6 +188,9 @@ 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"));
|
||||
|
||||
if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value == 2) &&
|
||||
this.Flashpoint_CEL.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V804, "Flashpoint_CEL", null, this.Title, this.Identifier,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user