diff --git a/ENI-2/ENI2/ENI2/ENI2.licenseheader b/ENI-2/ENI2/ENI2/ENI2.licenseheader
index 3205f00b..91f414a7 100644
--- a/ENI-2/ENI2/ENI2/ENI2.licenseheader
+++ b/ENI-2/ENI2/ENI2/ENI2.licenseheader
@@ -1,12 +1,12 @@
extensions: designer.cs generated.cs
extensions: .cs .cpp .h
-// Copyright (c) 2017 schick Informatik
+// Copyright (c) 2017- schick Informatik
// Description:
//
extensions: .aspx .ascx
<%--
-Copyright (c) 2017 Informatikbüro Daniel Schick
+Copyright (c) 2017- Informatikbüro Daniel Schick
--%>
extensions: .vb
'Sample license text.
diff --git a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
index 14f84b0c..0c9dcb1d 100644
--- a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
- Title="{x:Static p:Resources.textVisitTransitId}" Height="152" Width="300" WindowStyle="SingleBorderWindow">
+ Title="{x:Static p:Resources.textVisitTransitId}" Height="152" Width="300" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterOwner" >
@@ -14,9 +14,9 @@
-
+
-
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
index ad0ece58..6875b6c4 100644
--- a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
@@ -34,10 +34,20 @@ namespace ENI2.EditControls
get { return this.textBoxId.Text; }
}
+ public void UpdateId(string id)
+ {
+ this.Dispatcher.Invoke(new Action(() =>
+ {
+ this.DisplayId = id;
+ this.statusLabel.Content = Properties.Resources.textIdReceived;
+ this.statusLabel.Background = Brushes.LightGreen;
+ this.clickToCopyLabel.Visibility = Visibility.Visible;
+ }));
+ }
+
private void textBoxId_MouseDown(object sender, MouseButtonEventArgs e)
{
- Clipboard.SetText(this.textBoxId.Text);
- this.textBoxId.Background = Brushes.LightGreen;
+ Clipboard.SetText(this.textBoxId.Text);
}
private void Button_Click(object sender, RoutedEventArgs e)
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
index 0e97bdcf..17d43785 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
@@ -47,7 +47,8 @@ namespace ENI2
private int failedLogonCount;
private ReportingParty userEntity;
private readonly ILog _log = LogManager.GetLogger(typeof(MainWindow));
- private readonly DatabaseEntityWatchdog _dbWatchDog;
+ private readonly DatabaseEntityWatchdog _dbWatchDog;
+ private ShowIdDialog showIdDialog;
#endregion
@@ -402,8 +403,20 @@ namespace ENI2
// Meldeklassen für neuen Anlauf erzeugen:
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core, null, userEntity);
-
- this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
+
+ // watchdog registrieren
+ this._dbWatchDog.Register(closedDialog.Core);
+
+ // Wartedialog anzeigen
+ this.showIdDialog = new ShowIdDialog();
+ this.showIdDialog.Closed += (showIdDialog, showIdArgs) =>
+ {
+ // wenn der Dialog vorzeitig geschlossen wird erkennt man später dass man die Id dort nicht updaten braucht
+ this.showIdDialog = null;
+ this._dbWatchDog.UnRegister(closedDialog.Core);
+ };
+ this.showIdDialog.ShowDialog();
+ // this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
}
};
visitIdDialog.Show();
@@ -498,12 +511,17 @@ namespace ENI2
{
if (entity is MessageCore changedCore)
{
- TabItem tabitem = this.openTabs[changedCore.Id.Value];
- this.Dispatcher.BeginInvoke(new Action(() =>
+ this.showIdDialog?.UpdateId(changedCore.VisitId.IsNullOrEmpty() ? changedCore.TransitId : changedCore.VisitId);
+
+ if (this.openTabs.ContainsKey(changedCore.Id.Value))
{
- DetailRootControl drc = tabitem.Content as DetailRootControl;
- drc?.CoreChanged(changedCore);
- }));
+ TabItem tabitem = this.openTabs[changedCore.Id.Value];
+ this.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ DetailRootControl drc = tabitem.Content as DetailRootControl;
+ drc?.CoreChanged(changedCore);
+ }));
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index c5c11dc7..d4bad6bb 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -2360,6 +2360,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Id received.
+ ///
+ public static string textIdReceived {
+ get {
+ return ResourceManager.GetString("textIdReceived", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to IGC item.
///
@@ -3800,6 +3809,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Requested at.
+ ///
+ public static string textRequestedAt {
+ get {
+ return ResourceManager.GetString("textRequestedAt", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Requested position in port of call.
///
@@ -4772,6 +4790,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Waiting for Id...
+ ///
+ public static string textWaitForId {
+ get {
+ return ResourceManager.GetString("textWaitForId", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Waste.
///
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx
index 316b30d5..53cd7cf8 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -1717,4 +1717,13 @@
Maersk / SeaGo
+
+ Id received
+
+
+ Requested at
+
+
+ Waiting for Id..
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs b/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
index 226e2bf6..77ad22f0 100644
--- a/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
+++ b/ENI-2/ENI2/ENI2/Util/DatabaseEntityWatchdog.cs
@@ -27,6 +27,7 @@ namespace ENI2.Util
{
this.bgTimer = new Timer();
this.bgTimer.Elapsed += BgTimer_Elapsed;
+ this.bgTimer.AutoReset = true;
this.bgTimer.Interval = Properties.Settings.Default.changeTimerTimeout;
}
@@ -49,13 +50,13 @@ namespace ENI2.Util
if(entity.IsTransit)
{
- if (!entity.TransitId.IsNullOrEmpty() && !watchedEntity.TransitId.IsNullOrEmpty() && !entity.TransitId.Equals(watchedEntity.TransitId))
+ if (!entity.TransitId.IsNullOrEmpty() && watchedEntity.TransitId.IsNullOrEmpty() && !entity.TransitId.Equals(watchedEntity.TransitId))
{
OnVisitTransitIdUpdated(entity);
watchedEntity.TransitId = entity.TransitId;
}
}
- else if (!entity.VisitId.IsNullOrEmpty() && !watchedEntity.VisitId.IsNullOrEmpty() && !entity.VisitId.Equals(watchedEntity.VisitId))
+ else if (!entity.VisitId.IsNullOrEmpty() && watchedEntity.VisitId.IsNullOrEmpty() && !entity.VisitId.Equals(watchedEntity.VisitId))
{
OnVisitTransitIdUpdated(entity);
watchedEntity.VisitId = entity.VisitId;
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index c26e9a33..cba2f41d 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ