diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml.cs
index df665f9b..97fb0678 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/SecurityDetailControl.xaml.cs
@@ -447,7 +447,7 @@ namespace ENI2.DetailViewControls
private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e)
{
this.dateTimePickerKielCanalPassagePlannedIncomming.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
- this.dateTimePickerKielCanalPassagePlannedOutgoing.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
+ this.dateTimePickerKielCanalPassagePlannedOutgoing.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
}
private void CheckBoxSECSimplification_Checked(object sender, RoutedEventArgs e)
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index f825ee81..a76cd9b2 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -36,7 +36,7 @@
true
publish.html
1
- 5.0.18.%2a
+ 5.0.19.%2a
false
true
true
diff --git a/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
index 5ef6c5fa..fcb180c0 100644
--- a/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/EditWasteDialog.xaml
@@ -36,7 +36,7 @@
-
+
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index 71f39b5c..24716fb8 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs b/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
index 1ce2e1bd..d5b23615 100644
--- a/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
+++ b/nsw/Source/bsmd.ExcelReadService/ExcelReader.cs
@@ -166,12 +166,10 @@ namespace bsmd.ExcelReadService
internal int? ReadCargoLACode(string lookup)
{
- int result;
-
string val = ReadText(lookup);
if (val.IsNullOrEmpty()) return null;
- if(int.TryParse(val, out result))
+ if(int.TryParse(val, out int result))
{
if ((result >= 10) && (result <= 99))
this.Conf.ConfirmText(lookup, val, ReadState.OK);
@@ -361,8 +359,7 @@ namespace bsmd.ExcelReadService
bool isValid = false;
if(!val.IsNullOrEmpty())
{
- int typeVal;
- if(int.TryParse(val, out typeVal))
+ if (int.TryParse(val, out int typeVal))
{
if ((typeVal >= 1) && (typeVal <= 23))
isValid = true;
@@ -452,23 +449,21 @@ namespace bsmd.ExcelReadService
CultureInfo provider = CultureInfo.InvariantCulture;
string dateString = val.ToString();
string format = "yyyyMMdd";
- DateTime tmpDate;
- if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
+ if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
date = tmpDate;
}
}
if (date == null)
{
- DateTime tmpDate;
- if (DateTime.TryParse(val, out tmpDate))
+ if (DateTime.TryParse(val, out DateTime tmpDate))
date = tmpDate;
}
// TODO: weitere varianten ausprobieren
if (date != null)
{
- if ((date.Value < new DateTime(1900, 1, 1)) || (date.Value > new DateTime(2030, 1, 1)))
+ if ((date.Value < new DateTime(1899, 1, 1)) || (date.Value > new DateTime(2030, 1, 1)))
{
date = null;
this.Conf.ConfirmDate(lookup, date, noHighlight ? ReadState.NONE : ReadState.WARN);
@@ -543,8 +538,7 @@ namespace bsmd.ExcelReadService
if (!dateString.Contains(":"))
{
string format = "HHmm";
- DateTime tmpDate;
- if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
+ if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
result = tmpDate;
}
}
@@ -552,15 +546,13 @@ namespace bsmd.ExcelReadService
}
if (result == null)
{
- DateTime date;
- if (DateTime.TryParseExact(val, "HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out date))
+ if (DateTime.TryParseExact(val, "HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out DateTime date))
result = date;
}
if (result == null)
{
- DateTime date;
- if (DateTime.TryParseExact(val, "HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out date))
+ if (DateTime.TryParseExact(val, "HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out DateTime date))
result = date;
}
@@ -570,9 +562,8 @@ namespace bsmd.ExcelReadService
string dateString = val.ToString();
if (!dateString.Contains(":"))
{
- string format = "HHmm";
- DateTime tmpDate;
- if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
+ const string format = "HHmm";
+ if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
result = tmpDate;
}
}
@@ -607,9 +598,8 @@ namespace bsmd.ExcelReadService
if (val is double) result = val;
if (val is string)
{
- double tmpDouble;
- if (double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite,
- CultureInfo.InvariantCulture, out tmpDouble))
+ if (double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite,
+ CultureInfo.InvariantCulture, out double tmpDouble))
result = tmpDouble;
if (result == null)
{
diff --git a/nsw/Source/bsmd.ExcelReadService/Util.cs b/nsw/Source/bsmd.ExcelReadService/Util.cs
index 90b78c41..e7f7435e 100644
--- a/nsw/Source/bsmd.ExcelReadService/Util.cs
+++ b/nsw/Source/bsmd.ExcelReadService/Util.cs
@@ -16,7 +16,7 @@ using bsmd.database;
namespace bsmd.ExcelReadService
{
- public class Util
+ public static class Util
{
private static ILog _log = LogManager.GetLogger(typeof(Util));
@@ -543,8 +543,7 @@ namespace bsmd.ExcelReadService
else
{
aReadState = ExcelReader.ReadState.OK;
- double flashval = 0;
- if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
+ if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
else ibcPosition.FlashpointInformation = 2; // LE60CEL
@@ -686,8 +685,7 @@ namespace bsmd.ExcelReadService
if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017
else
{
- double flashval = 0;
- if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
+ if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL
@@ -883,8 +881,7 @@ namespace bsmd.ExcelReadService
else
{
aReadState = ExcelReader.ReadState.OK;
- double flashval = 0;
- if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
+ if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
else ibcPosition.FlashpointInformation = 2; // LE60CEL
@@ -1026,8 +1023,7 @@ namespace bsmd.ExcelReadService
if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017
else
{
- double flashval = 0;
- if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
+ if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL
@@ -1781,9 +1777,11 @@ namespace bsmd.ExcelReadService
bool? secKielDeparture = reader.ReadBoolean("SEC.KielCanalPassagePlanned_Departure");
sec.KielCanalPassagePlanned = (secKielArrival ?? false) || (secKielDeparture ?? false);
- sec.KielCanalPassagePlannedIncomming = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedIncomming", "SEC.ETATimeKielCanalPassagePlannedIncomming", !(secKielArrival ?? false));
- sec.KielCanalPassagePlannedOutgoing = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedOutgoing", "SEC.ETATimeKielCanalPassagePlannedOutgoing", !(secKielDeparture ?? false));
-
+ if (sec.KielCanalPassagePlanned ?? false)
+ {
+ sec.KielCanalPassagePlannedIncomming = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedIncomming", "SEC.ETATimeKielCanalPassagePlannedIncomming", !(secKielArrival ?? false));
+ sec.KielCanalPassagePlannedOutgoing = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedOutgoing", "SEC.ETATimeKielCanalPassagePlannedOutgoing", !(secKielDeparture ?? false));
+ }
// Last10PortFacilitesCalled
for (int i = 1; i <= 10; i++)
@@ -2678,7 +2676,7 @@ namespace bsmd.ExcelReadService
if (poc != null)
{
// Prüfen auf Transit
- if (poc.ToUpper().Contains("CANAL") || poc.ToUpper().Equals("ZZNOK"))
+ if (poc.IndexOf("CANAL", StringComparison.OrdinalIgnoreCase) >= 0 || poc.Equals("ZZNOK", StringComparison.OrdinalIgnoreCase))
{
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE);
poc = "ZZNOK";
diff --git a/nsw/Source/bsmd.database/NOA_NOD.cs b/nsw/Source/bsmd.database/NOA_NOD.cs
index 70e7342d..3b459ca3 100644
--- a/nsw/Source/bsmd.database/NOA_NOD.cs
+++ b/nsw/Source/bsmd.database/NOA_NOD.cs
@@ -35,7 +35,7 @@ namespace bsmd.database
public DateTime? ETDFromPortOfCall { get; set; }
[Validation1(ValidationCode.LIST_EMPTY)]
- public ObservableCollection CallPurposes { get; private set; } = new ObservableCollection();
+ public ObservableCollection CallPurposes { get; } = new ObservableCollection();
[ShowReport]
[Validation2(ValidationCode.NOT_NULL)]
@@ -247,7 +247,7 @@ namespace bsmd.database
if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort", null, this.Title, null, this.Tablename));
- if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && !this.NextPort.Equals("ZZUKN") &&
+ if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && (this.NextPort?.Equals("ZZUKN") == false) &&
(this.ETAToNextPort <= ETDFromPortOfCall))
errors.Add(RuleEngine.CreateError(ValidationCode.E122, "ETAToNextPort", null, this.Title, null, this.Tablename));
@@ -314,8 +314,7 @@ namespace bsmd.database
noanod.NextPort = this.NextPort;
noanod.IsAnchored = this.IsAnchored;
- noanod.id = null;
- noanod.CallPurposes = new ObservableCollection();
+ noanod.id = null;
foreach (CallPurpose cp in this.CallPurposes)
{
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index 7d83a624..a8741a24 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
-[assembly: AssemblyInformationalVersion("5.0.18")]
+[assembly: AssemblyInformationalVersion("5.0.20")]
[assembly: AssemblyCopyright("Copyright © 2014-2018 schick Informatik")]
[assembly: AssemblyTrademark("")]
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
index da32c9dd..0f58f37b 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-[assembly: AssemblyVersion("5.0.18.*")]
+[assembly: AssemblyVersion("5.0.20.*")]
diff --git a/nsw/Source/bsmd.database/SEC.cs b/nsw/Source/bsmd.database/SEC.cs
index c65fe0e1..551273a2 100644
--- a/nsw/Source/bsmd.database/SEC.cs
+++ b/nsw/Source/bsmd.database/SEC.cs
@@ -206,7 +206,7 @@ namespace bsmd.database
}
else
{
- scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET SECSimplification = @P2, PortOfCallWhereCompleteSECNotified = @P3, " +
"CSOLastName = @P4, CSOFirstName = @P5, CSOPhone = @P6," +
"CSOEMail = @P7, ValidISSCOnBoard = @P8, ReasonsForNoValidISSC = @P9, " +
diff --git a/nsw/Source/bsmd.database/Util.cs b/nsw/Source/bsmd.database/Util.cs
index a1aa53d6..10fbe4b5 100644
--- a/nsw/Source/bsmd.database/Util.cs
+++ b/nsw/Source/bsmd.database/Util.cs
@@ -17,9 +17,9 @@ namespace bsmd.database
{
public static class Util
{
- private static Regex regexVisit = new Regex("(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})", RegexOptions.IgnoreCase);
- private static Regex regexTransit = new Regex("(ZZNOK)-([0-9]{4})-([A-Z]{6})", RegexOptions.IgnoreCase);
- private static ILog _log = LogManager.GetLogger(typeof(Util));
+ private static readonly Regex regexVisit = new Regex("^(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})$", RegexOptions.IgnoreCase);
+ private static readonly Regex regexTransit = new Regex("^(ZZNOK)-([0-9]{4})-([A-Z]{6})$", RegexOptions.IgnoreCase);
+ private static readonly ILog _log = LogManager.GetLogger(typeof(Util));
///
/// Extension helper to add values that can be null:
@@ -139,7 +139,7 @@ namespace bsmd.database
}
bool isDE, isDK;
- if((core != null) && (core.PoC != null))
+ if(core?.PoC != null)
{
isDE = core.PoC.Equals("ZZNOK") || core.PoC.StartsWith("DE");
isDK = core.PoC.StartsWith("DK");
diff --git a/nsw/Source/bsmd.database/Waste.cs b/nsw/Source/bsmd.database/Waste.cs
index 018e9e35..f711ff0e 100644
--- a/nsw/Source/bsmd.database/Waste.cs
+++ b/nsw/Source/bsmd.database/Waste.cs
@@ -88,7 +88,7 @@ namespace bsmd.database
public int? WasteType { get; set; }
[ShowReport]
- [MaxLength(100)]
+ [MaxLength(99)]
[ENI2Validation]
public string WasteDescription { get; set; }
@@ -184,7 +184,7 @@ namespace bsmd.database
}
else
{
- scmd.Parameters.AddWithValue(@"ID", this.Id);
+ scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET WasteType = @P2, WasteDescription = @P3, " +
"WasteDisposalAmount_MTQ = @P4, WasteCapacity_MTQ = @P5, WasteAmountRetained_MTQ = @P6," +
"WasteDisposalPort = @P7, WasteAmountGeneratedTillNextPort_MTQ = @P8, WasteDisposedAtLastPort_MTQ = @P9, " +
diff --git a/nsw/Source/misc/db.sqlite b/nsw/Source/misc/db.sqlite
index facb931b..acb65eab 100644
Binary files a/nsw/Source/misc/db.sqlite and b/nsw/Source/misc/db.sqlite differ