Neue ENI-2 Version mit TOWA/TOWD Detailansicht
This commit is contained in:
parent
e33b11569c
commit
be2b21f460
@ -5,9 +5,61 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
d:DesignHeight="800" d:DesignWidth="1024">
|
||||
<Grid>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="300" />
|
||||
<RowDefinition Height="300" />
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox Name="groupBoxTowageOnArrival" Grid.Row="0" Header="{x:Static p:Resources.textTowageOnArrival}">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridTowageOnArrival" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnArrivalName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPurposeOfCall}" Binding="{Binding TowageOnArrivalPurposeOfCall}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnArrivalFlag}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDraughtInDecimetre}" Binding="{Binding TowageOnArrivalDraught_DMT}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGrossTonnage}" Binding="{Binding TowageOnArrivalGrossTonnage}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLengthOverAll}" Binding="{Binding TowageOnArrivalLengthOverall_MTR}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBeamOverAll}" Binding="{Binding TowageOnArrivalBeam_MTR}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding TowageOnArrivalRemarks}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCompanyName}" Binding="{Binding TowageOnArrivalOperatorCompanyName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPurposeOfCall}" Binding="{Binding TowageOnArrivalPurposeOfCall}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textStreetNumber}" Binding="{Binding TowageOnArrivalOperatorStreetNameAndNumber}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPostalCode}" Binding="{Binding TowageOnArrivalOperatorPostalCode}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCity}" Binding="{Binding TowageOnArrivalOperatorCity}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountry}" Binding="{Binding TowageOnArrivalOperatorCountry}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding TowageOnArrivalOperatorEmail}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPhone}" Binding="{Binding TowageOnArrivalOperatorPhone}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFax}" Binding="{Binding TowageOnArrivalOperatorFax}" IsReadOnly="True" Width="Auto" />
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
|
||||
</GroupBox>
|
||||
<GroupBox Name="groupBoxTowageOnDeparture" Grid.Row="1" Header="{x:Static p:Resources.textTowageOnDeparture}">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridTowageOnDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnDepartureName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnDepartureFlag}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDraughtInDecimetre}" Binding="{Binding TowageOnDepartureDraught_DMT}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLengthOverAll}" Binding="{Binding TowageOnDepartureLengthOverall_MTR}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBeamOverAll}" Binding="{Binding TowageOnDepartureBeam_MTR}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding TowageOnDepartureRemarks}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCompanyName}" Binding="{Binding TowageOnDepartureOperatorCompanyName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textStreetNumber}" Binding="{Binding TowageOnDepartureOperatorStreetNameAndNumber}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPostalCode}" Binding="{Binding TowageOnDepartureOperatorPostalCode}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCity}" Binding="{Binding TowageOnDepartureOperatorCity}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCountry}" Binding="{Binding TowageOnDepartureOperatorCountry}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding TowageOnDepartureOperatorEmail}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPhone}" Binding="{Binding TowageOnDepartureOperatorPhone}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFax}" Binding="{Binding TowageOnDepartureOperatorFax}" IsReadOnly="True" Width="Auto" />
|
||||
</DataGrid.Columns>
|
||||
</enictrl:ENIDataGrid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</src:DetailBaseControl>
|
||||
|
||||
@ -2,20 +2,10 @@
|
||||
// Description:
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using bsmd.database;
|
||||
using ENI2.EditControls;
|
||||
|
||||
namespace ENI2.DetailViewControls
|
||||
{
|
||||
@ -24,9 +14,207 @@ namespace ENI2.DetailViewControls
|
||||
/// </summary>
|
||||
public partial class TowageDetailControl : DetailBaseControl
|
||||
{
|
||||
|
||||
private Message _towaMessage;
|
||||
private Message _towdMessage;
|
||||
|
||||
public TowageDetailControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Loaded += TowageDetailControl_Loaded;
|
||||
}
|
||||
|
||||
private void TowageDetailControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
foreach (Message aMessage in this.Messages)
|
||||
{
|
||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWA) { this._towaMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.TOWD) { this._towdMessage = aMessage; this.ControlMessages.Add(aMessage); }
|
||||
}
|
||||
|
||||
#region TOWA
|
||||
|
||||
if (this._towaMessage == null)
|
||||
{
|
||||
this._towaMessage = this.Core.CreateMessage(Message.NotificationClass.TOWA);
|
||||
this.Messages.Add(this._towaMessage);
|
||||
}
|
||||
|
||||
this.dataGridTowageOnArrival.Initialize();
|
||||
this.dataGridTowageOnArrival.ItemsSource = this._towaMessage.Elements;
|
||||
this.dataGridTowageOnArrival.AddingNewItem += DataGridTowageOnArrival_AddingNewItem;
|
||||
this.dataGridTowageOnArrival.EditRequested += DataGridTowageOnArrival_EditRequested;
|
||||
this.dataGridTowageOnArrival.DeleteRequested += DataGridTowageOnArrival_DeleteRequested;
|
||||
this.dataGridTowageOnArrival.CreateRequested += DataGridTowageOnArrival_CreateRequested;
|
||||
|
||||
#endregion
|
||||
|
||||
#region TOWD
|
||||
|
||||
if (this._towdMessage == null)
|
||||
{
|
||||
this._towdMessage = this.Core.CreateMessage(Message.NotificationClass.TOWD);
|
||||
this.Messages.Add(this._towdMessage);
|
||||
}
|
||||
|
||||
this.dataGridTowageOnDeparture.Initialize();
|
||||
this.dataGridTowageOnDeparture.ItemsSource = this._towdMessage.Elements;
|
||||
this.dataGridTowageOnDeparture.AddingNewItem += DataGridTowageOnDeparture_AddingNewItem;
|
||||
this.dataGridTowageOnDeparture.EditRequested += DataGridTowageOnDeparture_EditRequested;
|
||||
this.dataGridTowageOnDeparture.DeleteRequested += DataGridTowageOnDeparture_DeleteRequested;
|
||||
this.dataGridTowageOnDeparture.CreateRequested += DataGridTowageOnDeparture_CreateRequested;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
private void DataGridTowageOnDeparture_CreateRequested()
|
||||
{
|
||||
TOWD towd = new TOWD();
|
||||
EditTOWDialog ebd = new EditTOWDialog();
|
||||
ebd.TOWD = towd;
|
||||
ebd.IsDeparture = true;
|
||||
|
||||
ebd.AddClicked += () =>
|
||||
{
|
||||
ebd.CopyValuesToEntity();
|
||||
this._towdMessage.Elements.Add(ebd.TOWD);
|
||||
ebd.TOWD.MessageHeader = _towdMessage;
|
||||
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||
ebd.TOWD = new TOWD();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||
};
|
||||
|
||||
if (ebd.ShowDialog() ?? false)
|
||||
{
|
||||
towd.MessageHeader = _towdMessage;
|
||||
_towdMessage.Elements.Add(towd);
|
||||
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnDeparture_DeleteRequested(DatabaseEntity obj)
|
||||
{
|
||||
TOWD towd = obj as TOWD;
|
||||
if (towd != null)
|
||||
{
|
||||
// are you sure dialog is in base class
|
||||
this._towdMessage.Elements.Remove(towd);
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(towd);
|
||||
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnDeparture_EditRequested(DatabaseEntity obj)
|
||||
{
|
||||
TOWD towd = obj as TOWD;
|
||||
if (towd != null)
|
||||
{
|
||||
EditTOWDialog eld = new EditTOWDialog();
|
||||
eld.IsDeparture = true;
|
||||
eld.TOWD = towd;
|
||||
|
||||
eld.AddClicked += () =>
|
||||
{
|
||||
eld.CopyValuesToEntity();
|
||||
_towdMessage.Elements.Add(eld.TOWD);
|
||||
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||
eld.TOWD = new TOWD();
|
||||
eld.TOWD.MessageHeader = _towdMessage;
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||
};
|
||||
|
||||
if (eld.ShowDialog() ?? false)
|
||||
{
|
||||
this.dataGridTowageOnDeparture.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnDeparture_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||
{
|
||||
this.DataGridTowageOnDeparture_CreateRequested();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void DataGridTowageOnArrival_CreateRequested()
|
||||
{
|
||||
TOWA towa = new TOWA();
|
||||
EditTOWDialog ebd = new EditTOWDialog();
|
||||
ebd.TOWA = towa;
|
||||
ebd.IsDeparture = false;
|
||||
|
||||
ebd.AddClicked += () =>
|
||||
{
|
||||
ebd.CopyValuesToEntity();
|
||||
this._towaMessage.Elements.Add(ebd.TOWA);
|
||||
ebd.TOWA.MessageHeader = _towaMessage;
|
||||
this.dataGridTowageOnArrival.Items.Refresh();
|
||||
ebd.TOWA = new TOWA();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||
};
|
||||
|
||||
if (ebd.ShowDialog() ?? false)
|
||||
{
|
||||
towa.MessageHeader = _towaMessage;
|
||||
_towaMessage.Elements.Add(towa);
|
||||
this.dataGridTowageOnArrival.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnArrival_DeleteRequested(DatabaseEntity obj)
|
||||
{
|
||||
TOWA towa = obj as TOWA;
|
||||
if (towa != null)
|
||||
{
|
||||
// are you sure dialog is in base class
|
||||
this._towaMessage.Elements.Remove(towa);
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(towa);
|
||||
this.dataGridTowageOnArrival.Items.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnArrival_EditRequested(DatabaseEntity obj)
|
||||
{
|
||||
TOWA towa = obj as TOWA;
|
||||
if (towa != null)
|
||||
{
|
||||
EditTOWDialog eld = new EditTOWDialog();
|
||||
eld.IsDeparture = false;
|
||||
eld.TOWA = towa;
|
||||
|
||||
eld.AddClicked += () =>
|
||||
{
|
||||
eld.CopyValuesToEntity();
|
||||
_towaMessage.Elements.Add(eld.TOWA);
|
||||
this.dataGridTowageOnArrival.Items.Refresh();
|
||||
eld.TOWA = new TOWA();
|
||||
eld.TOWA.MessageHeader = _towaMessage;
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||
};
|
||||
|
||||
if (eld.ShowDialog() ?? false)
|
||||
{
|
||||
this.dataGridTowageOnArrival.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.TOWA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGridTowageOnArrival_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
|
||||
{
|
||||
this.DataGridTowageOnArrival_CreateRequested();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>3</ApplicationRevision>
|
||||
<ApplicationRevision>5</ApplicationRevision>
|
||||
<ApplicationVersion>3.6.7.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
@ -248,6 +248,9 @@
|
||||
<Compile Include="EditControls\EditShip2ShipActivitiesDialog.xaml.cs">
|
||||
<DependentUpon>EditShip2ShipActivitiesDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EditControls\EditTOWDialog.xaml.cs">
|
||||
<DependentUpon>EditTOWDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EditControls\EditWasteDialog.xaml.cs">
|
||||
<DependentUpon>EditWasteDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -388,6 +391,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="EditControls\EditTOWDialog.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="EditControls\EditWasteDialog.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
72
ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml
Normal file
72
ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml
Normal file
@ -0,0 +1,72 @@
|
||||
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditTOWDialog"
|
||||
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:local="clr-namespace:ENI2.EditControls"
|
||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
mc:Ignorable="d"
|
||||
Height="440" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="56" />
|
||||
<RowDefinition Height="14" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Name="labelName" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textName}" />
|
||||
<Label Name="labelPurposeOfCall" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPurposeOfCall}" />
|
||||
<Label Name="labelDraught" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textDraughtInDecimetre}" />
|
||||
<Label Name="labelLength" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textLengthOverallInMeter}" />
|
||||
<Label Name="labelRemarks" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textRemarks}" />
|
||||
<Label Name="labelFlag" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textFlag}" />
|
||||
<Label Name="labelGrossTonnage" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textGrossTonnage}" />
|
||||
<Label Name="labelBeam" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textBeamOverallInMeter}" />
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxName" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxPurposeOfCall" Margin="2" MaxLength="100" />
|
||||
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownDraught" Margin="2" />
|
||||
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownLength" Margin="2" />
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxRemarks" Margin="2" MaxLength="100" />
|
||||
<ComboBox Grid.Row="1" Grid.Column="3" Name="comboBoxFlag" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
|
||||
<xctk:IntegerUpDown Grid.Row="2" Grid.Column="3" Name="integerUpDownGrossTonnage" Margin="2" />
|
||||
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="3" Name="doubleUpDownBeam" Margin="2" />
|
||||
|
||||
<TextBlock Text="Operator" FontWeight="Bold" FontSize="10" Grid.Row="5" Grid.Column="0" />
|
||||
|
||||
<Label Name="labelOperatorName" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textName}" />
|
||||
<Label Name="labelStreetAddress" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textStreetAndNumber}" />
|
||||
<Label Name="labelPostcode" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textPostalCode}" />
|
||||
<Label Name="labelCountry" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCountry}" />
|
||||
<Label Name="labelPhone" Grid.Row="10" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" />
|
||||
<Label Name="labelEmail" Grid.Row="100" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" />
|
||||
<Label Name="labelCity" Grid.Row="8" Grid.Column="2" Content="{x:Static p:Resources.textCity}" />
|
||||
<Label Name="labelFax" Grid.Row="10" Grid.Column="2" Content="{x:Static p:Resources.textFax}" />
|
||||
|
||||
<TextBox Grid.Row="6" Grid.Column="1" Width="auto" Name="textBoxOperatorName" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxStreetNumber" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="8" Grid.Column="1" Width="auto" Name="textBoxPostalCode" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="9" Grid.Column="1" Width="auto" Name="textBoxCountry" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="10" Grid.Column="1" Width="auto" Name="textBoxPhone" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="11" Grid.Column="1" Width="auto" Name="textBoxEMail" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="8" Grid.Column="3" Width="auto" Name="textBoxCity" Margin="2" MaxLength="100" />
|
||||
<TextBox Grid.Row="10" Grid.Column="3" Width="auto" Name="textBoxFax" Margin="2" MaxLength="100" />
|
||||
|
||||
</Grid>
|
||||
</enictrl:EditWindowBase>
|
||||
118
ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml.cs
Normal file
118
ENI-2/ENI2/ENI2/EditControls/EditTOWDialog.xaml.cs
Normal file
@ -0,0 +1,118 @@
|
||||
// Copyright (c) 2017 schick Informatik
|
||||
// Description: Dialog zum Bearbeiten von Towage-Informationen
|
||||
//
|
||||
|
||||
using System.Windows;
|
||||
|
||||
using bsmd.database;
|
||||
using ENI2.Controls;
|
||||
|
||||
namespace ENI2.EditControls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for EditTOWDialog.xaml
|
||||
/// </summary>
|
||||
public partial class EditTOWDialog : EditWindowBase
|
||||
{
|
||||
public EditTOWDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += EditTOWDialog_Loaded;
|
||||
AddClicked += () => { this.textBoxName.Focus(); };
|
||||
}
|
||||
|
||||
public bool IsDeparture { get; set; }
|
||||
|
||||
public TOWA TOWA { get; set; }
|
||||
|
||||
public TOWD TOWD { get; set; }
|
||||
|
||||
|
||||
private void EditTOWDialog_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Title = this.IsDeparture ? Properties.Resources.textTowageOnDeparture : Properties.Resources.textTowageOnArrival;
|
||||
|
||||
this.textBoxName.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureName : this.TOWA.TowageOnArrivalName;
|
||||
if (this.IsDeparture)
|
||||
{
|
||||
this.labelPurposeOfCall.Visibility = Visibility.Hidden;
|
||||
this.textBoxPurposeOfCall.Visibility = Visibility.Hidden;
|
||||
this.labelGrossTonnage.Visibility = Visibility.Hidden;
|
||||
this.integerUpDownGrossTonnage.Visibility = Visibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.textBoxPurposeOfCall.Text = this.TOWA.TowageOnArrivalPurposeOfCall;
|
||||
this.integerUpDownGrossTonnage.Value = this.TOWA.TowageOnArrivalGrossTonnage;
|
||||
}
|
||||
this.doubleUpDownDraught.Value = this.IsDeparture ? this.TOWD.TowageOnDepartureDraught_DMT : this.TOWA.TowageOnArrivalDraught_DMT;
|
||||
this.doubleUpDownLength.Value = this.IsDeparture ? this.TOWD.TowageOnDepartureLengthOverall_MTR : this.TOWA.TowageOnArrivalLengthOverall_MTR;
|
||||
this.textBoxRemarks.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureRemarks : this.TOWA.TowageOnArrivalRemarks;
|
||||
this.comboBoxFlag.ItemsSource = bsmd.database.CREW.NationalityDict;
|
||||
this.comboBoxFlag.SelectedValue = this.IsDeparture ? this.TOWD.TowageOnDepartureFlag : this.TOWA.TowageOnArrivalFlag;
|
||||
this.doubleUpDownBeam.Value = this.IsDeparture ? this.TOWD.TowageOnDepartureBeam_MTR : this.TOWA.TowageOnArrivalBeam_MTR;
|
||||
|
||||
this.textBoxOperatorName.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorCompanyName : this.TOWA.TowageOnArrivalOperatorCompanyName;
|
||||
this.textBoxStreetNumber.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorStreetNameAndNumber : this.TOWA.TowageOnArrivalOperatorStreetNameAndNumber;
|
||||
this.textBoxPostalCode.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorPostalCode : this.TOWA.TowageOnArrivalOperatorPostalCode;
|
||||
this.textBoxCountry.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorCountry : this.TOWA.TowageOnArrivalOperatorCountry;
|
||||
this.textBoxPhone.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorPhone : this.TOWA.TowageOnArrivalOperatorPhone;
|
||||
this.textBoxEMail.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorEmail : this.TOWA.TowageOnArrivalOperatorEmail;
|
||||
this.textBoxCity.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorCity : this.TOWA.TowageOnArrivalOperatorCity;
|
||||
this.textBoxFax.Text = this.IsDeparture ? this.TOWD.TowageOnDepartureOperatorFax : this.TOWA.TowageOnArrivalOperatorFax;
|
||||
|
||||
this.OKClicked += EditTOWDialog_OKClicked;
|
||||
this.AddVisible = true;
|
||||
}
|
||||
|
||||
public void CopyValuesToEntity()
|
||||
{
|
||||
if(this.IsDeparture)
|
||||
{
|
||||
this.TOWD.TowageOnDepartureName = this.textBoxName.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureDraught_DMT = this.doubleUpDownDraught.Value;
|
||||
this.TOWD.TowageOnDepartureLengthOverall_MTR = this.doubleUpDownLength.Value;
|
||||
this.TOWD.TowageOnDepartureRemarks = this.textBoxRemarks.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureFlag = (string) this.comboBoxFlag.SelectedValue;
|
||||
this.TOWD.TowageOnDepartureBeam_MTR = this.doubleUpDownBeam.Value;
|
||||
|
||||
this.TOWD.TowageOnDepartureOperatorCompanyName = this.textBoxOperatorName.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorStreetNameAndNumber = this.textBoxStreetNumber.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorPostalCode = this.textBoxPostalCode.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorCountry = this.textBoxCountry.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorPhone = this.textBoxPhone.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorEmail = this.textBoxEMail.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorCity = this.textBoxCity.Text.Trim();
|
||||
this.TOWD.TowageOnDepartureOperatorFax = this.textBoxFax.Text.Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.TOWA.TowageOnArrivalName = this.textBoxName.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalPurposeOfCall = this.textBoxPurposeOfCall.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalDraught_DMT = this.doubleUpDownDraught.Value;
|
||||
this.TOWA.TowageOnArrivalLengthOverall_MTR = this.doubleUpDownLength.Value;
|
||||
this.TOWA.TowageOnArrivalRemarks = this.textBoxRemarks.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalFlag = (string) this.comboBoxFlag.SelectedValue;
|
||||
this.TOWA.TowageOnArrivalGrossTonnage = this.integerUpDownGrossTonnage.Value;
|
||||
this.TOWA.TowageOnArrivalBeam_MTR = this.doubleUpDownBeam.Value;
|
||||
|
||||
this.TOWA.TowageOnArrivalOperatorCompanyName = this.textBoxOperatorName.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorStreetNameAndNumber = this.textBoxStreetNumber.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorPostalCode = this.textBoxPurposeOfCall.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorCountry = this.textBoxCountry.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorPhone = this.textBoxPhone.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorEmail = this.textBoxEMail.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorCity = this.textBoxCity.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorFax = this.textBoxFax.Text.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
private void EditTOWDialog_OKClicked()
|
||||
{
|
||||
this.CopyValuesToEntity();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
18
ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
generated
18
ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
generated
@ -2012,6 +2012,15 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Operator.
|
||||
/// </summary>
|
||||
public static string textOperator {
|
||||
get {
|
||||
return ResourceManager.GetString("textOperator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Other.
|
||||
/// </summary>
|
||||
@ -2948,6 +2957,15 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Towage on departure.
|
||||
/// </summary>
|
||||
public static string textTowageOnDeparture {
|
||||
get {
|
||||
return ResourceManager.GetString("textTowageOnDeparture", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Transit.
|
||||
/// </summary>
|
||||
|
||||
@ -1159,4 +1159,10 @@
|
||||
<data name="textSanitaryMeasureDetails" xml:space="preserve">
|
||||
<value>Details of sanitary measure</value>
|
||||
</data>
|
||||
<data name="textOperator" xml:space="preserve">
|
||||
<value>Operator</value>
|
||||
</data>
|
||||
<data name="textTowageOnDeparture" xml:space="preserve">
|
||||
<value>Towage on departure</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
@ -2210,7 +2210,7 @@ namespace bsmd.ExcelReadService
|
||||
|
||||
crew.CrewMemberNationality = reader.ReadNationality(crewNationality);
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadText(crewPlaceOfBirth);
|
||||
reader.Conf.ConfirmText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth, ExcelReader.ReadState.OK);
|
||||
reader.Conf.ConfirmText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth, crew.CrewMemberPlaceOfBirth.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
||||
|
||||
crew.CrewMemberDateOfBirth = reader.ReadBirthDate(crewDateOfBirth);
|
||||
|
||||
@ -2262,7 +2262,7 @@ namespace bsmd.ExcelReadService
|
||||
|
||||
crew.CrewMemberNationality = reader.ReadNationality(crewNationality);
|
||||
crew.CrewMemberPlaceOfBirth = reader.ReadText(crewPlaceOfBirth);
|
||||
reader.Conf.ConfirmText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth, ExcelReader.ReadState.OK);
|
||||
reader.Conf.ConfirmText(crewPlaceOfBirth, crew.CrewMemberPlaceOfBirth, crew.CrewMemberPlaceOfBirth.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
||||
|
||||
crew.CrewMemberDateOfBirth = reader.ReadBirthDate(crewDateOfBirth);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user