Border Police Detailansicht mit allem abhängigen Kruscht

This commit is contained in:
Daniel Schick 2017-07-06 12:49:52 +00:00
parent a09d4ae34d
commit 614dfbb894
23 changed files with 1223 additions and 50 deletions

View File

@ -26,12 +26,12 @@
<value>1000</value>
</setting>
<setting name="LockingServerAddress" serializeAs="String">
<!--value>http://192.168.2.4/LockingService/LockingService.svc</value-->
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
<value>http://192.168.2.4/LockingService/LockingService.svc</value>
<!--value>http://heupferd/bsmd.LockingService/LockingService.svc</value-->
</setting>
<setting name="ConnectionString" serializeAs="String">
<!--value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
<value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
<value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
<!--value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
</setting>
</ENI2.Properties.Settings>
</applicationSettings>

View File

@ -41,7 +41,7 @@ namespace ENI2
public static SplashScreenWindow SplashScreen { get { return _splashScreenWindow; } }
public static Guid? UserId { get { return _userId; } }
public static Guid? UserId { get { return _userId; } set { _userId = value; } }
protected override void OnStartup(StartupEventArgs e)
{
@ -65,10 +65,7 @@ namespace ENI2
LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]);
EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown));
// perform logon
// TODO: Benutzerverwaltung
CREW.NationalityDict = LocalizedLookup.getNationalities();
// Connect to locking service (if enabled)

View File

@ -150,8 +150,10 @@ namespace ENI2.DetailViewControls
{
ebd.CopyValuesToEntity();
this._bkraMessage.Elements.Add(ebd.BRKA);
ebd.BRKA.MessageHeader = _bkraMessage;
this.dataGridBKRA.Items.Refresh();
ebd.BRKA = new BRKA();
this.SublistElementChanged(Message.NotificationClass.BKRA);
};
if (ebd.ShowDialog() ?? false)
@ -189,13 +191,17 @@ namespace ENI2.DetailViewControls
_bkraMessage.Elements.Add(eld.BRKA);
this.dataGridBKRA.Items.Refresh();
eld.BRKA = new BRKA();
eld.BRKA.MessageHeader = _bkraMessage;
this.SublistElementChanged(Message.NotificationClass.BKRA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
}
}
private void DataGridBKRA_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
{

View File

@ -4,10 +4,90 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
d:DesignHeight="800" d:DesignWidth="1024">
<TabControl Margin="10" Name="mainFrame">
<TabItem Header="{x:Static p:Resources.textTabBorderPolice}" Name="tabBorderPolice">
<GroupBox Name="groupBoxBorderPolice" Header="{x:Static p:Resources.textGroupBoxBorderPolice}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="15" />
<RowDefinition Height="28" />
<RowDefinition Height="400" />
</Grid.RowDefinitions>
<Label Content="{x:Static p:Resources.textStowaways}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<CheckBox Name="checkBoxStowaways" IsChecked="{Binding StowawaysOnBoard}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<Label Content="{x:Static p:Resources.textCruiseShip}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<CheckBox Name="checkBoxCruiseShip" IsChecked="{Binding CruiseShip}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"/>
<Label Content="{x:Static p:Resources.textItineraryPort}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Left" Margin="0,0,10,0"/>
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfItinerary" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortOfItineraryName, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
<DataGridTextColumn Binding="{Binding PortOfItineraryLocode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textETA}" Binding="{Binding PortOfItineraryETA, Mode=TwoWay}" IsReadOnly="True" Width="0.6*" />
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>
</GroupBox>
</TabItem>
<TabItem Header="{x:Static p:Resources.textTabCrewList}" Name="tabCrewList">
<GroupBox Name="groupBoxCrewList" Header="{x:Static p:Resources.textTabCrewList}">
<Grid>
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding CrewMemberNationality, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textCrewFunctionOnBoard}" Binding="{Binding CrewMemberDuty, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding CrewMemberPlaceOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding CrewMemberDateOfBirth, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding CrewMemberIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding CrewMemberIdentityDocumentId, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding CrewMemberVisaNumber, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>
</GroupBox>
</TabItem>
<TabItem Header="{x:Static p:Resources.textTabPassengerList}" Name="tabPassengerList">
<GroupBox Name="groupBoxPassengerList" Header="{x:Static p:Resources.textTabPassengerList}">
<Grid>
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textNationality}" Binding="{Binding PassengerNationality}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfEmbarkation}" Binding="{Binding PassengerPortOfEmbarkation}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDisembarkation}" Binding="{Binding PassengerPortOfDisembarkation}" IsReadOnly="True" Width="0.1*" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textTransitPassenger}" Binding="{Binding PassengerInTransit}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textPlaceOfBirth}" Binding="{Binding PassengerPlaceOfBirth}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textDateOfBirth}" Binding="{Binding PassengerDateOfBirth}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocType}" Binding="{Binding PassengerIdentityDocumentTypeDisplay}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textIdDocNumber}" Binding="{Binding PassengerIdentityDocumentId}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textVisaNumber}" Binding="{Binding PassengerVisaNumber}" IsReadOnly="True" Width="0.1*" />
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>
</GroupBox>
</TabItem>
</TabControl>
</src:DetailBaseControl>

View File

@ -1,21 +1,13 @@
// Copyright (c) 2017 schick Informatik
// Description:
// Description: Detailansicht für BPOL, CREW(D), PAS(D)
//
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 ENI2.EditControls;
using bsmd.database;
namespace ENI2.DetailViewControls
{
@ -24,9 +16,319 @@ namespace ENI2.DetailViewControls
/// </summary>
public partial class BorderPoliceDetailControl : DetailBaseControl
{
private Message _bpolMessage;
private Message _crewMessage;
private Message _crewdMessage;
private Message _pasMessage;
private Message _pasdMessage;
private BPOL _bpol;
public BorderPoliceDetailControl()
{
InitializeComponent();
this.Loaded += BorderPoliceDetailControl_Loaded;
}
private void BorderPoliceDetailControl_Loaded(object sender, RoutedEventArgs e)
{
this.RegisterCheckboxChange(this.checkBoxCruiseShip, Message.NotificationClass.BPOL);
this.RegisterCheckboxChange(this.checkBoxStowaways, Message.NotificationClass.BPOL);
}
public override void Initialize()
{
base.Initialize();
foreach (Message aMessage in this.Messages)
{
if (aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) { this._bpolMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREW) { this._crewMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.PAS) { this._pasMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) { this._crewdMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.PASD) { this._pasdMessage = aMessage; this.ControlMessages.Add(aMessage); }
}
#region init BPOL
if (this._bpolMessage == null)
{
this._bpolMessage = this.Core.CreateMessage(Message.NotificationClass.BPOL);
this.Messages.Add(this._bpolMessage);
}
BPOL bpol = null;
if (this._bpolMessage.Elements.Count > 0)
bpol = this._bpolMessage.Elements[0] as BPOL;
if (bpol == null)
{
bpol = new BPOL();
bpol.MessageCore = this.Core;
bpol.MessageHeader = this._bpolMessage;
_bpolMessage.Elements.Add(bpol);
}
this.groupBoxBorderPolice.DataContext = bpol;
this._bpol = bpol;
this.dataGridPortOfItinerary.Initialize();
this.dataGridPortOfItinerary.ItemsSource = bpol.PortOfItineraries;
this.dataGridPortOfItinerary.AddingNewItem += DataGridPortOfItinerary_AddingNewItem;
this.dataGridPortOfItinerary.EditRequested += DataGridPortOfItinerary_EditRequested;
this.dataGridPortOfItinerary.DeleteRequested += DataGridPortOfItinerary_DeleteRequested;
this.dataGridPortOfItinerary.CreateRequested += DataGridPortOfItinerary_CreateRequested;
#endregion
#region init CREW
if (this._crewMessage == null)
{
this._crewMessage = this.Core.CreateMessage(Message.NotificationClass.CREW);
this.Messages.Add(this._crewMessage);
}
this.dataGridCrewList.Initialize();
this.dataGridCrewList.ItemsSource = this._crewMessage.Elements;
this.dataGridCrewList.AddingNewItem += DataGridCrewList_AddingNewItem;
this.dataGridCrewList.EditRequested += DataGridCrewList_EditRequested;
this.dataGridCrewList.DeleteRequested += DataGridCrewList_DeleteRequested;
this.dataGridCrewList.CreateRequested += DataGridCrewList_CreateRequested;
#endregion
#region init PAS
if (this._pasMessage == null)
{
this._pasMessage = this.Core.CreateMessage(Message.NotificationClass.PAS);
this.Messages.Add(this._pasMessage);
}
this.dataGridPassengerList.Initialize();
this.dataGridPassengerList.ItemsSource = this._pasMessage.Elements;
this.dataGridPassengerList.AddingNewItem += DataGridPassengerList_AddingNewItem;
this.dataGridPassengerList.EditRequested += DataGridPassengerList_EditRequested;
this.dataGridPassengerList.DeleteRequested += DataGridPassengerList_DeleteRequested;
this.dataGridPassengerList.CreateRequested += DataGridPassengerList_CreateRequested;
#endregion
}
#region port of itinerary grid
private void DataGridPortOfItinerary_CreateRequested()
{
PortOfItinerary poi = new PortOfItinerary();
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog();
epid.PortOfItinerary = poi;
epid.AddClicked += () =>
{
epid.CopyValuesToEntity();
epid.PortOfItinerary.BPOL = _bpol;
this._bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary();
this.SublistElementChanged(Message.NotificationClass.BPOL);
};
if (epid.ShowDialog() ?? false)
{
_bpol.PortOfItineraries.Add(epid.PortOfItinerary);
epid.PortOfItinerary.BPOL = _bpol;
this.dataGridPortOfItinerary.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BPOL);
}
}
private void DataGridPortOfItinerary_DeleteRequested(DatabaseEntity obj)
{
PortOfItinerary poi = obj as PortOfItinerary;
if (poi != null)
{
// are you sure dialog is in base class
_bpol.PortOfItineraries.Remove(poi);
// DBManager.Instance.Delete(serv); // not yet
this.dataGridPortOfItinerary.Items.Refresh();
}
}
private void DataGridPortOfItinerary_EditRequested(DatabaseEntity obj)
{
PortOfItinerary poi = obj as PortOfItinerary;
if (poi != null)
{
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog();
epid.PortOfItinerary = poi;
epid.AddClicked += () =>
{
epid.CopyValuesToEntity();
_bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary();
epid.PortOfItinerary.BPOL = this._bpol;
this.SublistElementChanged(Message.NotificationClass.BPOL);
};
if (epid.ShowDialog() ?? false)
{
this.dataGridPortOfItinerary.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BPOL);
}
}
}
private void DataGridPortOfItinerary_AddingNewItem(object sender, AddingNewItemEventArgs e)
{
this.DataGridPortOfItinerary_CreateRequested();
}
#endregion
#region passenger grid
private void DataGridPassengerList_CreateRequested()
{
PAS pas = new PAS();
EditPASDialog epd = new EditPASDialog();
epd.PAS = pas;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.PAS.MessageHeader = this._pasMessage;
this._pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS();
this.SublistElementChanged(Message.NotificationClass.PAS);
};
if (epd.ShowDialog() ?? false)
{
_pasMessage.Elements.Add(epd.PAS);
epd.PAS.MessageHeader = this._pasMessage;
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
}
private void DataGridPassengerList_DeleteRequested(DatabaseEntity obj)
{
PAS pas = obj as PAS;
if (pas != null)
{
// are you sure dialog is in base class
_pasMessage.Elements.Remove(pas);
// DBManager.Instance.Delete(serv); // not yet
this.dataGridPassengerList.Items.Refresh();
}
}
private void DataGridPassengerList_EditRequested(DatabaseEntity obj)
{
PAS pas = obj as PAS;
if (pas != null)
{
EditPASDialog epd = new EditPASDialog();
epd.PAS = pas;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
_pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS();
epd.PAS.MessageHeader = _pasMessage;
this.SublistElementChanged(Message.NotificationClass.PAS);
};
if (epd.ShowDialog() ?? false)
{
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
}
}
private void DataGridPassengerList_AddingNewItem(object sender, AddingNewItemEventArgs e)
{
this.DataGridPassengerList_CreateRequested();
}
#endregion
#region crew grid
private void DataGridCrewList_CreateRequested()
{
CREW crew = new CREW();
EditCREWDialog ecd = new EditCREWDialog();
ecd.CREW = crew;
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
ecd.CREW.MessageHeader = this._crewMessage;
this._crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW();
this.SublistElementChanged(Message.NotificationClass.CREW);
};
if (ecd.ShowDialog() ?? false)
{
_crewMessage.Elements.Add(ecd.CREW);
ecd.CREW.MessageHeader = this._crewMessage;
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
}
private void DataGridCrewList_DeleteRequested(DatabaseEntity obj)
{
CREW crew = obj as CREW;
if (crew != null)
{
// are you sure dialog is in base class
_crewMessage.Elements.Remove(crew);
// DBManager.Instance.Delete(serv); // not yet
this.dataGridCrewList.Items.Refresh();
}
}
private void DataGridCrewList_EditRequested(DatabaseEntity obj)
{
CREW crew = obj as CREW;
if (crew != null)
{
EditCREWDialog ecd = new EditCREWDialog();
ecd.CREW = crew;
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
_crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW();
ecd.CREW.MessageHeader = _crewMessage;
this.SublistElementChanged(Message.NotificationClass.CREW);
};
if (ecd.ShowDialog() ?? false)
{
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
}
}
private void DataGridCrewList_AddingNewItem(object sender, AddingNewItemEventArgs e)
{
this.DataGridCrewList_CreateRequested();
}
#endregion
}
}

View File

@ -32,13 +32,13 @@
<Label Content="{x:Static p:Resources.textTanker}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<CheckBox Name="checkBoxTanker" IsChecked="{Binding Tanker}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<Label Content="{x:Static p:Resources.textTankerHullConfig}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxTankerHullConfig" Margin="2" SelectedIndex="{Binding TankerHullConfiguration}"/>
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxTankerHullConfig" Margin="2" SelectedIndex="{Binding TankerHullConfiguration, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks}"/>
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/>
<Label Content="{x:Static p:Resources.textTankerNatureOfCargo}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" />
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}"/>
<Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding VolumeOfCargo, Mode=TwoWay}"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding VolumeOfCargo, Mode=TwoWay}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}"/>
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>

View File

@ -218,9 +218,18 @@
<Compile Include="EditControls\EditCallPurposeDialog.xaml.cs">
<DependentUpon>EditCallPurposeDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditCREWDialog.xaml.cs">
<DependentUpon>EditCREWDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditLADGDialog.xaml.cs">
<DependentUpon>EditLADGDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditPASDialog.xaml.cs">
<DependentUpon>EditPASDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditPortOfItineraryDialog.xaml.cs">
<DependentUpon>EditPortOfItineraryDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditSERVDialog.xaml.cs">
<DependentUpon>EditSERVDialog.xaml</DependentUpon>
</Compile>
@ -244,6 +253,7 @@
</Compile>
<Compile Include="Util\BoolToVisibilityConverter.cs" />
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
<Compile Include="Util\GlobalStructures.cs" />
<Compile Include="VorgaengeControl.xaml.cs">
<DependentUpon>VorgaengeControl.xaml</DependentUpon>
</Compile>
@ -320,10 +330,22 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditCREWDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditLADGDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="EditControls\EditPASDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditPortOfItineraryDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditSERVDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -35,8 +35,6 @@ namespace ENI2.EditControls
private void EditBKRDialog_Loaded(object sender, RoutedEventArgs e)
{
this.OKClicked += EditBKRDialog_OKClicked; ;
this.Title = this.IsDeparture ? Properties.Resources.textBunkerOnDeparture : Properties.Resources.textBunkerOnArrival;
// copy into fields

View File

@ -0,0 +1,48 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditCREWDialog"
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"
Title="{x:Static p:Resources.textCrewMember}" Height="246" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<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="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Name="labelFunctionOnBoard" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textCrewFunctionOnBoard}" />
<Label Name="labelLastName" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" />
<Label Name="labelFirstName" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textFirstName}" />
<Label Name="labelGender" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textGender}" />
<Label Name="labelPlaceOfBirth" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textPlaceOfBirth}" />
<Label Name="labelNationality" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
<Label Name="labelDateOfBirth" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
<Label Name="labelIdDocType" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
<Label Name="labelIdDocNumber" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
<Label Name="labelVisaNumber" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxDuty" Margin="2" MaxLength="100" />
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" />
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" />
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" />
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxGender" Margin="2" />
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
<ComboBox Grid.Row="4" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" />
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" />
<DatePicker Grid.Row="3" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" />
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" />
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,68 @@
// Copyright (c) 2017 schick Informatik
// Description: CREW Bearbeitungsdialog
//
using System.Windows;
using bsmd.database;
using ENI2.Controls;
using ENI2.Util;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for EditCREWDialog.xaml
/// </summary>
public partial class EditCREWDialog : EditWindowBase
{
public EditCREWDialog()
{
InitializeComponent();
Loaded += EditCREWDialog_Loaded;
AddClicked += () => { this.textBoxDuty.Focus(); };
}
public CREW CREW { get; set; }
private void EditCREWDialog_Loaded(object sender, RoutedEventArgs e)
{
// copy into fields
this.textBoxDuty.Text = this.CREW.CrewMemberDuty;
this.textBoxLastName.Text = this.CREW.CrewMemberLastName;
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender.HasValue ? this.CREW.CrewMemberGender.Value : -1;
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxNationality.SelectedValue = this.CREW.CrewMemberNationality;
this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
this.comboBoxIdDocType.SelectedIndex = this.CREW.CrewMemberIdentityDocumentType.HasValue ? this.CREW.CrewMemberIdentityDocumentType.Value : -1;
this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId;
this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber;
this.OKClicked += EditCREWDialog_OKClicked;
this.AddVisible = true;
}
public void CopyValuesToEntity()
{
// copy back
this.CREW.CrewMemberDuty = this.textBoxDuty.Text.Trim();
this.CREW.CrewMemberLastName = this.textBoxLastName.Text.Trim();
this.CREW.CrewMemberFirstName = this.textBoxFirstName.Text.Trim();
this.CREW.CrewMemberGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?) this.comboBoxGender.SelectedIndex;
this.CREW.CrewMemberPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
this.CREW.CrewMemberNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
this.CREW.CrewMemberDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
this.CREW.CrewMemberIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
this.CREW.CrewMemberIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
this.CREW.CrewMemberVisaNumber = this.textBoxVisaNumber.Text.Trim();
}
private void EditCREWDialog_OKClicked()
{
this.CopyValuesToEntity();
}
}
}

View File

@ -1,20 +1,8 @@
// Copyright (c) 2017 schick Informatik
// Description:
// Description: LADG Bearbeitungsdialog
//
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.Shapes;
using bsmd.database;
using ENI2.Controls;

View File

@ -0,0 +1,53 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditPASDialog"
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"
Title="{x:Static p:Resources.textPassenger}" Height="246" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<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="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Name="labelLastName" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" />
<Label Name="labelFirstName" Grid.Row="0 " Grid.Column="2" Content="{x:Static p:Resources.textFirstName}" />
<Label Name="labelGender" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textGender}" />
<Label Name="labelPlaceOfBirth" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textPlaceOfBirth}" />
<Label Name="labelNationality" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textNationality}" />
<Label Name="labelDateOfBirth" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textDateOfBirth}" />
<Label Name="labelIdDocType" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textIdDocType}" />
<Label Name="labelIdDocNumber" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textIdDocNumber}" />
<Label Name="labelVisaNumber" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textVisaNumber}" />
<Label Name="labelPortOfEmbarkation" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textPortOfEmbarkation}" />
<Label Name="labelPortOfDisEmbarkation" Grid.Row="5" Grid.Column="0 " Content="{x:Static p:Resources.textPortOfDisembarkation}" />
<Label Name="labelTransitPassenger" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textTransitPassenger}" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" />
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxGender" Margin="2" />
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxPlaceOfBirth" Margin="2" MaxLength="100" />
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxNationality" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
<DatePicker Grid.Row="2" Grid.Column="3" Name="datePickerDateOfBirth" Margin="2" />
<ComboBox Grid.Row="3" Grid.Column="1" Name="comboBoxIdDocType" Margin="2" />
<TextBox Grid.Row="3" Grid.Column="3" Width="auto" Name="textBoxIdDocNumber" Margin="2" MaxLength="100" />
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxVisaNumber" Margin="2" MaxLength="100" />
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxPortOfEmbarkation" Margin="2" MaxLength="100" />
<TextBox Grid.Row="5" Grid.Column="1" Width="auto" Name="textBoxPortOfDisEmbarkation" Margin="2" MaxLength="100" />
<CheckBox Name="checkBoxTransitPassenger" Grid.Row ="5" Grid.Column="3" VerticalAlignment="Center" Margin="2"/>
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,71 @@
// Copyright (c) 2017 schick Informatik
// Description: PAS Bearbeitungsdialog
//
using System.Windows;
using bsmd.database;
using ENI2.Controls;
using ENI2.Util;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for EditPasDialog.xaml
/// </summary>
public partial class EditPASDialog : EditWindowBase
{
public EditPASDialog()
{
InitializeComponent();
Loaded += EditPasDialog_Loaded;
AddClicked += () => { this.textBoxLastName.Focus(); };
}
public PAS PAS { get; set; }
private void EditPasDialog_Loaded(object sender, RoutedEventArgs e)
{
// copy into fields
this.textBoxLastName.Text = this.PAS.PassengerLastName;
this.textBoxFirstName.Text = this.PAS.PassengerFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender.HasValue ? this.PAS.PassengerGender.Value : -1;
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxNationality.SelectedValue = this.PAS.PassengerNationality;
this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType.HasValue ? this.PAS.PassengerIdentityDocumentType.Value : -1;
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
this.textBoxPortOfEmbarkation.Text = this.PAS.PassengerPortOfEmbarkation;
this.textBoxPortOfDisEmbarkation.Text = this.PAS.PassengerPortOfDisembarkation;
this.checkBoxTransitPassenger.IsChecked = this.PAS.PassengerInTransit;
this.OKClicked += EditPasDialog_OKClicked;
this.AddVisible = true;
}
public void CopyValuesToEntity()
{
// copy back
this.PAS.PassengerLastName = this.textBoxLastName.Text.Trim();
this.PAS.PassengerFirstName = this.textBoxFirstName.Text.Trim();
this.PAS.PassengerGender = (this.comboBoxGender.SelectedIndex == -1) ? null : (byte?)this.comboBoxGender.SelectedIndex;
this.PAS.PassengerPlaceOfBirth = this.textBoxPlaceOfBirth.Text.Trim();
this.PAS.PassengerNationality = (this.comboBoxNationality.SelectedValue == null) ? "" : (string)this.comboBoxNationality.SelectedValue;
this.PAS.PassengerDateOfBirth = this.datePickerDateOfBirth.SelectedDate;
this.PAS.PassengerIdentityDocumentType = (this.comboBoxIdDocType.SelectedIndex == -1) ? null : (byte?)this.comboBoxIdDocType.SelectedIndex;
this.PAS.PassengerIdentityDocumentId = this.textBoxIdDocNumber.Text.Trim();
this.PAS.PassengerVisaNumber = this.textBoxVisaNumber.Text.Trim();
this.PAS.PassengerPortOfEmbarkation = this.textBoxPortOfEmbarkation.Text.Trim();
this.PAS.PassengerPortOfDisembarkation = this.textBoxPortOfDisEmbarkation.Text.Trim();
this.PAS.PassengerInTransit = this.checkBoxTransitPassenger.IsChecked;
}
private void EditPasDialog_OKClicked()
{
this.CopyValuesToEntity();
}
}
}

View File

@ -0,0 +1,27 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditPortOfItineraryDialog"
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:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textPortOfItinerary}" Height="150" Width="360" WindowStyle="SingleBorderWindow" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textPortname}" />
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textETA}" />
<enictrl:LocodeControl Grid.Column="1" Grid.Row="0" x:Name="locodeControlPortName" />
<xctk:DateTimePicker Name="dateTimePickerETA" Grid.Column="1" Grid.Row="1" Margin="2"/>
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,52 @@
// Copyright (c) 2017 schick Informatik
// Description: Bearbeitungsdialog für Call of itinerary
//
using System.Windows;
using ENI2.Controls;
using bsmd.database;
using bsmd.ExcelReadService;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for EditPortOfItineraryDialog.xaml
/// </summary>
public partial class EditPortOfItineraryDialog : EditWindowBase
{
public EditPortOfItineraryDialog()
{
InitializeComponent();
Loaded += EditPortOfItineraryDialog_Loaded; ;
AddClicked += () => { this.locodeControlPortName.Focus(); };
}
public PortOfItinerary PortOfItinerary { get; set; }
private void EditPortOfItineraryDialog_Loaded(object sender, RoutedEventArgs e)
{
this.OKClicked += EditPortOfItineraryDialog_OKClicked;
// copy into fields
this.locodeControlPortName.LocodeValue = this.PortOfItinerary.PortOfItineraryLocode;
this.dateTimePickerETA.Value = this.PortOfItinerary.PortOfItineraryETA;
this.AddVisible = true;
}
public void CopyValuesToEntity()
{
// copy back
this.PortOfItinerary.PortOfItineraryLocode = this.locodeControlPortName.LocodeValue;
this.PortOfItinerary.PortOfItineraryName = this.PortOfItinerary.PortOfItineraryLocode.IsNullOrEmpty() ? "" : LocodeDB.PortNameFromLocode(this.PortOfItinerary.PortOfItineraryLocode);
this.PortOfItinerary.PortOfItineraryETA = this.dateTimePickerETA.Value;
}
private void EditPortOfItineraryDialog_OKClicked()
{
this.CopyValuesToEntity();
}
}
}

View File

@ -59,6 +59,24 @@ namespace ENI2
return result;
}
public static Dictionary<string, string> getNationalities()
{
Dictionary<string, string> result = new Dictionary<string, string>();
string query = string.Format("SELECT Code, Name FROM Nationality");
SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
string code = null;
string name = null;
if (!reader.IsDBNull(0)) code = reader.GetString(0);
if (!reader.IsDBNull(1)) name = reader.GetString(1);
if((code != null) && (name != null))
result[code] = name;
}
reader.Close();
return result;
}
}

View File

@ -18,6 +18,7 @@ using ENI2.EditControls;
using ENI2.Util;
using log4net;
using System.ComponentModel;
namespace ENI2
{
@ -221,6 +222,27 @@ namespace ENI2
dtPicker.Value = null;
}
// das funktioniert auch für Comboboxen :P
ComboBox cb = e.OriginalSource as ComboBox;
if(cb == null)
{
cb = CustomCommands.FindParent<ComboBox>(e.OriginalSource as DependencyObject);
}
if(cb != null)
{
cb.SelectedIndex = -1;
LocalValueEnumerator localSetProperties = cb.GetLocalValueEnumerator();
while(localSetProperties.MoveNext())
{
if(localSetProperties.Current.Property.Name == "SelectedIndex")
{
cb.ClearValue(localSetProperties.Current.Property);
}
}
}
}
private void CanExecuteClearCommand(object sender, CanExecuteRoutedEventArgs e)
@ -333,6 +355,7 @@ namespace ENI2
this.busyIndicator.IsBusy = false;
this.labelStatusBar.Text = string.Format("Rep.Party: {0} {1} [{2}]", this.userEntity.FirstName, this.userEntity.LastName, this.userEntity.Logon);
App.UserId = this.userEntity.Id;
break;
case ReportingParty.LogonResult.FAILED:
this.labelLoginResult.Content = Properties.Resources.textWrongPassword;

View File

@ -860,6 +860,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Function on board.
/// </summary>
public static string textCrewFunctionOnBoard {
get {
return ResourceManager.GetString("textCrewFunctionOnBoard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Crew member.
/// </summary>
public static string textCrewMember {
get {
return ResourceManager.GetString("textCrewMember", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number of crew members on board.
/// </summary>
@ -869,6 +887,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Cruise ship.
/// </summary>
public static string textCruiseShip {
get {
return ResourceManager.GetString("textCruiseShip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Date of birth.
/// </summary>
public static string textDateOfBirth {
get {
return ResourceManager.GetString("textDateOfBirth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Declarations.
/// </summary>
@ -1022,6 +1058,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to ETA.
/// </summary>
public static string textETA {
get {
return ResourceManager.GetString("textETA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ETA Kiel Canal.
/// </summary>
@ -1103,6 +1148,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Female.
/// </summary>
public static string textFemale {
get {
return ResourceManager.GetString("textFemale", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to First name.
/// </summary>
@ -1139,6 +1193,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Gender.
/// </summary>
public static string textGender {
get {
return ResourceManager.GetString("textGender", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gross tonnage.
/// </summary>
@ -1148,6 +1211,42 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Border police notification.
/// </summary>
public static string textGroupBoxBorderPolice {
get {
return ResourceManager.GetString("textGroupBoxBorderPolice", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ID doc. number.
/// </summary>
public static string textIdDocNumber {
get {
return ResourceManager.GetString("textIdDocNumber", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ID doc. type.
/// </summary>
public static string textIdDocType {
get {
return ResourceManager.GetString("textIdDocType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Identity card.
/// </summary>
public static string textIdentityCard {
get {
return ResourceManager.GetString("textIdentityCard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to IMO number.
/// </summary>
@ -1175,6 +1274,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Itinerary port.
/// </summary>
public static string textItineraryPort {
get {
return ResourceManager.GetString("textItineraryPort", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to LA Code.
/// </summary>
@ -1274,6 +1382,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Male.
/// </summary>
public static string textMale {
get {
return ResourceManager.GetString("textMale", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Master.
/// </summary>
@ -1292,6 +1409,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Muster book.
/// </summary>
public static string textMusterBook {
get {
return ResourceManager.GetString("textMusterBook", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// </summary>
@ -1310,6 +1436,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Nationality.
/// </summary>
public static string textNationality {
get {
return ResourceManager.GetString("textNationality", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Create new id.
/// </summary>
@ -1355,6 +1490,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Other.
/// </summary>
public static string textOther {
get {
return ResourceManager.GetString("textOther", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Other legal identity document.
/// </summary>
public static string textOtherLegalIdentityDocument {
get {
return ResourceManager.GetString("textOtherLegalIdentityDocument", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Overview.
/// </summary>
@ -1364,6 +1517,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Passenger.
/// </summary>
public static string textPassenger {
get {
return ResourceManager.GetString("textPassenger", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number of passengers on board.
/// </summary>
@ -1373,6 +1535,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Passport.
/// </summary>
public static string textPassport {
get {
return ResourceManager.GetString("textPassport", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password.
/// </summary>
@ -1409,6 +1580,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Photo Id.
/// </summary>
public static string textPhotoId {
get {
return ResourceManager.GetString("textPhotoId", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Place of birth.
/// </summary>
public static string textPlaceOfBirth {
get {
return ResourceManager.GetString("textPlaceOfBirth", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Planned inspection / works.
/// </summary>
@ -1463,6 +1652,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Port name.
/// </summary>
public static string textPortname {
get {
return ResourceManager.GetString("textPortname", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Port notification.
/// </summary>
@ -1472,6 +1670,33 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Port of disembarkation.
/// </summary>
public static string textPortOfDisembarkation {
get {
return ResourceManager.GetString("textPortOfDisembarkation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Port of embarkation.
/// </summary>
public static string textPortOfEmbarkation {
get {
return ResourceManager.GetString("textPortOfEmbarkation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Port of itinerary.
/// </summary>
public static string textPortOfItinerary {
get {
return ResourceManager.GetString("textPortOfItinerary", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Postalcode.
/// </summary>
@ -1580,6 +1805,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to ResidencePermit.
/// </summary>
public static string textResidencePermit {
get {
return ResourceManager.GetString("textResidencePermit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Save.
/// </summary>
@ -1787,6 +2021,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Stowaways on board.
/// </summary>
public static string textStowaways {
get {
return ResourceManager.GetString("textStowaways", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number of stowaways on board.
/// </summary>
@ -1805,6 +2048,33 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Border police.
/// </summary>
public static string textTabBorderPolice {
get {
return ResourceManager.GetString("textTabBorderPolice", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Crew list.
/// </summary>
public static string textTabCrewList {
get {
return ResourceManager.GetString("textTabCrewList", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Passenger list.
/// </summary>
public static string textTabPassengerList {
get {
return ResourceManager.GetString("textTabPassengerList", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tanker.
/// </summary>
@ -1886,6 +2156,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Transit passenger.
/// </summary>
public static string textTransitPassenger {
get {
return ResourceManager.GetString("textTransitPassenger", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Type for Locode....
/// </summary>
@ -1931,6 +2210,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Visa number.
/// </summary>
public static string textVisaNumber {
get {
return ResourceManager.GetString("textVisaNumber", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Visit / transit.
/// </summary>

View File

@ -754,4 +754,100 @@
<data name="textInert" xml:space="preserve">
<value>Inert</value>
</data>
<data name="textGroupBoxBorderPolice" xml:space="preserve">
<value>Border police notification</value>
</data>
<data name="textItineraryPort" xml:space="preserve">
<value>Itinerary port</value>
</data>
<data name="textPortOfItinerary" xml:space="preserve">
<value>Port of itinerary</value>
</data>
<data name="textStowaways" xml:space="preserve">
<value>Stowaways on board</value>
</data>
<data name="textETA" xml:space="preserve">
<value>ETA</value>
</data>
<data name="textPortname" xml:space="preserve">
<value>Port name</value>
</data>
<data name="textTabBorderPolice" xml:space="preserve">
<value>Border police</value>
</data>
<data name="textTabCrewList" xml:space="preserve">
<value>Crew list</value>
</data>
<data name="textTabPassengerList" xml:space="preserve">
<value>Passenger list</value>
</data>
<data name="textCrewFunctionOnBoard" xml:space="preserve">
<value>Function on board</value>
</data>
<data name="textCruiseShip" xml:space="preserve">
<value>Cruise ship</value>
</data>
<data name="textDateOfBirth" xml:space="preserve">
<value>Date of birth</value>
</data>
<data name="textGender" xml:space="preserve">
<value>Gender</value>
</data>
<data name="textIdDocNumber" xml:space="preserve">
<value>ID doc. number</value>
</data>
<data name="textIdDocType" xml:space="preserve">
<value>ID doc. type</value>
</data>
<data name="textNationality" xml:space="preserve">
<value>Nationality</value>
</data>
<data name="textPlaceOfBirth" xml:space="preserve">
<value>Place of birth</value>
</data>
<data name="textPortOfDisembarkation" xml:space="preserve">
<value>Port of disembarkation</value>
</data>
<data name="textPortOfEmbarkation" xml:space="preserve">
<value>Port of embarkation</value>
</data>
<data name="textTransitPassenger" xml:space="preserve">
<value>Transit passenger</value>
</data>
<data name="textVisaNumber" xml:space="preserve">
<value>Visa number</value>
</data>
<data name="textCrewMember" xml:space="preserve">
<value>Crew member</value>
</data>
<data name="textFemale" xml:space="preserve">
<value>Female</value>
</data>
<data name="textIdentityCard" xml:space="preserve">
<value>Identity card</value>
</data>
<data name="textMale" xml:space="preserve">
<value>Male</value>
</data>
<data name="textMusterBook" xml:space="preserve">
<value>Muster book</value>
</data>
<data name="textOther" xml:space="preserve">
<value>Other</value>
</data>
<data name="textOtherLegalIdentityDocument" xml:space="preserve">
<value>Other legal identity document</value>
</data>
<data name="textPassport" xml:space="preserve">
<value>Passport</value>
</data>
<data name="textPhotoId" xml:space="preserve">
<value>Photo Id</value>
</data>
<data name="textResidencePermit" xml:space="preserve">
<value>ResidencePermit</value>
</data>
<data name="textPassenger" xml:space="preserve">
<value>Passenger</value>
</data>
</root>

View File

@ -0,0 +1,34 @@
// Copyright (c) 2017 schick Informatik
// Description: hier sind mehrfach verwendete Strukturen abgelegt
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ENI2.Util
{
class GlobalStructures
{
public static string[] GenderList =
{
Properties.Resources.textMale,
Properties.Resources.textFemale,
Properties.Resources.textOther
};
public static string[] IDDocTypeList =
{
Properties.Resources.textIdentityCard,
Properties.Resources.textPassport,
Properties.Resources.textMusterBook,
Properties.Resources.textPhotoId,
Properties.Resources.textResidencePermit,
Properties.Resources.textOtherLegalIdentityDocument
};
}
}

Binary file not shown.

View File

@ -98,6 +98,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public static Dictionary<string, string> NationalityDict { get; set; }
#endregion
#region DatabaseEntity implementation

Binary file not shown.