diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs index ff5b19ef..ce6c664b 100644 --- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs @@ -213,7 +213,7 @@ namespace ENI2 MessageCore existingCore = null; - if (newCore.IsDK && newCore.VisitId.IsNullOrEmpty() && newCore.TransitId.IsNullOrEmpty()) + if (!newCore.IsDK && newCore.VisitId.IsNullOrEmpty() && newCore.TransitId.IsNullOrEmpty()) { // deutsche Häfen fordern eine Visit-Id an, für DK erfolgt hier nur die Anlage eines Datensatzes newCore.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND; diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml index 88cc79a7..cfd06d26 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml @@ -80,7 +80,7 @@ - + diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs index 18af9999..d9a9d87f 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/MaritimeHealthDeclarationDetailControl.xaml.cs @@ -232,6 +232,7 @@ namespace ENI2.DetailViewControls this.RegisterIntegerUpDownChange(this.integerUpDownNumberOfIllPersons, Message.NotificationClass.MDH); this.RegisterTextboxChange(this.textBoxPlaceOfIssue, Message.NotificationClass.MDH); this.RegisterTextboxChange(this.textBoxStowawaysJoiningLocation, Message.NotificationClass.MDH); + this.RegisterDatePickerChange(this.datePickerDateOfIssue, Message.NotificationClass.MDH); } diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index 3c2a01fe..5d38bcbb 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -690,6 +690,7 @@ namespace ENI2.DetailViewControls for (int i = 0; i < this.dataGridMessages.SelectedItems.Count; i++) { Message selectedMessage = this.dataGridMessages.SelectedItems[i] as Message; + selectedMessage.LastStatus = selectedMessage.InternalStatus; selectedMessage.InternalStatus = Message.BSMDStatus.REPORT; selectedMessage.ReportingPartyId = App.UserId; // wichtig damit der Richtige(!) die Mail mit dem PDF bekommt DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(selectedMessage); diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml index 638e7f9f..5fc7ccb7 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/TowageDetailControl.xaml @@ -24,10 +24,10 @@ - + - - + + @@ -48,9 +48,9 @@ - - - + + + diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj index f39e35f3..eda3ca71 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.7.%2a + 5.0.8.%2a false true true @@ -84,10 +84,10 @@ Properties\app.manifest - C907F4E529D2646C3EAECBF9ACA831CCC99069A8 + DBBB0891995CB133BFEBAA82DFB101EE9701C465 - ENI2_TemporaryKey.pfx + ENI2_1_TemporaryKey.pfx true @@ -614,6 +614,7 @@ Settings.settings True + Reference.svcmap diff --git a/ENI-2/ENI2/ENI2/ENI2_1_TemporaryKey.pfx b/ENI-2/ENI2/ENI2/ENI2_1_TemporaryKey.pfx new file mode 100644 index 00000000..9f66974a Binary files /dev/null and b/ENI-2/ENI2/ENI2/ENI2_1_TemporaryKey.pfx differ diff --git a/ENI-2/ENI2/ENI2/EditControls/CopyDeclarationDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/CopyDeclarationDialog.xaml.cs index 5d1e1184..9fc89ab5 100644 --- a/ENI-2/ENI2/ENI2/EditControls/CopyDeclarationDialog.xaml.cs +++ b/ENI-2/ENI2/ENI2/EditControls/CopyDeclarationDialog.xaml.cs @@ -126,6 +126,7 @@ namespace ENI2.EditControls { this.doubleUpDownIMO.IsEnabled = false; this.locodePoC.LocodeValue = newVisitId.Substring(0, 5); + this.locodePoC.IsEnabled = false; } else { diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx index 72f2a695..161c8cda 100644 Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ diff --git a/nsw/Source/bsmd.ExcelReadService/Util.cs b/nsw/Source/bsmd.ExcelReadService/Util.cs index eb99b6b1..e6400229 100644 --- a/nsw/Source/bsmd.ExcelReadService/Util.cs +++ b/nsw/Source/bsmd.ExcelReadService/Util.cs @@ -541,7 +541,15 @@ namespace bsmd.ExcelReadService if (ibcPosition.Flashpoint_CEL == "-") aReadState = ExcelReader.ReadState.FAIL; else + { aReadState = ExcelReader.ReadState.OK; + double flashval = 0; + if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval)) + { + if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL + else ibcPosition.FlashpointInformation = 2; // LE60CEL + } + } } reader.Conf.ConfirmText(ibc_flash, ibcPosition.Flashpoint_CEL, aReadState); ibcPosition.Quantity_KGM = (int ?) reader.ReadNumber(ibc_quantity); @@ -867,9 +875,19 @@ namespace bsmd.ExcelReadService if (!ibcPosition.Flashpoint_CEL.IsNullOrEmpty()) { if (ibcPosition.Flashpoint_CEL == "-") + { aReadState = ExcelReader.ReadState.FAIL; + } else + { aReadState = ExcelReader.ReadState.OK; + double flashval = 0; + if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval)) + { + if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL + else ibcPosition.FlashpointInformation = 2; // LE60CEL + } + } } reader.Conf.ConfirmText(ibc_flash, ibcPosition.Flashpoint_CEL, aReadState); ibcPosition.Quantity_KGM = (int?)reader.ReadNumber(ibc_quantity); diff --git a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user index 98f83566..09edda29 100644 --- a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user +++ b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user @@ -2,6 +2,7 @@ true + Debug|Any CPU diff --git a/nsw/Source/bsmd.ReportGenerator/ReportService.cs b/nsw/Source/bsmd.ReportGenerator/ReportService.cs index 35a0eb6b..1278ee89 100644 --- a/nsw/Source/bsmd.ReportGenerator/ReportService.cs +++ b/nsw/Source/bsmd.ReportGenerator/ReportService.cs @@ -242,8 +242,8 @@ namespace bsmd.ReportGenerator if (aMessage.InternalStatus == Message.BSMDStatus.REPORT) { if ((aMessage.MessageNotificationClass != Message.NotificationClass.VISIT) && (aMessage.MessageNotificationClass != Message.NotificationClass.TRANSIT)) - reportMessages.Add(aMessage); - aMessage.InternalStatus = Message.BSMDStatus.PREPARE; + reportMessages.Add(aMessage); + aMessage.InternalStatus = aMessage.LastStatus.HasValue ? aMessage.LastStatus.Value : Message.BSMDStatus.PREPARE; DBManager.Instance.Save(aMessage); sb.Append(aMessage.MessageNotificationClassDisplay); sb.Append("_"); diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs index 4c4519ac..39a73a90 100644 --- a/nsw/Source/bsmd.database/Message.cs +++ b/nsw/Source/bsmd.database/Message.cs @@ -256,6 +256,11 @@ namespace bsmd.database /// public BSMDStatus InternalStatus { get; set; } + /// + /// Vorheriger Status (z.B. für nach der Report-Generierung), wird nicht immer gesetzt + /// + public BSMDStatus? LastStatus { get; set; } + /// /// Erweiterte Erläuterung für Status(-wechsel) zur Darstellung im ENI /// @@ -404,6 +409,7 @@ namespace bsmd.database cmd.Parameters.AddWithNullableValue("@REPORTINGPARTYID", this.reportingPartyId); cmd.Parameters.AddWithValue("@BSMDSTATUS", this.InternalStatus); + cmd.Parameters.AddWithNullableValue("@LASTSTATUS", this.LastStatus); cmd.Parameters.AddWithValue("@HIS", this.HIS); cmd.Parameters.AddWithNullableValue("@CREATEDBY", this.CreatedBy); cmd.Parameters.AddWithNullableValue("@CHANGEDBY", this.ChangedBy); @@ -415,8 +421,8 @@ namespace bsmd.database { this.CreateId(); cmd.Parameters.AddWithValue("@ID", this.Id); - string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess, SentBy) " + - "VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS, @SENTBY)", + string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess, SentBy) " + + "VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @LASTSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS, @SENTBY)", this.Tablename); cmd.CommandText = query; } @@ -424,7 +430,7 @@ namespace bsmd.database { cmd.Parameters.AddWithValue("@ID", this.Id); cmd.CommandText = string.Format("UPDATE {0} SET ClientRequestId = @CLIENTREQUESTID, MessageId = @MESSAGEID, SentAt = @SENTAT, ReceivedAt = @RECEIVEDAT, RequestedAt = @REQUESTEDAT, " + - "NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, HIS = @HIS, " + + "NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, LastStatus = @LASTSTATUS, HIS = @HIS, " + "CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS, SentBy = @SENTBY WHERE Id = @ID", this.Tablename); } } @@ -433,7 +439,7 @@ namespace bsmd.database public override void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria ) { string query = string.Format("SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, " + - "Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess, SentBy FROM {0} ", this.Tablename); + "Reset, Cancel, Status, ReportingPartyId, BSMDStatus, LastStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess, SentBy FROM {0} ", this.Tablename); switch (filter) { @@ -513,14 +519,15 @@ namespace bsmd.database if (!reader.IsDBNull(10)) msg.Status = (MessageStatus)Enum.ToObject(typeof(MessageStatus), reader.GetByte(10)); if (!reader.IsDBNull(11)) msg.reportingPartyId = reader.GetGuid(11); if (!reader.IsDBNull(12)) msg.InternalStatus = (BSMDStatus)Enum.ToObject(typeof(BSMDStatus), reader.GetByte(12)); - if (!reader.IsDBNull(13)) msg.HIS = (NSWProvider)Enum.ToObject(typeof(NSWProvider), reader.GetByte(13)); - if (!reader.IsDBNull(14)) msg.created = reader.GetDateTime(14); - if (!reader.IsDBNull(15)) msg.CreatedBy = reader.GetString(15); - if (!reader.IsDBNull(16)) msg.ChangedBy = reader.GetString(16); - if (!reader.IsDBNull(17)) msg.changed = reader.GetDateTime(17); - if (!reader.IsDBNull(18)) msg.StatusInfo = reader.GetString(18); - if (!reader.IsDBNull(19)) msg.SendSuccess = reader.GetBoolean(19); - if (!reader.IsDBNull(20)) msg.SentBy = reader.GetString(20); + if (!reader.IsDBNull(13)) msg.LastStatus = (BSMDStatus)Enum.ToObject(typeof(BSMDStatus), reader.GetByte(13)); + if (!reader.IsDBNull(14)) msg.HIS = (NSWProvider)Enum.ToObject(typeof(NSWProvider), reader.GetByte(14)); + if (!reader.IsDBNull(15)) msg.created = reader.GetDateTime(15); + if (!reader.IsDBNull(16)) msg.CreatedBy = reader.GetString(16); + if (!reader.IsDBNull(17)) msg.ChangedBy = reader.GetString(17); + if (!reader.IsDBNull(18)) msg.changed = reader.GetDateTime(18); + if (!reader.IsDBNull(19)) msg.StatusInfo = reader.GetString(19); + if (!reader.IsDBNull(20)) msg.SendSuccess = reader.GetBoolean(20); + if (!reader.IsDBNull(21)) msg.SentBy = reader.GetString(21); result.Add(msg); } reader.Close(); diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs index c8fe5228..041315ca 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.7")] +[assembly: AssemblyInformationalVersion("5.0.8")] [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 12933a9f..f9f7b973 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.7.*")] +[assembly: AssemblyVersion("5.0.8.*")] diff --git a/nsw/Source/bsmd.hisnord/Response.cs b/nsw/Source/bsmd.hisnord/Response.cs index 1319a726..c1ef08a0 100644 --- a/nsw/Source/bsmd.hisnord/Response.cs +++ b/nsw/Source/bsmd.hisnord/Response.cs @@ -85,13 +85,27 @@ namespace bsmd.hisnord if (Enum.TryParse(systemError.Meldetype, out notificationClass)) { Message refMessage = DBManager.Instance.GetMessage(aCore, notificationClass); - if(refMessage != null) - { + if (refMessage != null) + { refMessage.InternalStatus = Message.BSMDStatus.SEND_FAILED; systemError.MessageHeaderId = refMessage.Id; DBManager.Instance.Save(refMessage); } } + else + { + if (systemError.Meldetype.Equals("REQUEST_ID")) + { + // Request gescheitert + Message refMessage = DBManager.Instance.GetMessage(aCore, aCore.IsTransit ? Message.NotificationClass.TRANSIT : Message.NotificationClass.VISIT); + if (refMessage != null) + { + refMessage.InternalStatus = Message.BSMDStatus.SEND_FAILED; + systemError.MessageHeaderId = refMessage.Id; + DBManager.Instance.Save(refMessage); + } + } + } _log.WarnFormat("SystemError received for Core [{0}], IMO {1} ETA {2}: {3} Class {4}", aCore.Id, aCore.IMO, aCore.ETADisplay, systemError.ErrorMessage, Enum.GetName(typeof(Message.NotificationClass), notificationClass)); @@ -145,6 +159,13 @@ namespace bsmd.hisnord nswResponse.Status, (core.Cancelled ?? false) ? "YES" : "NO" ); + + if((nswResponse.Status == "ACCEPTED") && ((core.Cancelled == false) == true)) + { + core.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED; + _log.InfoFormat("Core cancel confirmed for {0}", core.DisplayId); + } + if ((nswResponse.Status == "REJECTED") && ((core.Cancelled ?? false) == true)) { core.Cancelled = false; // CANCEL fehlgeschlagen diff --git a/nsw/Source/bsmd.status/Settings.cs b/nsw/Source/bsmd.status/Settings.cs new file mode 100644 index 00000000..a6fa4482 --- /dev/null +++ b/nsw/Source/bsmd.status/Settings.cs @@ -0,0 +1,28 @@ +namespace bsmd.status.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + public sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + } +} diff --git a/nsw/Source/misc/db.sqlite b/nsw/Source/misc/db.sqlite index 968ec258..7c0cf676 100644 Binary files a/nsw/Source/misc/db.sqlite and b/nsw/Source/misc/db.sqlite differ