Warte-Dialog nach ID Beantragung bleibt jetzt offen bzw. wird nicht erst angezeigt, wenn die Id da ist. Der Reiter mit der neuen Anmeldung wird erst gar nicht mehr angezeigt.

This commit is contained in:
Daniel Schick 2020-12-16 08:42:54 +00:00
parent cabb81de1f
commit 7ce4a89386
8 changed files with 82 additions and 17 deletions

View File

@ -1,12 +1,12 @@
extensions: designer.cs generated.cs extensions: designer.cs generated.cs
extensions: .cs .cpp .h extensions: .cs .cpp .h
// Copyright (c) 2017 schick Informatik // Copyright (c) 2017- schick Informatik
// Description: // Description:
// //
extensions: .aspx .ascx extensions: .aspx .ascx
<%-- <%--
Copyright (c) 2017 Informatikbüro Daniel Schick Copyright (c) 2017- Informatikbüro Daniel Schick
--%> --%>
extensions: .vb extensions: .vb
'Sample license text. 'Sample license text.

View File

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d" 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" >
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />
@ -14,9 +14,9 @@
<RowDefinition Height="28" /> <RowDefinition Height="28" />
<RowDefinition Height="28" /> <RowDefinition Height="28" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Content="Id updated:" Grid.Row="0" /> <Label Name="statusLabel" HorizontalAlignment="Center" Content="{x:Static p:Resources.textWaitForId}" Background="LemonChiffon"/>
<TextBox IsReadOnly="True" Name="textBoxId" MouseDown="textBoxId_MouseDown" FontWeight="Bold" HorizontalAlignment="Center" VerticalContentAlignment="Center" Margin="2" Grid.Row="1"/> <TextBox IsReadOnly="True" Name="textBoxId" MouseDown="textBoxId_MouseDown" FontWeight="Bold" HorizontalAlignment="Center" VerticalContentAlignment="Center" Margin="2" Grid.Row="1"/>
<Label Content=" -> click to copy" HorizontalAlignment="Center" Grid.Row="2" MouseDown="textBoxId_MouseDown"/> <Label Name="clickToCopyLabel" Content=" -> click to copy" HorizontalAlignment="Center" Grid.Row="2" MouseDown="textBoxId_MouseDown" Visibility="Hidden"/>
<Button Grid.Row="3" HorizontalAlignment="Right" Content="OK" Margin="2" Width="100" Click="Button_Click" /> <Button Grid.Row="3" HorizontalAlignment="Right" Content="OK" Margin="2" Width="100" Click="Button_Click" />
</Grid> </Grid>
</Window> </Window>

View File

@ -34,10 +34,20 @@ namespace ENI2.EditControls
get { return this.textBoxId.Text; } 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) private void textBoxId_MouseDown(object sender, MouseButtonEventArgs e)
{ {
Clipboard.SetText(this.textBoxId.Text); Clipboard.SetText(this.textBoxId.Text);
this.textBoxId.Background = Brushes.LightGreen;
} }
private void Button_Click(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e)

View File

@ -47,7 +47,8 @@ namespace ENI2
private int failedLogonCount; private int failedLogonCount;
private ReportingParty userEntity; private ReportingParty userEntity;
private readonly ILog _log = LogManager.GetLogger(typeof(MainWindow)); private readonly ILog _log = LogManager.GetLogger(typeof(MainWindow));
private readonly DatabaseEntityWatchdog _dbWatchDog; private readonly DatabaseEntityWatchdog _dbWatchDog;
private ShowIdDialog showIdDialog;
#endregion #endregion
@ -402,8 +403,20 @@ namespace ENI2
// Meldeklassen für neuen Anlauf erzeugen: // Meldeklassen für neuen Anlauf erzeugen:
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core, null, userEntity); 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(); visitIdDialog.Show();
@ -498,12 +511,17 @@ namespace ENI2
{ {
if (entity is MessageCore changedCore) if (entity is MessageCore changedCore)
{ {
TabItem tabitem = this.openTabs[changedCore.Id.Value]; this.showIdDialog?.UpdateId(changedCore.VisitId.IsNullOrEmpty() ? changedCore.TransitId : changedCore.VisitId);
this.Dispatcher.BeginInvoke(new Action(() =>
if (this.openTabs.ContainsKey(changedCore.Id.Value))
{ {
DetailRootControl drc = tabitem.Content as DetailRootControl; TabItem tabitem = this.openTabs[changedCore.Id.Value];
drc?.CoreChanged(changedCore); this.Dispatcher.BeginInvoke(new Action(() =>
})); {
DetailRootControl drc = tabitem.Content as DetailRootControl;
drc?.CoreChanged(changedCore);
}));
}
} }
} }

View File

@ -2360,6 +2360,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Id received.
/// </summary>
public static string textIdReceived {
get {
return ResourceManager.GetString("textIdReceived", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to IGC item. /// Looks up a localized string similar to IGC item.
/// </summary> /// </summary>
@ -3800,6 +3809,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Requested at.
/// </summary>
public static string textRequestedAt {
get {
return ResourceManager.GetString("textRequestedAt", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Requested position in port of call. /// Looks up a localized string similar to Requested position in port of call.
/// </summary> /// </summary>
@ -4772,6 +4790,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Waiting for Id...
/// </summary>
public static string textWaitForId {
get {
return ResourceManager.GetString("textWaitForId", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Waste. /// Looks up a localized string similar to Waste.
/// </summary> /// </summary>

View File

@ -1717,4 +1717,13 @@
<data name="textMaerskSeago" xml:space="preserve"> <data name="textMaerskSeago" xml:space="preserve">
<value>Maersk / SeaGo</value> <value>Maersk / SeaGo</value>
</data> </data>
<data name="textIdReceived" xml:space="preserve">
<value>Id received</value>
</data>
<data name="textRequestedAt" xml:space="preserve">
<value>Requested at</value>
</data>
<data name="textWaitForId" xml:space="preserve">
<value>Waiting for Id..</value>
</data>
</root> </root>

View File

@ -27,6 +27,7 @@ namespace ENI2.Util
{ {
this.bgTimer = new Timer(); this.bgTimer = new Timer();
this.bgTimer.Elapsed += BgTimer_Elapsed; this.bgTimer.Elapsed += BgTimer_Elapsed;
this.bgTimer.AutoReset = true;
this.bgTimer.Interval = Properties.Settings.Default.changeTimerTimeout; this.bgTimer.Interval = Properties.Settings.Default.changeTimerTimeout;
} }
@ -49,13 +50,13 @@ namespace ENI2.Util
if(entity.IsTransit) 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); OnVisitTransitIdUpdated(entity);
watchedEntity.TransitId = entity.TransitId; 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); OnVisitTransitIdUpdated(entity);
watchedEntity.VisitId = entity.VisitId; watchedEntity.VisitId = entity.VisitId;

Binary file not shown.