ID Beantragung korrigiert und erweitert (6.0.10)
This commit is contained in:
parent
47e5db9a18
commit
6b785af904
@ -26,8 +26,8 @@
|
||||
<value>1000</value>
|
||||
</setting>
|
||||
<setting name="LockingServerAddress" serializeAs="String">
|
||||
<!--value>http://192.168.2.24/LockingService/LockingService.svc</value-->
|
||||
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
|
||||
<!--value>http://192.168.2.24/LockingService/LockingService.svc</value-->
|
||||
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
|
||||
</setting>
|
||||
<setting name="ConnectionString" serializeAs="String">
|
||||
<!--value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value-->
|
||||
|
||||
@ -40,8 +40,7 @@ namespace ENI2.Controls
|
||||
|
||||
private void DataGridValidationRules_DeleteRequested(bsmd.database.DatabaseEntity obj)
|
||||
{
|
||||
bsmd.database.ValidationRule vr = obj as bsmd.database.ValidationRule;
|
||||
if (vr != null)
|
||||
if (obj is bsmd.database.ValidationRule vr)
|
||||
{
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(vr);
|
||||
this.ValidationRules.Remove(vr);
|
||||
@ -51,8 +50,7 @@ namespace ENI2.Controls
|
||||
|
||||
private void DataGridValidationRules_EditRequested(bsmd.database.DatabaseEntity obj)
|
||||
{
|
||||
bsmd.database.ValidationRule vr = obj as bsmd.database.ValidationRule;
|
||||
if (vr != null)
|
||||
if (obj is bsmd.database.ValidationRule vr)
|
||||
{
|
||||
EditRulesDialog eld = new EditRulesDialog();
|
||||
eld.ValidationRule = vr;
|
||||
|
||||
@ -22,9 +22,9 @@ namespace ENI2.Controls
|
||||
public partial class ServerStatusControl : UserControl
|
||||
{
|
||||
|
||||
private ObservableCollection<StatusEntry> entries = new ObservableCollection<StatusEntry>();
|
||||
private static Regex regex = new Regex(@"BSMD_(\d*)-(.*)-(\w*)");
|
||||
private static ILog _log = LogManager.GetLogger("ServerStatus");
|
||||
private readonly ObservableCollection<StatusEntry> entries = new ObservableCollection<StatusEntry>();
|
||||
private readonly static Regex regex = new Regex(@"BSMD_(\d*)-(.*)-(\w*)");
|
||||
private readonly static ILog _log = LogManager.GetLogger("ServerStatus");
|
||||
private ProgressBar _updateProgressBar;
|
||||
private TextBlock _updateTextBlock;
|
||||
|
||||
@ -123,7 +123,7 @@ namespace ENI2.Controls
|
||||
|
||||
public class StatusEntry : IComparable
|
||||
{
|
||||
private static Dictionary<string, string> guidIdDict = new Dictionary<string, string>();
|
||||
private static readonly Dictionary<string, string> guidIdDict = new Dictionary<string, string>();
|
||||
|
||||
public string Class { get; set; }
|
||||
|
||||
@ -150,8 +150,7 @@ namespace ENI2.Controls
|
||||
if (!guidIdDict.ContainsKey(guidString))
|
||||
{
|
||||
string idString = "";
|
||||
Guid coreId;
|
||||
if (Guid.TryParse(m.Groups[2].Value, out coreId))
|
||||
if (Guid.TryParse(m.Groups[2].Value, out Guid coreId))
|
||||
{
|
||||
MessageCore aCore = DBManager.Instance.GetMessageCoreById(coreId);
|
||||
if (aCore != null)
|
||||
@ -181,8 +180,8 @@ namespace ENI2.Controls
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if(obj is StatusEntry)
|
||||
return -(Timestamp.CompareTo(((StatusEntry)obj).Timestamp));
|
||||
if(obj is StatusEntry entry)
|
||||
return -(Timestamp.CompareTo(entry.Timestamp));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,8 +221,8 @@ namespace ENI2
|
||||
bool isEnabled = !this.LockedByOtherUser;
|
||||
detailControl.SetEnabled(isEnabled);
|
||||
|
||||
if (!isEnabled && (detailControl is OverViewDetailControl) && !(Core.Cancelled ?? false))
|
||||
((OverViewDetailControl)detailControl).ShowLockedBy(this.LockedBy);
|
||||
if (!isEnabled && (detailControl is OverViewDetailControl control) && !(Core.Cancelled ?? false))
|
||||
control.ShowLockedBy(this.LockedBy);
|
||||
|
||||
controlCache.Add(mg.MessageGroupName, detailControl);
|
||||
this.buttonSave.Visibility = Visibility.Hidden;
|
||||
|
||||
@ -75,9 +75,12 @@ namespace ENI2.DetailViewControls
|
||||
|
||||
this.ataGroupBox.DataContext = ata;
|
||||
|
||||
this.dateTimePickerATA.Minimum = DateTime.Now.AddDays(-14);
|
||||
this.dateTimePickerATA.Maximum = DateTime.Now.AddDays(14);
|
||||
this.dateTimePickerATA.ClipValueToMinMax = false;
|
||||
if (!ata.ATAPortOfCall.HasValue)
|
||||
{
|
||||
this.dateTimePickerATA.Minimum = DateTime.Now.AddDays(-14);
|
||||
this.dateTimePickerATA.Maximum = DateTime.Now.AddDays(14);
|
||||
this.dateTimePickerATA.ClipValueToMinMax = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// Description: Detailansicht für ATD, TIEFD, POBD, BKRD
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
using bsmd.database;
|
||||
@ -72,6 +73,13 @@ namespace ENI2.DetailViewControls
|
||||
|
||||
this.atdGroupBox.DataContext = atd;
|
||||
|
||||
if (!atd.ATDPortOfCall.HasValue)
|
||||
{
|
||||
this.dateTimePickerATD.Minimum = DateTime.Now.AddDays(-14);
|
||||
this.dateTimePickerATD.Maximum = DateTime.Now.AddDays(14);
|
||||
this.dateTimePickerATD.ClipValueToMinMax = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TIEFD
|
||||
@ -174,9 +182,8 @@ namespace ENI2.DetailViewControls
|
||||
}
|
||||
|
||||
private void DataGridBKRD_DeleteRequested(DatabaseEntity obj)
|
||||
{
|
||||
BRKD brkd = obj as BRKD;
|
||||
if (brkd != null)
|
||||
{
|
||||
if (obj is BRKD brkd)
|
||||
{
|
||||
// are you sure dialog is in base class
|
||||
this._bkrdMessage.Elements.Remove(brkd);
|
||||
|
||||
@ -418,10 +418,11 @@ namespace ENI2.DetailViewControls
|
||||
this.labelBSMDStatusInternal.DataContext = this.Core;
|
||||
this.labelBSMDStatusInternal.GetBindingExpression(Label.ContentProperty)?.UpdateTarget();
|
||||
//MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
|
||||
ShowIdDialog sid = new ShowIdDialog
|
||||
ShowIdDialog sid = new ShowIdDialog(this.Core)
|
||||
{
|
||||
DisplayId = this.Core.DisplayId
|
||||
};
|
||||
sid.UpdateId(this.Core.DisplayId);
|
||||
sid.Show();
|
||||
this.Core.IsDirty = false; // ist ja schon gespeichert..
|
||||
}
|
||||
|
||||
@ -6,18 +6,31 @@
|
||||
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" WindowStartupLocation="CenterOwner" >
|
||||
Title="{x:Static p:Resources.textVisitTransitId}" Height="236" Width="300" WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<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"/>
|
||||
<Label Name="clickToCopyLabel" Content=" -> click to copy" HorizontalAlignment="Center" Grid.Row="2" MouseDown="textBoxId_MouseDown" Visibility="Hidden"/>
|
||||
<Button Grid.Row="3" HorizontalAlignment="Left" Content="Close and open Id" Margin="2" Width="100" Click="Button_Click_1" />
|
||||
<Button Grid.Row="3" HorizontalAlignment="Right" Content="Close" Margin="2" Width="100" Click="Button_Click" />
|
||||
<Label Content="{x:Static p:Resources.textETA}" Grid.Column="0"/>
|
||||
<Label Name="labelETA" Grid.Column="1" />
|
||||
<Label Content="{x:Static p:Resources.textPortCall}" Grid.Row="1" />
|
||||
<Label Name="labelPoC" Grid.Column="1" Grid.Row="1"/>
|
||||
<Label Content="{x:Static p:Resources.textIMO}" Grid.Row="2"/>
|
||||
<Label Name="labelIMO" Grid.Column="1" Grid.Row="2"/>
|
||||
<Label Name="statusLabel" HorizontalAlignment="Center" Content="{x:Static p:Resources.textWaitForId}" Background="LemonChiffon" Grid.Row="3" Grid.ColumnSpan="2"/>
|
||||
<TextBox IsReadOnly="True" Name="textBoxId" MouseDown="textBoxId_MouseDown" FontWeight="Bold" HorizontalAlignment="Center" VerticalContentAlignment="Center" Margin="2" Grid.Row="4" Grid.ColumnSpan="2"/>
|
||||
<Label Name="clickToCopyLabel" Content=" -> click to copy" HorizontalAlignment="Center" Grid.Row="5" Grid.ColumnSpan="2" MouseDown="textBoxId_MouseDown" Visibility="Hidden"/>
|
||||
<Button Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Content="Close and open Id" Margin="2" Width="100" Click="Button_Click_1" />
|
||||
<Button Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" Content="Close" Margin="2" Width="100" Click="Button_Click" />
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@ -6,6 +6,7 @@ using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using bsmd.database;
|
||||
|
||||
namespace ENI2.EditControls
|
||||
{
|
||||
@ -14,9 +15,10 @@ namespace ENI2.EditControls
|
||||
/// </summary>
|
||||
public partial class ShowIdDialog : Window
|
||||
{
|
||||
public ShowIdDialog()
|
||||
public ShowIdDialog(MessageCore core)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Core = core;
|
||||
}
|
||||
|
||||
public string DisplayId
|
||||
@ -27,6 +29,8 @@ namespace ENI2.EditControls
|
||||
|
||||
public bool OpenCore { get; private set; }
|
||||
|
||||
public MessageCore Core { get; private set; }
|
||||
|
||||
public void UpdateId(string id)
|
||||
{
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
@ -53,5 +57,15 @@ namespace ENI2.EditControls
|
||||
this.OpenCore = true;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(this.Core != null)
|
||||
{
|
||||
this.labelETA.Content = this.Core.ETADisplay;
|
||||
this.labelPoC.Content = this.Core.PoC;
|
||||
this.labelIMO.Content = this.Core.IMO.IsNullOrEmpty() ? this.Core.ENI : this.Core.IMO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,64 +58,73 @@
|
||||
<Button Name="buttonExit" Content="{x:Static p:Resources.textExit}" Grid.Row="4" Grid.Column="1" Margin="2" Click="buttonExit_Click" />
|
||||
</Grid>
|
||||
</xctk:BusyIndicator.BusyContent>
|
||||
<DockPanel Name="mainPanel">
|
||||
<DockPanel Name="mainPanel">
|
||||
<Grid DockPanel.Dock="Top" Height="80" Background="#FFE8F6FF">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0" x:Name="logoImage" HorizontalAlignment="Left" Height="75" Width="75" Source="Resources/EUREPORT.png" Stretch="Fill" MouseUp="logoImage_MouseUp" Margin="2"/>
|
||||
<Button Grid.Column="1" x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="buttonNewTransitIdClick" Background="Transparent" Margin="2"/>
|
||||
<Button Grid.Column="2" x:Name="buttonNewWithId" Content="{x:Static p:Resources.textNewWithId}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="buttonNewWithIdClick" Background="Transparent" Margin="2"/>
|
||||
<RadioButton Grid.Column="3" x:Name="buttonNotifications" Content="{x:Static p:Resources.textNotifications}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2,5,0,0" IsChecked="True" />
|
||||
<RadioButton Grid.Column="4" x:Name="buttonStatus" Content="{x:Static p:Resources.textServerStatus}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2,5,0,0" />
|
||||
<RadioButton Grid.Column="5" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0"/>
|
||||
<RadioButton Grid.Column="6" x:Name="buttonPOListe" Content="{x:Static p:Resources.textPOLists}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0" />
|
||||
<Button Grid.Column="7" x:Name="buttonAbout" Content="?" HorizontalAlignment="Right" VerticalAlignment="Top" Background="Transparent" Margin="2" Padding="5,0,5,0" Click="buttonAbout_Click"/>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Column="0" x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="buttonNewTransitIdClick" Background="Transparent" Margin="2,2,0,0" Grid.RowSpan="2"/>
|
||||
<Button Grid.Column="1" x:Name="buttonNewWithId" Content="{x:Static p:Resources.textNewWithId}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="buttonNewWithIdClick" Background="Transparent" Margin="2,2,0,0" Grid.RowSpan="2"/>
|
||||
<RadioButton Grid.Column="2" x:Name="buttonNotifications" Content="{x:Static p:Resources.textNotifications}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2,5,0,0" IsChecked="True" Grid.RowSpan="2" />
|
||||
<RadioButton Grid.Column="3" x:Name="buttonStatus" Content="{x:Static p:Resources.textServerStatus}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2,5,0,0" Grid.RowSpan="2" />
|
||||
<RadioButton Grid.Column="4" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0" Grid.RowSpan="2"/>
|
||||
<RadioButton Grid.Column="5" x:Name="buttonPOListe" Content="{x:Static p:Resources.textPOLists}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0" Grid.RowSpan="2" />
|
||||
<Button Grid.Column="5" x:Name="buttonAbout" Content="?" HorizontalAlignment="Right" VerticalAlignment="Top" Background="Transparent" Margin="0,2,2,0" Padding="5,0,5,0" Click="buttonAbout_Click" Grid.RowSpan="2"/>
|
||||
<Label Grid.Column="0" Grid.Row="1" x:Name="labelStatusId" Grid.ColumnSpan="3" Margin="2,2,0,0" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF">
|
||||
<StatusBar>
|
||||
<StatusBar.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
</ItemsPanelTemplate>
|
||||
</StatusBar.ItemsPanel>
|
||||
<StatusBarItem Grid.Column="0">
|
||||
<TextBlock Name="labelGeneralStatus" FontSize="9"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="1">
|
||||
<TextBlock Name="labelVersion"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock Name="labelUsername"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="3"/>
|
||||
<StatusBarItem Grid.Column="4">
|
||||
<TextBlock Name="labelStatusBar"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="5"/>
|
||||
<StatusBarItem Grid.Column="6">
|
||||
<ProgressBar Name="generalProgressStatus" Width="90" Height="16"/>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
<StatusBar>
|
||||
<StatusBar.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
</ItemsPanelTemplate>
|
||||
</StatusBar.ItemsPanel>
|
||||
<StatusBarItem Grid.Column="0">
|
||||
<TextBlock Name="labelGeneralStatus" FontSize="9"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="1">
|
||||
<TextBlock Name="labelVersion"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock Name="labelUsername"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="3"/>
|
||||
<StatusBarItem Grid.Column="4">
|
||||
<TextBlock Name="labelStatusBar"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="5"/>
|
||||
<StatusBarItem Grid.Column="6">
|
||||
<ProgressBar Name="generalProgressStatus" Width="90" Height="16"/>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
<Grid Name="rootContainer">
|
||||
<TabControl Margin="10" Name="mainFrame">
|
||||
<TabItem Header="{x:Static p:Resources.textSearch}" Name="tabSearch">
|
||||
|
||||
@ -48,7 +48,7 @@ namespace ENI2
|
||||
private ReportingParty userEntity;
|
||||
private readonly ILog _log = LogManager.GetLogger(typeof(MainWindow));
|
||||
private readonly DatabaseEntityWatchdog _dbWatchDog;
|
||||
private ShowIdDialog showIdDialog;
|
||||
private readonly Dictionary<Guid, ShowIdDialog> showIdDict = new Dictionary<Guid, ShowIdDialog>();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -206,7 +206,6 @@ namespace ENI2
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
if (lockedCores.ContainsKey(tabItem))
|
||||
@ -388,6 +387,8 @@ namespace ENI2
|
||||
VisitIdDialog closedDialog = senderDialog as VisitIdDialog;
|
||||
if(closedDialog.IsOK)
|
||||
{
|
||||
Util.UIHelper.SetBusyState();
|
||||
|
||||
if (!closedDialog.Core.IsDK)
|
||||
{
|
||||
// deutsche Häfen fordern eine Visit-Id an, für DK erfolgt hier nur die Anlage eines Datensatzes
|
||||
@ -401,26 +402,28 @@ namespace ENI2
|
||||
closedDialog.Core.DefaultReportingPartyId = this.userEntity.Id;
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(closedDialog.Core);
|
||||
|
||||
// Meldeklassen für neuen Anlauf erzeugen:dam
|
||||
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core, null, userEntity);
|
||||
|
||||
// watchdog registrieren
|
||||
this._dbWatchDog.Register(closedDialog.Core);
|
||||
this._dbWatchDog.Register(closedDialog.Core);
|
||||
|
||||
// Wartedialog anzeigen
|
||||
this.showIdDialog = new ShowIdDialog();
|
||||
this.showIdDialog.Closed += (showIdDialog, showIdArgs) =>
|
||||
ShowIdDialog showIdDialog = new ShowIdDialog(closedDialog.Core);
|
||||
showIdDialog.Closed += (sid, showIdArgs) =>
|
||||
{
|
||||
if(this.showIdDialog.OpenCore)
|
||||
this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
|
||||
else
|
||||
this._dbWatchDog.UnRegister(closedDialog.Core);
|
||||
if(((ShowIdDialog)sid).OpenCore)
|
||||
this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
|
||||
|
||||
// wenn der Dialog vorzeitig geschlossen wird erkennt man später dass man die Id dort nicht updaten braucht
|
||||
this.showIdDialog = null;
|
||||
if (this.showIdDict.ContainsKey(closedDialog.Core.Id.Value))
|
||||
this.showIdDict[closedDialog.Core.Id.Value] = null;
|
||||
this.UpdateWaitIdLabel();
|
||||
};
|
||||
this.showIdDialog.ShowDialog();
|
||||
//
|
||||
this.showIdDict.Add(closedDialog.Core.Id.Value, showIdDialog);
|
||||
showIdDialog.Show();
|
||||
this.UpdateWaitIdLabel();
|
||||
|
||||
// Meldeklassen für neuen Anlauf erzeugen
|
||||
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core, null, userEntity);
|
||||
|
||||
}
|
||||
};
|
||||
visitIdDialog.Show();
|
||||
@ -515,7 +518,34 @@ namespace ENI2
|
||||
{
|
||||
if (entity is MessageCore changedCore)
|
||||
{
|
||||
this.showIdDialog?.UpdateId(changedCore.VisitId.IsNullOrEmpty() ? changedCore.TransitId : changedCore.VisitId);
|
||||
if (showIdDict.ContainsKey(changedCore.Id.Value))
|
||||
{
|
||||
if (this.showIdDict[changedCore.Id.Value] != null)
|
||||
{
|
||||
this.showIdDict[changedCore.Id.Value].UpdateId(changedCore.VisitId.IsNullOrEmpty() ? changedCore.TransitId : changedCore.VisitId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wartedialog nochmal
|
||||
this.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
ShowIdDialog showIdDialog = new ShowIdDialog(changedCore);
|
||||
showIdDialog.Closed += (sid, showIdArgs) =>
|
||||
{
|
||||
if (((ShowIdDialog)sid).OpenCore)
|
||||
this.AnmeldungenControl_MessageCoreSelected(changedCore);
|
||||
};
|
||||
showIdDialog.Show();
|
||||
showIdDialog.UpdateId(changedCore.VisitId.IsNullOrEmpty() ? changedCore.TransitId : changedCore.VisitId);
|
||||
}));
|
||||
}
|
||||
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();
|
||||
}));
|
||||
}
|
||||
|
||||
if (this.openTabs.ContainsKey(changedCore.Id.Value))
|
||||
{
|
||||
@ -526,6 +556,7 @@ namespace ENI2
|
||||
drc?.CoreChanged(changedCore);
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -624,6 +655,18 @@ namespace ENI2
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateWaitIdLabel()
|
||||
{
|
||||
if(this.showIdDict.Count == 0)
|
||||
{
|
||||
this.labelStatusId.Content = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.labelStatusId.Content = string.Format("waiting for {0} id(s)..", this.showIdDict.Count);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user