alle Änderungswünsche von Christin komplett übernommen
This commit is contained in:
parent
05ea4b5783
commit
bc47aee394
@ -60,37 +60,25 @@
|
|||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="Info port area" Name="label_INFOPortAreaInfo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
<ComboBox Grid.Row="0" Grid.Column="3" x:Name="comboBoxGroup" Margin="2,2,4,2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged"/>
|
<ComboBox Grid.Row="0" Grid.Column="3" x:Name="comboBoxGroup" Margin="2,2,4,2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged"/>
|
||||||
|
<Button Grid.Row="1" Grid.Column="3" x:Name="buttonSearchPortArea" Margin="2" Content="Lookup port area" Click="buttonSearchPortArea_Click" />
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
|
||||||
<Grid Grid.Row="1" Grid.Column="3">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="28" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox x:Name="comboBoxPortAreaHelper" Margin="2" SelectionChanged="comboBoxPortAreaHelper_SelectionChanged" />
|
|
||||||
<Button Grid.Column="1" Name="buttonSetPortArea" Margin="2" Click="buttonSetPortArea_Click" BorderThickness="0" Background="Transparent" ToolTip="Set this port area">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
||||||
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
|
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
|
||||||
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
|
||||||
<TextBlock Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" Name="textBlockPortAreaRemarks" Text="-" TextWrapping="WrapWithOverflow" Height="52" VerticalAlignment="Center" Margin="2" />
|
<TextBox Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top" />
|
||||||
<TextBox Grid.Row="4" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top" />
|
<TextBox Grid.Row="5" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top"/>
|
||||||
<TextBox Grid.Row="6" Grid.Column="3" Grid.RowSpan="1" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
|
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
// Copyright (c) 2017 schick Informatik
|
// Copyright (c) 2017- schick Informatik
|
||||||
|
// Description:
|
||||||
|
//
|
||||||
|
|
||||||
// Description: Detailansicht Gruppe Port Notification
|
// Description: Detailansicht Gruppe Port Notification
|
||||||
//
|
//
|
||||||
@ -163,15 +165,7 @@ namespace ENI2.DetailViewControls
|
|||||||
if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4;
|
if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region init port area helper
|
|
||||||
|
|
||||||
if (LocalizedLookup.getPortAreaInfos().ContainsKey(this.Core.PoC))
|
|
||||||
{
|
|
||||||
this.comboBoxPortAreaHelper.ItemsSource = LocalizedLookup.getPortAreaInfos()[this.Core.PoC];
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region datagrid LADG
|
#region datagrid LADG
|
||||||
@ -467,35 +461,23 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e)
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region set port area code from selected combobox item
|
|
||||||
|
|
||||||
private void buttonSetPortArea_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
{
|
||||||
if (this.comboBoxPortAreaHelper.SelectedItem != null)
|
SelectPortAreaDialog spad = new SelectPortAreaDialog(this.Core.PoC);
|
||||||
|
if(spad.ShowDialog() ?? false)
|
||||||
{
|
{
|
||||||
PortAreaInfo pai = this.comboBoxPortAreaHelper.SelectedItem as PortAreaInfo;
|
if(spad.SelectedArea != null)
|
||||||
if (portAreas.ContainsKey(pai.PortAreaCode))
|
|
||||||
{
|
{
|
||||||
var pair = portAreas.SingleOrDefault(p => p.Key == pai.PortAreaCode);
|
if (portAreas.ContainsKey(spad.SelectedArea))
|
||||||
this.comboBoxPortArea.SelectedItem = pair;
|
{
|
||||||
|
var pair = portAreas.SingleOrDefault(p => p.Key == spad.SelectedArea);
|
||||||
|
this.comboBoxPortArea.SelectedItem = pair;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void comboBoxPortAreaHelper_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.comboBoxPortAreaHelper.SelectedItem != null)
|
|
||||||
{
|
|
||||||
PortAreaInfo pai = this.comboBoxPortAreaHelper.SelectedItem as PortAreaInfo;
|
|
||||||
// this.comboBoxPortAreaHelper.ToolTip = $"{pai.Remark} Ships: {pai.Ships} Agentur: {pai.Agency} Liegeplatz: {pai.Berth}";
|
|
||||||
this.textBlockPortAreaRemarks.Text = $"Agency:{pai.Agency}\nShip:{pai.Ships}\nRemark:{pai.Remark}";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -252,6 +252,9 @@
|
|||||||
<Compile Include="EditControls\NewDGItemDialog.xaml.cs">
|
<Compile Include="EditControls\NewDGItemDialog.xaml.cs">
|
||||||
<DependentUpon>NewDGItemDialog.xaml</DependentUpon>
|
<DependentUpon>NewDGItemDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="EditControls\SelectPortAreaDialog.xaml.cs">
|
||||||
|
<DependentUpon>SelectPortAreaDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Excel\DakosyUtil.cs" />
|
<Compile Include="Excel\DakosyUtil.cs" />
|
||||||
<Compile Include="Excel\ExcelBase.cs" />
|
<Compile Include="Excel\ExcelBase.cs" />
|
||||||
<Compile Include="Excel\ExcelComparer.cs" />
|
<Compile Include="Excel\ExcelComparer.cs" />
|
||||||
@ -697,6 +700,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="EditControls\SelectPortAreaDialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="EditControls\ShowIdDialog.xaml">
|
<Page Include="EditControls\ShowIdDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ namespace ENI2.EditControls
|
|||||||
public partial class NewDGItemDialog : EditWindowBase
|
public partial class NewDGItemDialog : EditWindowBase
|
||||||
{
|
{
|
||||||
private List<HAZPosTemplate> _data = null;
|
private List<HAZPosTemplate> _data = null;
|
||||||
private static object filterLock = new object();
|
private static readonly object filterLock = new object();
|
||||||
|
|
||||||
public NewDGItemDialog()
|
public NewDGItemDialog()
|
||||||
{
|
{
|
||||||
|
|||||||
53
ENI2/EditControls/SelectPortAreaDialog.xaml
Normal file
53
ENI2/EditControls/SelectPortAreaDialog.xaml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectPortAreaDialog"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
|
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:local="clr-namespace:ENI2.EditControls"
|
||||||
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Search port area" Height="400" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="Window_Loaded">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="84" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
<RowDefinition Height="90" />
|
||||||
|
<RowDefinition Height="28" />
|
||||||
|
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80" />
|
||||||
|
<ColumnDefinition Width="2*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Grid.Row="1" Content="Select" />
|
||||||
|
<Label Grid.Row="0" x:Name="labelLocode" Content="ZZUKN" />
|
||||||
|
<ListBox Name="listBoxAreas" Grid.Column="1" Grid.Row="1" Margin="2" SelectionChanged="comboBoxType_SelectionChanged" />
|
||||||
|
<xctk:WatermarkTextBox Margin="2" Watermark="{x:Static p:Resources.textSearch}" Name="textBoxSearchDescription" Grid.Row="0" Grid.Column="1" TextChanged="textBoxSearchDescription_TextChanged" />
|
||||||
|
<Label Grid.Row="2" Content="Agency" />
|
||||||
|
<Label Grid.Row="3" Content="Ships" />
|
||||||
|
<Label Grid.Row="4" Content="Berth" />
|
||||||
|
<Label Grid.Row="5" Content="PortArea" />
|
||||||
|
<Label Grid.Row="6" Content="Remark" />
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="2" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockAgency" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockShips" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="4" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockBerth" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="5" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockPortArea" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
<Border BorderThickness="1" Grid.Column="1" Grid.Row="6" Grid.RowSpan="1" BorderBrush="Black" Margin="2">
|
||||||
|
<TextBlock Name="textBlockRemarks" Margin="2,1,2,3" Background="LightGray" TextWrapping="Wrap"/>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</enictrl:EditWindowBase>
|
||||||
85
ENI2/EditControls/SelectPortAreaDialog.xaml.cs
Normal file
85
ENI2/EditControls/SelectPortAreaDialog.xaml.cs
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
// Copyright (c) 2023- schick Informatik
|
||||||
|
// Description: Helper search window to
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.Controls;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace ENI2.EditControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for SelectPortAreaDialog.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class SelectPortAreaDialog : EditWindowBase
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
private readonly string _poc = null;
|
||||||
|
private List<PortAreaInfo> _portAreas;
|
||||||
|
private static readonly object filterLock = new object();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Construction
|
||||||
|
|
||||||
|
public SelectPortAreaDialog(string poc)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_poc = poc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public string SelectedArea { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_portAreas = LocalizedLookup.getPortAreaInfos()[this._poc];
|
||||||
|
this.labelLocode.Content = this._poc;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboBoxType_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (this.listBoxAreas.SelectedItem is PortAreaInfo pai)
|
||||||
|
{
|
||||||
|
this.textBlockAgency.Text = pai.Agency;
|
||||||
|
this.textBlockBerth.Text = pai.Berth;
|
||||||
|
this.textBlockPortArea.Text = pai.PortArea;
|
||||||
|
this.textBlockShips.Text = pai.Ships;
|
||||||
|
this.textBlockRemarks.Text = pai.Remark;
|
||||||
|
this.SelectedArea = pai.PortAreaCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void textBoxSearchDescription_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
||||||
|
{
|
||||||
|
string searchText = this.textBoxSearchDescription.Text.Trim();
|
||||||
|
|
||||||
|
lock (filterLock)
|
||||||
|
{
|
||||||
|
IEnumerable<PortAreaInfo> filtered = _portAreas;
|
||||||
|
if (searchText.Length > 0)
|
||||||
|
{
|
||||||
|
filtered = _portAreas.Where(elem => (elem.Remark != null && elem.Remark.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
||||||
|
(elem.Agency != null && elem.Agency.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
||||||
|
(elem.Berth != null && elem.Berth.ToUpperInvariant().Contains(searchText.ToUpperInvariant())) ||
|
||||||
|
(elem.PortArea != null && elem.PortArea.ToUpperInvariant().Contains(searchText.ToUpperInvariant())));
|
||||||
|
}
|
||||||
|
this.listBoxAreas.ItemsSource = filtered;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user