fixed PAS import details

This commit is contained in:
Daniel Schick 2022-10-19 07:54:33 +02:00
parent 3722223c64
commit 25f9e2eeaa
6 changed files with 71 additions and 26 deletions

View File

@ -19,14 +19,25 @@ namespace ENI2.Controls
/// </summary>
public partial class LocodeControl : UserControl, INotifyPropertyChanged
{
#region fields
private List<string> _locodeList = new List<string>();
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
/// <summary>
/// used internally to load up drop down
/// </summary>
@ -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;
}
}
}
}

View File

@ -36,7 +36,7 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationRevision>7</ApplicationRevision>
<ApplicationVersion>7.5.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -18,12 +18,12 @@
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Label Content="Type" Grid.Row="0" Grid.Column="0" />
<Label Content="Value" Grid.Row="1" Grid.Column="0" />
<Label Content="Selection" Grid.Row="2" Grid.Column="0" />
<Label Content="Type" Grid.Row="0" Grid.Column="0" Focusable="False" />
<Label Content="Value" Grid.Row="1" Grid.Column="0" Focusable="False" />
<Label Content="Selection" Grid.Row="2" Grid.Column="0" Focusable="False"/>
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockType" Grid.Row="0" Grid.Column="1">bla</TextBlock>
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockValue" Grid.Row="1" Grid.Column="1">bla</TextBlock>
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockType" Grid.Row="0" Grid.Column="1" Focusable="False">bla</TextBlock>
<TextBlock FontWeight="DemiBold" VerticalAlignment="Center" Name="textBlockValue" Grid.Row="1" Grid.Column="1" Focusable="False">bla</TextBlock>
<xctk:WatermarkComboBox Grid.Column="1" Grid.Row="2" x:Name="comboBoxValues" IsTextSearchEnabled="True" SelectedValuePath="Key" DisplayMemberPath="Value" Margin="2" IsEditable="True" Watermark="Select an appropriate value" />
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" x:Name="locodeControl" Visibility="Hidden" />

View File

@ -5,6 +5,7 @@
using ENI2.Controls;
using System.Collections.Generic;
using System.Windows;
using bsmd.database;
namespace ENI2.EditControls
{
@ -51,17 +52,37 @@ namespace ENI2.EditControls
public Dictionary<string, string> SelectionValues { get; set; }
#region event handler
private void EditWindowBase_Loaded(object sender, RoutedEventArgs e)
{
this.EnableOK(false);
if (LocodeMode)
{
this.locodeControl.Focus();
this.locodeControl.SetFocus();
this.locodeControl.PropertyChanged += LocodeControl_PropertyChanged;
}
else
{
this.comboBoxValues.ItemsSource = this.SelectionValues;
this.comboBoxValues.SelectionChanged += ComboBoxValues_SelectionChanged;
this.comboBoxValues.Focus();
}
}
private void ComboBoxValues_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
string val = this.comboBoxValues.SelectedValue as string;
this.EnableOK(!val.IsNullOrEmpty());
}
private void LocodeControl_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
this.EnableOK(!locodeControl.LocodeValue.IsNullOrEmpty());
}
#endregion
}
}

View File

@ -4,9 +4,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bsmd.database
{
@ -18,6 +15,8 @@ namespace bsmd.database
public class HAZPosTemplate
{
#region enums
public enum SublistType
{
IBC,
@ -26,6 +25,8 @@ namespace bsmd.database
MARPOL
}
#endregion
#region Properties
public string Description { get; set; }

View File

@ -314,7 +314,9 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
/* Nach RM Christin / Trello vom 27.11.17 auskommentiert
// /* Nach RM Christin / Trello vom 27.11.17 auskommentiert
// und heute (19.10.22) wieder einkommentiert
if (this.PassengerPortOfDisembarkation != null)
{
if (this.PassengerPortOfDisembarkation.Equals("ZZUKN"))
@ -326,7 +328,7 @@ namespace bsmd.database
if (this.PassengerPortOfEmbarkation.Equals("ZZUKN"))
violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, "PassengerPortOfEmbarkation", null, this.Title, this.Identifier, this.Tablename));
}
*/
// */
}
#endregion