diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index 2ea8e48f..e21933b8 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -36,7 +36,7 @@ 5.4.0.0 true publish.html - 1 + 2 7.8.0.%2a false true diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs index 5bb5be88..be898e4f 100644 --- a/ENI2/Excel/ExcelUtil.cs +++ b/ENI2/Excel/ExcelUtil.cs @@ -2061,8 +2061,7 @@ namespace ENI2.Excel private static bool ScanCREW(Message crewMessage, ExcelReader reader, bool isOldVersion) { crewMessage.DeleteElements(); - - string sheetTitle = "6. CREW - Arrival"; + const string sheetTitle = "6. CREW - Arrival"; // 6. CREW - Arrival // 5.9.22: Changed this area to work like reading from a Dakosy Sheet (by values in rows, not cell names) if (reader.HasWorksheetNamed(sheetTitle)) @@ -2174,7 +2173,7 @@ namespace ENI2.Excel private static bool ScanCREWD(Message crewdMessage, ExcelReader reader) { crewdMessage.DeleteElements(); - string sheetTitle = "7. CREW - Departure"; + const string sheetTitle = "7. CREW - Departure"; // CREW DEPARTURE if (reader.HasWorksheetNamed(sheetTitle)) { @@ -2286,7 +2285,7 @@ namespace ENI2.Excel { List newPasList = new List(); - string sheetTitle = "8. PAX - Arrival"; + const string sheetTitle = "8. PAX - Arrival"; if (reader.HasWorksheetNamed(sheetTitle)) { diff --git a/ENI2/MainWindow.xaml.cs b/ENI2/MainWindow.xaml.cs index 5fa1c4a2..f54b77e9 100644 --- a/ENI2/MainWindow.xaml.cs +++ b/ENI2/MainWindow.xaml.cs @@ -593,11 +593,8 @@ namespace ENI2 } this.showIdDict.Remove(changedCore.Id.Value); // this._dbWatchDog.UnRegister(changedCore); // wird ggf später abgeräumt wenn der Tab geschlossen wird - this.Dispatcher.Invoke(new Action(() => - { - UpdateWaitIdLabel(); - })); - } + this.Dispatcher.Invoke(new Action(() => UpdateWaitIdLabel())); + } if (this.openTabs.ContainsKey(changedCore.Id.Value)) { diff --git a/bsmd.database/Extensions.cs b/bsmd.database/Extensions.cs index 0e745fd5..87c4cea2 100644 --- a/bsmd.database/Extensions.cs +++ b/bsmd.database/Extensions.cs @@ -142,6 +142,14 @@ namespace bsmd.database return source.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"); } + public static DateTime ToUTCSerializableDateTime(this DateTime source) + { + return new DateTime( + source.Ticks - (source.Ticks % TimeSpan.TicksPerSecond), + DateTimeKind.Utc + ); + } + public static List RegexSplit(this string source) { List result = new List(); diff --git a/bsmd.dbh/RequestUtil.cs b/bsmd.dbh/RequestUtil.cs index c44f7339..9f67fbf2 100644 --- a/bsmd.dbh/RequestUtil.cs +++ b/bsmd.dbh/RequestUtil.cs @@ -179,10 +179,10 @@ namespace bsmd.dbh RootNOA_NOD rootNOA_NOD = new RootNOA_NOD(); rootNOA_NOD.ETAToNextPortSpecified = noa_nod.ETAToNextPort.HasValue; if (noa_nod.ETAToNextPort.HasValue) - rootNOA_NOD.ETAToNextPort = noa_nod.ETAToNextPort.Value; + rootNOA_NOD.ETAToNextPort = noa_nod.ETAToNextPort.Value.ToUTCSerializableDateTime(); rootNOA_NOD.ETDFromLastPortSpecified = noa_nod.ETDFromLastPort.HasValue; if (noa_nod.ETDFromLastPort.HasValue) - rootNOA_NOD.ETDFromLastPort = noa_nod.ETDFromLastPort.Value; + rootNOA_NOD.ETDFromLastPort = noa_nod.ETDFromLastPort.Value.ToUTCSerializableDateTime(); rootNOA_NOD.LastPort = noa_nod.LastPort; rootNOA_NOD.NextPort = noa_nod.NextPort; List choiceList = new List(); @@ -192,13 +192,13 @@ namespace bsmd.dbh if (noa_nod.ETAToKielCanal.HasValue) { choiceList.Add(ItemsChoiceType.ETAToKielCanal); - choices.Add(noa_nod.ETAToKielCanal.Value); + choices.Add(noa_nod.ETAToKielCanal.Value.ToUTCSerializableDateTime()); } if (noa_nod.ETDFromKielCanal.HasValue) { choiceList.Add(ItemsChoiceType.ETDFromKielCanal); - choices.Add(noa_nod.ETDFromKielCanal.Value); + choices.Add(noa_nod.ETDFromKielCanal.Value.ToUTCSerializableDateTime()); } } else @@ -206,13 +206,13 @@ namespace bsmd.dbh if (noa_nod.ETAToPortOfCall.HasValue) { choiceList.Add(ItemsChoiceType.ETAToPortOfCall); - choices.Add(noa_nod.ETAToPortOfCall.Value); + choices.Add(noa_nod.ETAToPortOfCall.Value.ToUTCSerializableDateTime()); } if (noa_nod.ETDFromPortOfCall.HasValue) { choiceList.Add(ItemsChoiceType.ETDFromPortOfCall); - choices.Add(noa_nod.ETDFromPortOfCall.Value); + choices.Add(noa_nod.ETDFromPortOfCall.Value.ToUTCSerializableDateTime()); } for (int i = 0; i < noa_nod.CallPurposes.Count; i++) @@ -434,9 +434,9 @@ namespace bsmd.dbh for (int i = 0; i < bpol.PortOfItineraries.Count; i++) { RootBPOLPortOfItinerary port = new RootBPOLPortOfItinerary(); - PortOfItinerary portOfItinerary = bpol.PortOfItineraries[i] as PortOfItinerary; + PortOfItinerary portOfItinerary = bpol.PortOfItineraries[i]; if (portOfItinerary.PortOfItineraryETA.HasValue) - port.PortOfItineraryETA = portOfItinerary.PortOfItineraryETA.Value; + port.PortOfItineraryETA = portOfItinerary.PortOfItineraryETA.Value.ToUTCSerializableDateTime(); port.PortOfItineraryName = portOfItinerary.PortOfItineraryName; poiArray[i] = port; }