fixed some more minor validation / correction funcs
This commit is contained in:
parent
332780e6eb
commit
cacf9b6b1f
@ -829,17 +829,19 @@ namespace ENI2
|
||||
if ((pasaMessage != null) && (pasaMessage.Elements.Count > 12))
|
||||
{
|
||||
PAS firstPASA = pasaMessage.Elements[0] as PAS;
|
||||
if(firstPASA.NotificationPAX ?? false)
|
||||
if(!(firstPASA.NotificationPAX ?? false))
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set", null, "PASA");
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASA > 12)", null, Properties.Resources.textOverview, null, "PASA");
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
|
||||
if((crewaMessage != null) && (crewaMessage.Elements.Count > 0))
|
||||
{
|
||||
CREW firstCREW = crewaMessage.Elements[0] as CREW;
|
||||
if(firstCREW.NotificationPAX ?? false)
|
||||
if(!(firstCREW.NotificationPAX ?? false))
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set", null, "CREWA");
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASA > 12)", null, Properties.Resources.textOverview, null, "CREWA");
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -847,17 +849,19 @@ namespace ENI2
|
||||
if((pasdMessage != null) && (pasdMessage.Elements.Count > 12))
|
||||
{
|
||||
PASD firstPASD = pasdMessage.Elements[0] as PASD;
|
||||
if(firstPASD.NotificationPAX ?? false)
|
||||
if(!(firstPASD.NotificationPAX ?? false))
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set", null, "PASD");
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASD > 12)", null, Properties.Resources.textOverview, null, "PASD");
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
|
||||
if ((crewdMessage != null) && (crewdMessage.Elements.Count > 0))
|
||||
{
|
||||
CREWD firstCREW = crewdMessage.Elements[0] as CREWD;
|
||||
if(firstCREW?.NotificationPAX ?? false)
|
||||
if(!(firstCREW.NotificationPAX ?? false))
|
||||
{
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set", null, "CREWD");
|
||||
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.NO_PAX, "No PAX set (PASD > 12)", null, Properties.Resources.textOverview, null, "CREWD");
|
||||
vViolations.Add(mv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,6 +257,7 @@ namespace ENI2.DetailViewControls
|
||||
this._pasMessage.Elements.Add(pasa);
|
||||
this.SublistElementChanged(Message.NotificationClass.PASA);
|
||||
}
|
||||
this.CheckPASA();
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,6 +275,7 @@ namespace ENI2.DetailViewControls
|
||||
this._pasdMessage.Elements.Add(pasd);
|
||||
this.SublistElementChanged(Message.NotificationClass.PASD);
|
||||
}
|
||||
this.CheckPASD();
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,6 +293,7 @@ namespace ENI2.DetailViewControls
|
||||
this._crewMessage.Elements.Add(crewa);
|
||||
this.SublistElementChanged(Message.NotificationClass.CREWA);
|
||||
}
|
||||
this.CheckCREWA();
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,6 +311,7 @@ namespace ENI2.DetailViewControls
|
||||
this._crewdMessage.Elements.Add(crewd);
|
||||
this.SublistElementChanged(Message.NotificationClass.CREWD);
|
||||
}
|
||||
this.CheckCREWD();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationRevision>3</ApplicationRevision>
|
||||
<ApplicationVersion>7.2.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
|
||||
@ -730,6 +730,10 @@ namespace ENI2.Excel
|
||||
pasdMessage.Elements.Add(pas);
|
||||
}
|
||||
|
||||
// these two are not working, since the lookup field is a combobox where reading text always yields empty string
|
||||
// if there is time we should do the solution suggested in this question
|
||||
// https://stackoverflow.com/questions/46752911/how-to-read-comboboxes-value-from-excel-using-c-sharp
|
||||
|
||||
pas.NotificationSchengen = reader.ReadCellAsBool("passenger departure", "C10");
|
||||
pas.NotificationPAX = reader.ReadCellAsBool("passenger departure", "C11");
|
||||
|
||||
@ -759,6 +763,9 @@ namespace ENI2.Excel
|
||||
pas.PassengerInTransit = reader.ReadCellAsBool("passenger departure", string.Format("N{0}", i + 16));
|
||||
//}
|
||||
|
||||
if (pas.HasSchengenDetails) pas.NotificationSchengen = true;
|
||||
if (pas.HasPAXDetails) pas.NotificationPAX = true;
|
||||
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
@ -813,6 +820,9 @@ namespace ENI2.Excel
|
||||
pas.PassengerInTransit = reader.ReadCellAsBool("passenger arrival", string.Format("N{0}", i + 16));
|
||||
//}
|
||||
|
||||
if (pas.HasSchengenDetails) pas.NotificationSchengen = true;
|
||||
if (pas.HasPAXDetails) pas.NotificationPAX = true;
|
||||
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
|
||||
@ -2136,6 +2136,7 @@ namespace ENI2.Excel
|
||||
if (crew.Effects.Length > 256)
|
||||
crew.Effects = crew.Effects.Substring(0, 256);
|
||||
|
||||
crew.NotificationSchengen = crew.HasSchengenDetails;
|
||||
|
||||
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||
}
|
||||
@ -2243,6 +2244,8 @@ namespace ENI2.Excel
|
||||
|
||||
crewd.Effects = reader.ReadCellAsText("2. PORT", string.Format("C{0}", i + 142));
|
||||
|
||||
crewd.NotificationSchengen = crewd.HasSchengenDetails;
|
||||
|
||||
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||
}
|
||||
}
|
||||
@ -2361,6 +2364,9 @@ namespace ENI2.Excel
|
||||
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 17));
|
||||
pas.EmergencyContactNumber = reader.ReadCellAsText(sheetTitle, string.Format("S{0}", i + 17));
|
||||
|
||||
// sie will es unbedingt ;-)
|
||||
pas.NotificationSchengen = pas.HasSchengenDetails;
|
||||
|
||||
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||
}
|
||||
}
|
||||
@ -2490,6 +2496,8 @@ namespace ENI2.Excel
|
||||
pas.EmergencyCare = reader.ReadCellAsText(sheetTitle, string.Format("R{0}", i + 18));
|
||||
pas.EmergencyContactNumber = reader.ReadCellAsText(sheetTitle, string.Format("S{0}", i + 18));
|
||||
|
||||
pas.NotificationSchengen = pas.HasSchengenDetails;
|
||||
|
||||
Util.UIHelper.SetBusyState(); // dialog might reset busy state
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user