MV / SH Hafenliste der SQlite DB hinzugefügt
Dadurch ist es möglich, für die betreffenden Häfen eine zusätzliche Validierung zu machen.
This commit is contained in:
parent
12e65a27e4
commit
1da414a782
@ -72,6 +72,7 @@ namespace ENI2
|
||||
Dictionary<int, string> cargoHandlingDict = LocalizedLookup.getLADGCargoHandlingStrings(langKey);
|
||||
foreach (int key in cargoHandlingDict.Keys)
|
||||
LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]);
|
||||
LADG.MVSHLocodes.AddRange(LocalizedLookup.getMVSHLocodes());
|
||||
|
||||
EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown));
|
||||
CREW.NationalityDict = LocalizedLookup.getNationalities();
|
||||
|
||||
@ -288,5 +288,21 @@ namespace ENI2
|
||||
reader.Close();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<string> getMVSHLocodes()
|
||||
{
|
||||
List<string> result = new List<string>();
|
||||
|
||||
string query = string.Format("SELECT locode from MVSH_ports");
|
||||
SQLiteCommand cmd = new SQLiteCommand(query, _con);
|
||||
IDataReader reader = cmd.ExecuteReader();
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.IsDBNull(0)) continue;
|
||||
result.Add(reader.GetString(0));
|
||||
}
|
||||
reader.Close();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
|
||||
@ -119,6 +119,8 @@ namespace bsmd.database
|
||||
|
||||
public static Dictionary<int, string> CargoHandlingDict { get; } = new Dictionary<int, string>();
|
||||
|
||||
public static List<string> MVSHLocodes { get; } = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region DatabaseEntity implementation
|
||||
@ -234,6 +236,15 @@ namespace bsmd.database
|
||||
errors.Add(RuleEngine.CreateError(ValidationCode.LOCODE, "PortOfLoading", this.PortOfLoading, this.Title, this.Identifier, this.Tablename));
|
||||
}
|
||||
|
||||
if(LADG.MVSHLocodes.Contains(this.MessageCore.PoC))
|
||||
{
|
||||
if (this.CargoCodeNST_3.IsNullOrEmpty())
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "CargoCodeNST_3 empty", this.CargoCodeNST_3, this.Title, this.Identifier, this.Tablename));
|
||||
|
||||
if(!this.CargoLACode.HasValue)
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "CargoLACode empty", "not set", this.Title, this.Identifier, this.Tablename));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
BIN
misc/db.sqlite
BIN
misc/db.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user