diff --git a/ENI2/Controls/EditWindowBase.cs b/ENI2/Controls/EditWindowBase.cs index 38fe3b4c..0f287dcb 100644 --- a/ENI2/Controls/EditWindowBase.cs +++ b/ENI2/Controls/EditWindowBase.cs @@ -53,7 +53,19 @@ namespace ENI2.Controls public bool AddVisible { get { var addButton = (Button)Template.FindName("buttonAdd", this); return addButton.Visibility == Visibility.Visible; } - set { var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; } + set + { + var addButton = (Button)Template.FindName("buttonAdd", this); addButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; + var okButton = (Button)Template.FindName("buttonOK", this); + if (okButton.Visibility == Visibility.Hidden) + okButton.Width = 1; // we are in a DockPanel, try to collapse okButton to place addButton more to the right + } + } + + public bool OkVisible + { + get { var okButton = (Button)Template.FindName("buttonOK", this); return okButton.Visibility == Visibility.Visible; } + set { var okButton = (Button)Template.FindName("buttonOK", this); okButton.Visibility = value ? Visibility.Visible : Visibility.Hidden; } } private void Window_Closing(object sender, CancelEventArgs e) diff --git a/ENI2/Controls/LocodeControl.xaml.cs b/ENI2/Controls/LocodeControl.xaml.cs index cfc6b3b7..76117687 100644 --- a/ENI2/Controls/LocodeControl.xaml.cs +++ b/ENI2/Controls/LocodeControl.xaml.cs @@ -19,14 +19,25 @@ namespace ENI2.Controls /// public partial class LocodeControl : UserControl, INotifyPropertyChanged { + + #region fields + private List _locodeList = new List(); public event PropertyChangedEventHandler PropertyChanged; - private bool _comboSelect; + private bool _comboSelect; + + #endregion + + #region Construction public LocodeControl() { - InitializeComponent(); - } + InitializeComponent(); + } + + #endregion + + #region Enums protected enum LocodeState { @@ -36,6 +47,15 @@ namespace ENI2.Controls AMBIGUOUS }; + #endregion + + public void SetFocus() + { + this.comboBoxLocode.Focus(); + } + + #region Properties + /// /// used internally to load up drop down /// @@ -89,10 +109,10 @@ namespace ENI2.Controls // MessageBox.Show(string.Format("CoerceValue is fired : Value {0}", Value)); return Value; } - - public RuleEngine.LocodeMode LocodeSource { get; set; } + #endregion + #region static methods public static readonly DependencyProperty LocodeValueProperty = DependencyProperty.Register("LocodeValue", typeof(string), typeof(LocodeControl), @@ -220,6 +240,15 @@ namespace ENI2.Controls this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LocodeList")); } + private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) + { + if ((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen) + { + this.comboBoxLocode.IsDropDownOpen = true; + e.Handled = true; + } + } + #endregion #region private/protected methods @@ -245,14 +274,6 @@ namespace ENI2.Controls } #endregion - - private void comboBoxLocode_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) - { - if((e.Key == System.Windows.Input.Key.Down) && !this.comboBoxLocode.IsDropDownOpen) - { - this.comboBoxLocode.IsDropDownOpen = true; - e.Handled = true; - } - } + } } diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 71480c7b..1d11a210 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -333,7 +333,7 @@ namespace ENI2 // Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden - if(existingCore.IsTransit && + if(existingCore.IsTransit && (existingMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) && (existingMessage.InternalStatus == Message.BSMDStatus.CONFIRMED)) { @@ -392,7 +392,7 @@ namespace ENI2 newMessage.MessageCoreId = newCore.Id; DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(newMessage); newMessage.SaveElements(); - } + } this.OnOpenNewCoreRequested(newCore); } diff --git a/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml b/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml index fe9d1837..f36a0619 100644 --- a/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml +++ b/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml @@ -28,6 +28,7 @@ +