Add a button to copy masters name from first CREWA entry
This commit is contained in:
parent
a4a74da6f9
commit
626b058119
@ -506,7 +506,7 @@ namespace ENI2
|
|||||||
|
|
||||||
this.DetailControl_RequestReload(this.Core.Id.Value);
|
this.DetailControl_RequestReload(this.Core.Id.Value);
|
||||||
|
|
||||||
System.Action<int> SetTabAction = (int x) =>
|
System.Action<int> SetTabAction = x =>
|
||||||
{
|
{
|
||||||
// this hopefully happens *after* the view was completely reloaded
|
// this hopefully happens *after* the view was completely reloaded
|
||||||
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
||||||
@ -590,7 +590,7 @@ namespace ENI2
|
|||||||
|
|
||||||
this.DetailControl_RequestReload(this.Core.Id.Value);
|
this.DetailControl_RequestReload(this.Core.Id.Value);
|
||||||
|
|
||||||
System.Action<int> SetTabAction = (int x) =>
|
Action<int> SetTabAction = x =>
|
||||||
{
|
{
|
||||||
// this hopefully happens *after* the view was completely reloaded
|
// this hopefully happens *after* the view was completely reloaded
|
||||||
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
|
||||||
|
|||||||
@ -36,10 +36,12 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*" />
|
<ColumnDefinition Width="1*" />
|
||||||
<ColumnDefinition Width="5*" />
|
<ColumnDefinition Width="4*" />
|
||||||
|
<ColumnDefinition Width="1*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
|
||||||
|
<Button x:Name="buttonCopyNameFromCREWA" Grid.Row="0" Grid.Column="2" Margin="2" Content="{x:Static p:Resources.textCopyFromCREWA}" Click="buttonCopyNameFromCREWA_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
|
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
|
||||||
|
|||||||
@ -29,6 +29,7 @@ namespace ENI2.DetailViewControls
|
|||||||
private Message _infoMessage;
|
private Message _infoMessage;
|
||||||
private Message _servMessage;
|
private Message _servMessage;
|
||||||
private Message _ladgMessage;
|
private Message _ladgMessage;
|
||||||
|
private Message _crewaMessage;
|
||||||
private Dictionary<string, string> portAreas = null;
|
private Dictionary<string, string> portAreas = null;
|
||||||
|
|
||||||
private static readonly string[] shippingAreas = {
|
private static readonly string[] shippingAreas = {
|
||||||
@ -69,6 +70,7 @@ namespace ENI2.DetailViewControls
|
|||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||||
|
if(aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewaMessage = aMessage;}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region init NAME
|
#region init NAME
|
||||||
@ -547,5 +549,24 @@ namespace ENI2.DetailViewControls
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonCopyNameFromCREWA_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
CREW crewA = null;
|
||||||
|
if (this._crewaMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
crewA = this._crewaMessage.Elements[0] as CREW;
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectCrewMemberDialog scmd = new SelectCrewMemberDialog();
|
||||||
|
scmd.CREW = crewA;
|
||||||
|
scmd.AddVisible = false;
|
||||||
|
|
||||||
|
if (scmd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
this.textBox_NameMaster.Text = $"{crewA.CrewMemberFirstName} {crewA.CrewMemberLastName}";
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -327,6 +327,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\SelectCrewMemberDialog.xaml.cs">
|
||||||
|
<DependentUpon>SelectCrewMemberDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="EditControls\SelectPortAreaDialog.xaml.cs">
|
<Compile Include="EditControls\SelectPortAreaDialog.xaml.cs">
|
||||||
<DependentUpon>SelectPortAreaDialog.xaml</DependentUpon>
|
<DependentUpon>SelectPortAreaDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -812,6 +815,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="EditControls\SelectCrewMemberDialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="EditControls\SelectImportClassesDialog.xaml">
|
<Page Include="EditControls\SelectImportClassesDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
32
ENI2/EditControls/SelectCrewMemberDialog.xaml
Normal file
32
ENI2/EditControls/SelectCrewMemberDialog.xaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectCrewMemberDialog"
|
||||||
|
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:enictrl="clr-namespace:ENI2.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:ENI2.EditControls"
|
||||||
|
xmlns:p="clr-namespace:ENI2.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="{x:Static p:Resources.textSelectCrewMember}" Height="160" Width="400" Background="AliceBlue">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width=".5*" />
|
||||||
|
<ColumnDefinition Width=".5*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
<RowDefinition Height="28"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" />
|
||||||
|
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textCrewFunctionOnBoard}" />
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding CrewMemberLastName}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
<TextBlock Text="{Binding CrewMemberFirstName}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
<TextBlock Text="{Binding CrewMemberDuty}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</enictrl:EditWindowBase>
|
||||||
41
ENI2/EditControls/SelectCrewMemberDialog.xaml.cs
Normal file
41
ENI2/EditControls/SelectCrewMemberDialog.xaml.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// Copyright (c) 2017- schick Informatik
|
||||||
|
// Description:
|
||||||
|
//
|
||||||
|
|
||||||
|
using bsmd.database;
|
||||||
|
using ENI2.Controls;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace ENI2.EditControls
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for SelectCrewMemberDialog.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class SelectCrewMemberDialog : EditWindowBase
|
||||||
|
{
|
||||||
|
public SelectCrewMemberDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Loaded += SelectCrewMemberDialog_Loaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public CREW CREW { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region event handler
|
||||||
|
|
||||||
|
private void SelectCrewMemberDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (CREW != null)
|
||||||
|
{
|
||||||
|
this.DataContext = CREW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
18
ENI2/Properties/Resources.Designer.cs
generated
18
ENI2/Properties/Resources.Designer.cs
generated
@ -2253,6 +2253,15 @@ namespace ENI2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Copy from CREWA.
|
||||||
|
/// </summary>
|
||||||
|
public static string textCopyFromCREWA {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textCopyFromCREWA", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Copy from last 10 port facilities called.
|
/// Looks up a localized string similar to Copy from last 10 port facilities called.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -5259,6 +5268,15 @@ namespace ENI2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Select crew member.
|
||||||
|
/// </summary>
|
||||||
|
public static string textSelectCrewMember {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textSelectCrewMember", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Select classes to import.
|
/// Looks up a localized string similar to Select classes to import.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -2233,6 +2233,12 @@
|
|||||||
<data name="textSECSimplification" xml:space="preserve">
|
<data name="textSECSimplification" xml:space="preserve">
|
||||||
<value>SEC simplification available</value>
|
<value>SEC simplification available</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textCopyFromCREWA" xml:space="preserve">
|
||||||
|
<value>Copy from CREWA</value>
|
||||||
|
</data>
|
||||||
|
<data name="textSelectCrewMember" xml:space="preserve">
|
||||||
|
<value>Select crew member</value>
|
||||||
|
</data>
|
||||||
<data name="textSERVTemplate" xml:space="preserve">
|
<data name="textSERVTemplate" xml:space="preserve">
|
||||||
<value>SERV-Template</value>
|
<value>SERV-Template</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
|
||||||
|
<Button Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textCopyFromCREWA}" Margin="2" Width="120" HorizontalAlignment="Left" x:Name="buttonCopyFromCrewA" Click="buttonCopyFromCrewA_Click" />
|
||||||
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
|
||||||
<CheckBox Name="checkBoxCrewNotificationSchengen" Grid.Row="1" Grid.Column="1" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
|
<CheckBox Name="checkBoxCrewNotificationSchengen" Grid.Row="1" Grid.Column="1" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
|
||||||
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" />
|
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" />
|
||||||
|
|||||||
@ -233,6 +233,26 @@ namespace ENI2.SheetDisplayControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonCopyFromCrewA_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
CREW crewA = null;
|
||||||
|
if (this._crewaMessage.Elements.Count > 0)
|
||||||
|
{
|
||||||
|
crewA = this._crewaMessage.Elements[0] as CREW;
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectCrewMemberDialog scmd = new SelectCrewMemberDialog();
|
||||||
|
scmd.CREW = crewA;
|
||||||
|
scmd.AddVisible = false;
|
||||||
|
|
||||||
|
if (scmd.ShowDialog() ?? false)
|
||||||
|
{
|
||||||
|
this.textBox_NameMaster.Text = $"{crewA.CrewMemberFirstName} {crewA.CrewMemberLastName}";
|
||||||
|
this.SublistElementChanged(Message.NotificationClass.NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region crew grid arrival
|
#region crew grid arrival
|
||||||
@ -378,8 +398,10 @@ namespace ENI2.SheetDisplayControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user