diff --git a/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs index 47af50e7..9611f6aa 100644 --- a/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs +++ b/ENI-2/ENI2/ENI2/Controls/ENIDataGrid.cs @@ -58,6 +58,7 @@ namespace ENI2.Controls public event Action EditRequested; public event Action DeleteRequested; public event Action CreateRequested; + public event Action RefreshGrid; public event Action PrintRequested; public event Action ExportRequested; @@ -179,10 +180,13 @@ namespace ENI2.Controls { this.DeleteRequested?.Invoke(deleteItem); } - } + } + + this.RefreshGrid?.Invoke(); + } } - } + } protected void editItem(object sender, RoutedEventArgs e) { diff --git a/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs index 781a9a21..076605c8 100644 --- a/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/Controls/LocodeControl.xaml.cs @@ -21,8 +21,8 @@ namespace ENI2.Controls { private List _locodeList = new List(); public event PropertyChangedEventHandler PropertyChanged; - private bool _comboSelect; - + private bool _comboSelect; + public LocodeControl() { InitializeComponent(); @@ -43,8 +43,44 @@ namespace ENI2.Controls { get { return this._locodeList; } set { this._locodeList = value; } + } + + public string SelectedItem + { + get { return this.comboBoxLocode.SelectedItem as string; } + set { + this._locodeList.Clear(); + + string portName = this.UseSSNCodes ? LocalizedLookup.SSNPortNameFromLocode(value) : LocodeDB.PortNameFromLocode(value); + LocodeState locodeState = portName.IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK; + this.SetLocodeStateImage(this.imageLocodeState, locodeState); + + if (locodeState == LocodeState.OK) + { + string valString = string.Format("{0} - {1}", value, portName); + this._locodeList.Add(valString); + this.comboBoxLocode.ItemsSource = this.LocodeList; + this.comboBoxLocode.SelectedItem = valString; + } + } } + /// + /// Actual value for DataBinding + /// + public string LocodeValue + { + get { return (string)GetValue(LocodeValueProperty); } + set { SetValue(LocodeValueProperty, value); } + } + + /// + /// Use alternate Locode Source (for NOA_NOD NextPort if unspecif. (888)) + /// + public bool UseSSNCodes { get; set; } + + #region static methods + public static readonly DependencyProperty LocodeValueProperty = DependencyProperty.Register("LocodeValue", typeof(string), typeof(LocodeControl), new UIPropertyMetadata(LocodeValueChangedHandler)); @@ -58,37 +94,7 @@ namespace ENI2.Controls ((LocodeControl)sender).SelectedItem = e.NewValue.ToString();//.Substring(0,5); } - - public string SelectedItem - { - get { return this.comboBoxLocode.SelectedItem as string; } - set { - this._locodeList.Clear(); - - string portName = LocodeDB.PortNameFromLocode(value); - LocodeState locodeState = portName.IsNullOrEmpty() ? LocodeState.INVALID : LocodeState.OK; - this.SetLocodeStateImage(this.imageLocodeState, locodeState); - - if (locodeState == LocodeState.OK) - { - string valString = string.Format("{0} - {1}", value, portName); - this._locodeList.Add(valString); - this.comboBoxLocode.ItemsSource = this.LocodeList; - this.comboBoxLocode.SelectedItem = valString; - } - } - } - - - - /// - /// Actual value for DataBinding - /// - public string LocodeValue - { - get { return (string)GetValue(LocodeValueProperty); } - set { SetValue(LocodeValueProperty, value); } - } + #endregion #region event handler @@ -116,7 +122,7 @@ namespace ENI2.Controls if (this.comboBoxLocode.Text.Length == 5) { string directLocode = this.comboBoxLocode.Text.Trim().ToUpper(); - string portname = LocodeDB.PortNameFromLocode(directLocode); + string portname = this.UseSSNCodes ? LocalizedLookup.SSNPortNameFromLocode(directLocode) : LocodeDB.PortNameFromLocode(directLocode); bool isLocode = !portname.IsNullOrEmpty(); if (isLocode) { @@ -131,7 +137,8 @@ namespace ENI2.Controls if (!locodeFound) { // assume this is a harbour name typed out.. - List locodeEntries = LocodeDB.AllLocodesForCityNameAsEntries("%" + this.comboBoxLocode.Text + "%"); + string lookupString = string.Format("%{0}%", this.comboBoxLocode.Text.Trim()); + List locodeEntries = this.UseSSNCodes ? LocalizedLookup.SSNAllLocodesForCityNameAsEntries(lookupString) : LocodeDB.AllLocodesForCityNameAsEntries(lookupString); locodeEntries.Sort(); foreach (LocodeDB.LocodeEntry entry in locodeEntries) diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs index 87b12a97..bf7078e0 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml.cs @@ -98,6 +98,7 @@ namespace ENI2.DetailViewControls this.dataGridCrewList.EditRequested += DataGridCrewList_EditRequested; this.dataGridCrewList.DeleteRequested += DataGridCrewList_DeleteRequested; this.dataGridCrewList.CreateRequested += DataGridCrewList_CreateRequested; + this.dataGridCrewList.RefreshGrid += DataGridCrewList_RefreshGrid; #endregion @@ -115,10 +116,11 @@ namespace ENI2.DetailViewControls this.dataGridPassengerList.EditRequested += DataGridPassengerList_EditRequested; this.dataGridPassengerList.DeleteRequested += DataGridPassengerList_DeleteRequested; this.dataGridPassengerList.CreateRequested += DataGridPassengerList_CreateRequested; + this.dataGridPassengerList.RefreshGrid += DataGridPassengerList_RefreshGrid; #endregion - } + } #region port of itinerary grid @@ -234,13 +236,17 @@ namespace ENI2.DetailViewControls { // are you sure dialog is in base class _pasMessage.Elements.Remove(pas); - DBManager.Instance.Delete(pas); - DatabaseEntity.ResetIdentifiers(_pasMessage.Elements); - this.SublistElementChanged(Message.NotificationClass.PAS); - this.dataGridPassengerList.Items.Refresh(); + DBManager.Instance.Delete(pas); } } + private void DataGridPassengerList_RefreshGrid() + { + DatabaseEntity.ResetIdentifiers(_pasMessage.Elements); + this.SublistElementChanged(Message.NotificationClass.PAS); + this.dataGridPassengerList.Items.Refresh(); + } + private void DataGridPassengerList_EditRequested(DatabaseEntity obj) { EditPASDialog epd = new EditPASDialog(); @@ -311,13 +317,17 @@ namespace ENI2.DetailViewControls { // are you sure dialog is in base class _crewMessage.Elements.Remove(crew); - DBManager.Instance.Delete(crew); - DatabaseEntity.ResetIdentifiers(_crewMessage.Elements); - this.SublistElementChanged(Message.NotificationClass.CREW); - this.dataGridCrewList.Items.Refresh(); + DBManager.Instance.Delete(crew); } } + private void DataGridCrewList_RefreshGrid() + { + DatabaseEntity.ResetIdentifiers(_crewMessage.Elements); + this.SublistElementChanged(Message.NotificationClass.CREW); + this.dataGridCrewList.Items.Refresh(); + } + private void DataGridCrewList_EditRequested(DatabaseEntity obj) { EditCREWDialog ecd = new EditCREWDialog(); diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml index 18507d45..a48b97a4 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml @@ -213,7 +213,7 @@ - + diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index cc6495e4..1ce30b7f 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -530,6 +530,11 @@ namespace ENI2.DetailViewControls this.Dispatcher.BeginInvoke(new Action(() => { + MessageCore reloadedCore = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreById(this.Core.Id.Value); + CoreStatusInfoDialog csid = new CoreStatusInfoDialog(); + csid.IsModal = false; + csid.Core = reloadedCore; + csid.Show(); this.busyIndicator.IsBusy = false; this.OnRequestReload(); })); @@ -558,6 +563,12 @@ namespace ENI2.DetailViewControls spvd.IsModal = false; spvd.DisplayObject = this.Core; spvd.Show(); + + //CoreStatusInfoDialog csid = new CoreStatusInfoDialog(); + //csid.IsModal = false; + //csid.Core = this.Core; + //csid.Show(); + } private void buttonErrors_Click(object sender, RoutedEventArgs e) diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml index edf525f8..e451d032 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml +++ b/ENI-2/ENI2/ENI2/DetailViewControls/PortCallDetailControl.xaml @@ -48,7 +48,7 @@ - + diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj index 3646e7a2..9da2f617 100644 --- a/ENI-2/ENI2/ENI2/ENI2.csproj +++ b/ENI-2/ENI2/ENI2/ENI2.csproj @@ -35,8 +35,8 @@ 3.5.1.0 true publish.html - 3 - 3.7.5.%2a + 1 + 3.8.0.%2a false true true @@ -228,6 +228,9 @@ WasteDetailControl.xaml + + CoreStatusInfoDialog.xaml + EditBKRDialog.xaml @@ -421,6 +424,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml new file mode 100644 index 00000000..faa94f55 --- /dev/null +++ b/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + diff --git a/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml.cs new file mode 100644 index 00000000..a59695af --- /dev/null +++ b/ENI-2/ENI2/ENI2/EditControls/CoreStatusInfoDialog.xaml.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2017 schick Informatik +// Description: Simple status info dialog +// + +using System.Windows; + +using bsmd.database; +using ENI2.Controls; + +namespace ENI2.EditControls +{ + /// + /// Interaction logic for CoreStatusInfoDialog.xaml + /// + public partial class CoreStatusInfoDialog : EditWindowBase + { + + public MessageCore Core { get; set; } + + public CoreStatusInfoDialog() + { + InitializeComponent(); + this.Loaded += CoreStatusInfoDialog_Loaded; + } + + private void CoreStatusInfoDialog_Loaded(object sender, RoutedEventArgs e) + { + if (this.Core == null) return; + this.checkBoxCancelled.IsChecked = this.Core.Cancelled; + this.checkBoxCancellable.IsChecked = this.Core.VisitIdOrTransitIdCancellable; + + this.textBlockBlocked.Text = this.Core.BlockedNotificationClasses; + this.textBlockOwn.Text = this.Core.OwnNotificationClasses; + this.textBlockFree.Text = this.Core.FreeNotificationClasses; + this.textBlockErrorCode.Text = this.Core.StatusCheckErrorCode; + this.textBlockErrorMessage.Text = this.Core.StatusCheckErrorMessage; + + } + } +} diff --git a/ENI-2/ENI2/ENI2/LocalizedLookup.cs b/ENI-2/ENI2/ENI2/LocalizedLookup.cs index 92226959..22e6a2ab 100644 --- a/ENI-2/ENI2/ENI2/LocalizedLookup.cs +++ b/ENI-2/ENI2/ENI2/LocalizedLookup.cs @@ -6,6 +6,9 @@ using System.Data; using System.Data.SQLite; using System.Collections.Generic; +using bsmd.database; +using bsmd.ExcelReadService; + namespace ENI2 { static class LocalizedLookup @@ -201,8 +204,49 @@ namespace ENI2 } } reader.Close(); + return result; + } + + public static string SSNPortNameFromLocode(string locode) + { + if (locode.IsNullOrEmpty()) return null; + if (locode.Length != 5) return null; + + string result = null; + string query = string.Format("SELECT LocationName FROM SSN_LOCODES WHERE LocationCode = '{0}'", locode); + + SQLiteCommand cmd = new SQLiteCommand(query, _con); + IDataReader reader = cmd.ExecuteReader(); + while (reader.Read()) + { + if (!reader.IsDBNull(0)) + result = reader.GetString(0); + break; + } + reader.Close(); return result; - + } + + public static List SSNAllLocodesForCityNameAsEntries(string city) + { + List results = new List(); + + string query = "SELECT LocationCode, LocationName FROM SSN_LOCODES WHERE LocationName like $PAR"; + SQLiteCommand cmd = new SQLiteCommand(query, _con); + cmd.Parameters.AddWithValue("$PAR", city); + IDataReader reader = cmd.ExecuteReader(); + while (reader.Read()) + { + if (!reader.IsDBNull(0) && !reader.IsDBNull(1)) + { + LocodeDB.LocodeEntry entry = new LocodeDB.LocodeEntry(); + entry.Locode = reader.GetString(0); + entry.Name = reader.GetString(1); + results.Add(entry); + } + } + reader.Close(); + return results; } } diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs index 7e8d71c8..dfdacd65 100644 --- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs +++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs @@ -325,8 +325,7 @@ namespace ENI2 if (!closedDialog.Core.IsDK) { // deutsche Häfen fordern eine Visit-Id an, für DK erfolgt hier nur die Anlage eines Datensatzes - closedDialog.Core.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND; - closedDialog.Core.InitialHIS = Message.NSWProvider.DUDR_TEST; + closedDialog.Core.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND; } if (closedDialog.Core.PoC.Equals("ZZNOK")) diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs index 6bcf79b3..906dd3aa 100644 --- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs +++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs @@ -809,6 +809,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Blocked classes. + /// + public static string textBlockedClasses { + get { + return ResourceManager.GetString("textBlockedClasses", resourceCulture); + } + } + /// /// Looks up a localized string similar to Border Police. /// @@ -908,6 +917,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Visit/TransitId can be cancelled. + /// + public static string textCancellable { + get { + return ResourceManager.GetString("textCancellable", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cancelled. /// @@ -1286,6 +1304,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Core status. + /// + public static string textCoreStatus { + get { + return ResourceManager.GetString("textCoreStatus", resourceCulture); + } + } + /// /// Looks up a localized string similar to Country. /// @@ -1691,6 +1718,24 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Error code. + /// + public static string textErrorCode { + get { + return ResourceManager.GetString("textErrorCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error message. + /// + public static string textErrorMessage { + get { + return ResourceManager.GetString("textErrorMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Errors. /// @@ -1862,6 +1907,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Free classes. + /// + public static string textFreeClasses { + get { + return ResourceManager.GetString("textFreeClasses", resourceCulture); + } + } + /// /// Looks up a localized string similar to Full. /// @@ -2870,6 +2924,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to Own classes. + /// + public static string textOwnClasses { + get { + return ResourceManager.GetString("textOwnClasses", resourceCulture); + } + } + /// /// Looks up a localized string similar to Package type. /// diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx index 99c75c3c..51b3e9ca 100644 --- a/ENI-2/ENI2/ENI2/Properties/Resources.resx +++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx @@ -1528,4 +1528,25 @@ Some messages have unsaved changes. Send anyway? + + Blocked classes + + + Visit/TransitId can be cancelled + + + Core status + + + Error code + + + Error message + + + Free classes + + + Own classes + \ No newline at end of file diff --git a/nsw/Source/SQL/4052Passengers.sql b/nsw/Source/SQL/4052Passengers.sql new file mode 100644 index 00000000..fadcf0ce Binary files /dev/null and b/nsw/Source/SQL/4052Passengers.sql differ diff --git a/nsw/Source/SQL/fk_index_create.sql b/nsw/Source/SQL/fk_index_create.sql new file mode 100644 index 00000000..45ba3f86 --- /dev/null +++ b/nsw/Source/SQL/fk_index_create.sql @@ -0,0 +1,4 @@ +SELECT 'CREATE INDEX [IX_' + f.name + '] ON ' + OBJECT_NAME(f.parent_object_id) + '(' + COL_NAME(fc.parent_object_id, fc.parent_column_id) + ')' +FROM sys.foreign_keys AS f +INNER JOIN sys.foreign_key_columns AS fc +ON f.OBJECT_ID = fc.constraint_object_id \ No newline at end of file diff --git a/nsw/Source/SQL/fk_indexes.sql b/nsw/Source/SQL/fk_indexes.sql new file mode 100644 index 00000000..66d8ad60 --- /dev/null +++ b/nsw/Source/SQL/fk_indexes.sql @@ -0,0 +1,40 @@ +CREATE INDEX [IX_FK_PAS_MessageHeader] ON PAS(MessageHeaderId) +CREATE INDEX [IX_FK_BPOL_MessageHeader] ON BPOL(MessageHeaderId) +CREATE INDEX [IX_FK_Error_MessageHeader] ON Error(MessageHeaderId) +CREATE INDEX [IX_FK_TOWA_MessageHeader] ON TOWA(MessageHeaderId) +CREATE INDEX [IX_FK_Violation_MessageHeader] ON Violation(MessageHeaderId) +CREATE INDEX [IX_FK_TOWD_MessageHeader] ON TOWD(MessageHeaderId) +CREATE INDEX [IX_FK_NOA_NOD_MessageHeader] ON NOA_NOD(MessageHeaderId) +CREATE INDEX [IX_FK_ATA_MessageHeader] ON ATA(MessageHeaderId) +CREATE INDEX [IX_FK_NAME_MessageHeader] ON NAME(MessageHeaderId) +CREATE INDEX [IX_FK_ATD_MessageHeader] ON ATD(MessageHeaderId) +CREATE INDEX [IX_FK_SEC_MessageHeader] ON SEC(MessageHeaderId) +CREATE INDEX [IX_FK_POBA_MessageHeader] ON POBA(MessageHeaderId) +CREATE INDEX [IX_FK_POBD_MessageHeader] ON POBD(MessageHeaderId) +CREATE INDEX [IX_FK_TIEFA_MessageHeader] ON TIEFA(MessageHeaderId) +CREATE INDEX [IX_FK_TIEFD_MessageHeader] ON TIEFD(MessageHeaderId) +CREATE INDEX [IX_FK_BKRA_MessageHeader] ON BKRA(MessageHeaderId) +CREATE INDEX [IX_FK_HAZA_MessageHeader] ON HAZA(MessageHeaderId) +CREATE INDEX [IX_FK_BKRD_MessageHeader] ON BKRD(MessageHeaderId) +CREATE INDEX [IX_FK_AGNT_MessageHeader] ON AGNT(MessageHeaderId) +CREATE INDEX [IX_FK_HAZD_MessageHeader] ON HAZD(MessageHeaderId) +CREATE INDEX [IX_FK_STAT_MessageHeader] ON STAT(MessageHeaderId) +CREATE INDEX [IX_FK_LADG_MessageHeader] ON LADG(MessageHeaderId) +CREATE INDEX [IX_FK_INFO_MessageHeader] ON INFO(MessageHeaderId) +CREATE INDEX [IX_FK_SERV_MessageHeader] ON SERV(MessageHeaderId) +CREATE INDEX [IX_FK_PRE72H_MessageHeader] ON PRE72H(MessageHeaderId) +CREATE INDEX [IX_FK_MDH_MessageHeader] ON MDH(MessageHeaderId) +CREATE INDEX [IX_FK_WAS_MessageHeader] ON WAS(MessageHeaderId) +CREATE INDEX [IX_FK_CREW_MessageHeader] ON CREW(MessageHeaderId) +CREATE INDEX [IX_FK_PortOfItinerary_BPOL] ON PortOfItinerary(BPOLId) +CREATE INDEX [IX_FK_MessageHeader_MessageCore] ON MessageHeader(MessageCoreId) +CREATE INDEX [IX_FK_MessageHeader_ReportingParty] ON MessageHeader(ReportingPartyId) +CREATE INDEX [IX_FK_CallPurpose_NOA_NOD] ON CallPurpose(NOA_NODId) +CREATE INDEX [IX_FK_LastTenPortFacilitiesCalled_SEC] ON LastTenPortFacilitiesCalled(SEC_Id) +CREATE INDEX [IX_FK_ShipToShipActivitiesDuringLastTenPortFacilitiesCalled_SEC] ON ShipToShipActivitiesDuringLastTenPortFacilitiesCalled(SEC_Id) +CREATE INDEX [IX_FK_SanitaryMeasuresDetail_MDH] ON SanitaryMeasuresDetail(MDH_Id) +CREATE INDEX [IX_FK_StowawaysJoiningLocation_MDH] ON StowawaysJoiningLocation(MDH_Id) +CREATE INDEX [IX_FK_PortOfCallLast30Days_MDH] ON PortOfCallLast30Days(MDH_Id) +CREATE INDEX [IX_FK_SInfectedArea_MDH] ON InfectedArea(MDH_Id) +CREATE INDEX [IX_FK_PortOfCallLast30DaysCrewJoinedShip_PortOfCallLast30Days] ON PortOfCallLast30DaysCrewJoinedShip(PortOfCallLast30DaysId) +CREATE INDEX [IX_FK_WasteDisposalServiceProvider_WAS] ON WasteDisposalServiceProvider(WASId) diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs index a2dfe51f..a6951405 100644 --- a/nsw/Source/bsmd.database/Message.cs +++ b/nsw/Source/bsmd.database/Message.cs @@ -359,6 +359,12 @@ namespace bsmd.database } } + /// + /// Dieses Flag wird gesetzt, sobald die Meldeklasse *einmal* erfolgreich gesendet wurde. Es bleibt bestehen, auch + /// wenn ein nachfolgender Sendevorgang auf einen Fehler läuft + /// + public bool? SendSuccess { get; set; } + #endregion #region IDatabaseEntity implementation @@ -402,13 +408,14 @@ namespace bsmd.database cmd.Parameters.AddWithNullableValue("@CREATEDBY", this.CreatedBy); cmd.Parameters.AddWithNullableValue("@CHANGEDBY", this.ChangedBy); cmd.Parameters.AddWithNullableValue("@STATUSINFO", this.StatusInfo); + cmd.Parameters.AddWithNullableValue("@SENDSUCCESS", this.SendSuccess); if (this.IsNew) { 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) " + - "VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO)", + 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) " + + "VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS)", this.Tablename); cmd.CommandText = query; } @@ -417,7 +424,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, " + - "CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO WHERE Id = @ID", this.Tablename); + "CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS WHERE Id = @ID", this.Tablename); } } @@ -425,7 +432,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 FROM {0} ", this.Tablename); + "Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess FROM {0} ", this.Tablename); switch (filter) { @@ -511,6 +518,7 @@ namespace bsmd.database 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); result.Add(msg); } reader.Close(); diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs index e0806c49..fbf8ed85 100644 --- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs +++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs @@ -2,6 +2,6 @@ [assembly: AssemblyCompany("Informatikbüro Daniel Schick")] [assembly: AssemblyProduct("BSMD NSW interface")] -[assembly: AssemblyInformationalVersion("3.7.5")] +[assembly: AssemblyInformationalVersion("3.8.0")] [assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")] [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 42a7ed3a..03d6ea57 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("3.7.5.*")] +[assembly: AssemblyVersion("3.8.0.*")] diff --git a/nsw/Source/bsmd.dbh/Response.cs b/nsw/Source/bsmd.dbh/Response.cs index 0b00b8b7..1d66ee90 100644 --- a/nsw/Source/bsmd.dbh/Response.cs +++ b/nsw/Source/bsmd.dbh/Response.cs @@ -134,19 +134,20 @@ namespace bsmd.dbh _log.WarnFormat("Violation received for {0}: {1}", Messages[i].Type, violation.ViolationText); violation.MessageHeaderId = aMessage.Id.Value; aMessage.InternalStatus = Message.BSMDStatus.VIOLATION; + aMessage.SendSuccess = true; DBManager.Instance.Save(violation); break; case dbh.response.RootMessageType.WARNING: _log.InfoFormat("WARNING received for {0}: {1}", Messages[i].Type, Messages[i].Text); - + aMessage.SendSuccess = true; break; case dbh.response.RootMessageType.INFO: default: _log.InfoFormat("INFO received for {0}: {1}", Messages[i].Type, Messages[i].Text); - + aMessage.SendSuccess = true; break; } } diff --git a/nsw/Source/bsmd.hisnord/Response.cs b/nsw/Source/bsmd.hisnord/Response.cs index e5d089d9..53ba5358 100644 --- a/nsw/Source/bsmd.hisnord/Response.cs +++ b/nsw/Source/bsmd.hisnord/Response.cs @@ -154,6 +154,7 @@ namespace bsmd.hisnord if(isAccepted) { + aMessage.SendSuccess = true; aMessage.Status = Message.MessageStatus.ACCEPTED; aMessage.InternalStatus = Message.BSMDStatus.CONFIRMED; if (nswResponse.Violations.Count > 0) diff --git a/nsw/Source/misc/db.sqlite b/nsw/Source/misc/db.sqlite index 1acffee5..cb1f587d 100644 Binary files a/nsw/Source/misc/db.sqlite and b/nsw/Source/misc/db.sqlite differ