diff --git a/ENI2/Excel/ExcelReader.cs b/ENI2/Excel/ExcelReader.cs index afe03d2e..41e315cf 100644 --- a/ENI2/Excel/ExcelReader.cs +++ b/ENI2/Excel/ExcelReader.cs @@ -553,12 +553,12 @@ namespace ENI2.Excel } } - if (val is string) + if (val is string @string) { - if (((string)val).EndsWith("lt", StringComparison.OrdinalIgnoreCase)) - val = ((string)val).Substring(0, ((string)val).Length - 2).Trim(); + if (@string.EndsWith("lt", StringComparison.OrdinalIgnoreCase)) + val = @string.Substring(0, @string.Length - 2).Trim(); else - val = ((string)val).Trim(); + val = @string.Trim(); } if (result == null) diff --git a/ENI2/MainWindow.xaml b/ENI2/MainWindow.xaml index 223488bf..10ac8200 100644 --- a/ENI2/MainWindow.xaml +++ b/ENI2/MainWindow.xaml @@ -88,6 +88,11 @@ + + + + + @@ -96,34 +101,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ENI2/MainWindow.xaml.cs b/ENI2/MainWindow.xaml.cs index 4556ae47..6f067784 100644 --- a/ENI2/MainWindow.xaml.cs +++ b/ENI2/MainWindow.xaml.cs @@ -49,12 +49,14 @@ namespace ENI2 private readonly DatabaseEntityWatchdog _dbWatchDog; private readonly Dictionary showIdDict = new Dictionary(); + private MenuItem _selectedMenuItem; // simulate radio button logic + #endregion #region Construction public MainWindow() - { + { Thread.Sleep(500); InitializeComponent(); App.SplashScreen.ShowMessage("loading.."); @@ -68,8 +70,9 @@ namespace ENI2 this._dbWatchDog.VisitTransitIdUpdated += _dbWatchDog_VisitTransitIdUpdated; App.SplashScreen.ShowMessage("done"); Thread.Sleep(500); - App.SplashScreen.LoadComplete(); - } + App.SplashScreen.LoadComplete(); + _selectedMenuItem = menuItemNotifications; + } #endregion @@ -253,15 +256,21 @@ namespace ENI2 private void radioButton_Click(object sender, RoutedEventArgs e) { - this.rootContainer.Children.Clear(); - + if (sender == _selectedMenuItem) return; // same selected - if(sender == this.buttonNotifications) + this.rootContainer.Children.Clear(); + + MenuItem mi = sender as MenuItem; + _selectedMenuItem.Background = mi.Background; + _selectedMenuItem = mi; + _selectedMenuItem.Background = Brushes.LightBlue; + + if(sender == this.menuItemNotifications) { this.rootContainer.Children.Add(this.mainFrame); } - else if(sender == this.buttonUserAdmin) + else if(sender == this.menuItemUserAdministration) { if (this.rpControl == null) { @@ -271,7 +280,7 @@ namespace ENI2 } this.rootContainer.Children.Add(this.rpControl); } - else if(sender == this.buttonPOListe) + else if(sender == this.menuItemMaersk) { if (this.moControl == null) { @@ -279,7 +288,7 @@ namespace ENI2 } this.rootContainer.Children.Add(moControl); } - else if(sender == this.buttonStatus) + else if(sender == this.menuItemStatus) { if(this.statusControl == null) { @@ -646,8 +655,8 @@ namespace ENI2 ReportingParty.CurrentReportingParty = this.userEntity; if (this.userEntity.IsAdmin) { - this.buttonUserAdmin.Visibility = Visibility.Visible; - this.buttonPOListe.Visibility = Visibility.Visible; + this.menuItemUserAdministration.Visibility = Visibility.Visible; + this.menuItemMaersk.Visibility = Visibility.Visible; this.sucheControl.AdminMode = true; } break; @@ -697,11 +706,11 @@ namespace ENI2 { if(this.showIdDict.Count == 0) { - this.labelStatusId.Content = ""; + this.labelStatusId.Header = ""; } else { - this.labelStatusId.Content = string.Format("waiting for {0} id(s)..", this.showIdDict.Count); + this.labelStatusId.Header = string.Format("waiting for {0} id(s)..", this.showIdDict.Count); } }