neue Version ENI (mit Benutzerverwaltung)

weitere Versuch mit der Schnittstelle (xsd generiert, ..)
This commit is contained in:
Daniel Schick 2017-07-26 19:49:21 +00:00
parent 0b08679de0
commit b46b3606ac
49 changed files with 2458 additions and 147 deletions

View File

@ -120,8 +120,11 @@ namespace ENI2.Controls
protected void addItem(object sender, RoutedEventArgs e) protected void addItem(object sender, RoutedEventArgs e)
{ {
if(!this.IsReadOnly) if (!this.IsReadOnly)
{
this.CreateRequested?.Invoke(); this.CreateRequested?.Invoke();
}
e.Handled = true;
} }
protected void deleteItem(object sender, RoutedEventArgs e) protected void deleteItem(object sender, RoutedEventArgs e)

View File

@ -107,6 +107,13 @@ namespace ENI2.Controls
//System.Diagnostics.Trace.WriteLine("---"); //System.Diagnostics.Trace.WriteLine("---");
itemsViewOriginal.Refresh(); itemsViewOriginal.Refresh();
if (itemsViewOriginal.Count == 1)
{
// Treffer: Select?
cmb.SelectedItem = itemsViewOriginal.GetItemAt(0);
}
} }
#endregion #endregion

View File

@ -0,0 +1,31 @@
<UserControl x:Class="ENI2.Controls.ReportingPartyControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.Controls"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textUserAdministration}">
<local:ENIDataGrid Margin="2,8,2,2" x:Name="dataGridReportingParties" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding FirstName}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding LastName}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textLogin}" Binding="{Binding Logon}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textEMail}" Binding="{Binding UserEMail}" IsReadOnly="True" Width="0.2*" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textAdministrator}" Binding="{Binding IsAdmin}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textCreated}" Binding="{Binding Created}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.1*" />
</DataGrid.Columns>
</local:ENIDataGrid>
</GroupBox>
</UserControl>

View File

@ -0,0 +1,90 @@
// Copyright (c) 2017 schick Informatik
// Description: Tabelle Reporting Party (bearbeitet wird im Dialog)
//
using System;
using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using System.Collections.Generic;
using System.Windows.Controls;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for ReportingPartyControl.xaml
/// </summary>
public partial class ReportingPartyControl : UserControl
{
public ReportingPartyControl()
{
InitializeComponent();
Loaded += ReportingPartyControl_Loaded;
}
public List<ReportingParty> ReportingParties { get; set; }
private void ReportingPartyControl_Loaded(object sender, RoutedEventArgs e)
{
this.dataGridReportingParties.Initialize();
this.dataGridReportingParties.ItemsSource = this.ReportingParties;
this.dataGridReportingParties.CreateRequested += DataGridReportingParties_CreateRequested;
this.dataGridReportingParties.AddingNewItem += DataGridReportingParties_AddingNewItem;
this.dataGridReportingParties.EditRequested += DataGridReportingParties_EditRequested;
this.dataGridReportingParties.DeleteRequested += DataGridReportingParties_DeleteRequested;
}
#region grid event handler
private void DataGridReportingParties_DeleteRequested(DatabaseEntity obj)
{
ReportingParty rp = obj as ReportingParty;
if (rp != null)
{
// are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(rp);
this.ReportingParties.Remove(rp);
this.dataGridReportingParties.Items.Refresh();
}
}
private void DataGridReportingParties_EditRequested(DatabaseEntity obj)
{
ReportingParty rp = obj as ReportingParty;
if (rp != null)
{
EditReportingPartyDialog eld = new EditReportingPartyDialog();
eld.ReportingParty = rp;
if (eld.ShowDialog() ?? false)
{
this.dataGridReportingParties.Items.Refresh();
}
}
}
private void DataGridReportingParties_AddingNewItem(object sender, AddingNewItemEventArgs e)
{
this.DataGridReportingParties_CreateRequested();
}
private void DataGridReportingParties_CreateRequested()
{
ReportingParty rp = new ReportingParty();
EditReportingPartyDialog ebd = new EditReportingPartyDialog();
ebd.ReportingParty = rp;
if (ebd.ShowDialog() ?? false)
{
DBManager.Instance.GetReportingPartyDict().Add(Guid.NewGuid(), rp);
this.ReportingParties.Add(rp);
this.dataGridReportingParties.Items.Refresh();
}
}
#endregion
}
}

View File

@ -241,6 +241,13 @@ namespace ENI2
}); });
itemsViewOriginal.Refresh(); itemsViewOriginal.Refresh();
if(itemsViewOriginal.Count == 1)
{
// Treffer: Select?
cmb.SelectedItem = itemsViewOriginal.GetItemAt(0);
}
} }
#endregion #endregion

View File

@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:local="clr-namespace:ENI2" xmlns:local="clr-namespace:ENI2"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"> d:DesignHeight="300" d:DesignWidth="300">
@ -49,7 +50,7 @@
<ColumnDefinition Width="30"></ColumnDefinition> <ColumnDefinition Width="30"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image Source="{Binding ImagePath}" Grid.Column="0" /> <Image Source="{Binding ImagePath, Converter={util:NullImageConverter}}" Grid.Column="0" />
<TextBlock Text="{Binding MessageGroupName}" Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0" /> <TextBlock Text="{Binding MessageGroupName}" Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>

View File

@ -26,7 +26,7 @@ namespace ENI2
private MessageCore _core; private MessageCore _core;
private List<MessageGroup> _listBoxList = new List<MessageGroup>(); private List<MessageGroup> _listBoxList = new List<MessageGroup>();
private List<Message> _messages; private List<Message> _messages;
private Dictionary<Type, DetailBaseControl> controlCache = new Dictionary<Type, DetailBaseControl>(); private Dictionary<string, DetailBaseControl> controlCache = new Dictionary<string, DetailBaseControl>();
private Guid userId = Guid.NewGuid(); // remove THIS!! private Guid userId = Guid.NewGuid(); // remove THIS!!
private object messageListLock = new object(); private object messageListLock = new object();
@ -105,7 +105,7 @@ namespace ENI2
if(listBoxMessages.SelectedItem != null) if(listBoxMessages.SelectedItem != null)
{ {
MessageGroup mg = this.listBoxMessages.SelectedItem as MessageGroup; MessageGroup mg = this.listBoxMessages.SelectedItem as MessageGroup;
if (!controlCache.ContainsKey(mg.MessageGroupControlType)) if (!controlCache.ContainsKey(mg.MessageGroupName))
{ {
// create control instance for display: // create control instance for display:
DetailBaseControl detailControl = (DetailBaseControl)Activator.CreateInstance(mg.MessageGroupControlType); DetailBaseControl detailControl = (DetailBaseControl)Activator.CreateInstance(mg.MessageGroupControlType);
@ -133,14 +133,14 @@ namespace ENI2
if (!detailControl.IsEnabled && (detailControl is OverViewDetailControl)) if (!detailControl.IsEnabled && (detailControl is OverViewDetailControl))
((OverViewDetailControl)detailControl).ShowLockedBy(this.LockedBy); ((OverViewDetailControl)detailControl).ShowLockedBy(this.LockedBy);
controlCache.Add(mg.MessageGroupControlType, detailControl); controlCache.Add(mg.MessageGroupName, detailControl);
this.buttonSave.Visibility = Visibility.Hidden; this.buttonSave.Visibility = Visibility.Hidden;
} }
else else
{ {
// Control has been created before: Set visibility of "save" button: // Control has been created before: Set visibility of "save" button:
bool hasDirtyMessages = false; bool hasDirtyMessages = false;
DetailBaseControl dbc = controlCache[mg.MessageGroupControlType]; DetailBaseControl dbc = controlCache[mg.MessageGroupName];
foreach (Message message in dbc.ControlMessages) foreach (Message message in dbc.ControlMessages)
if (message.IsDirty) if (message.IsDirty)
hasDirtyMessages = true; hasDirtyMessages = true;
@ -149,7 +149,7 @@ namespace ENI2
// plug it in ;-) // plug it in ;-)
detailView.Children.Clear(); detailView.Children.Clear();
detailView.Children.Add(controlCache[mg.MessageGroupControlType]); detailView.Children.Add(controlCache[mg.MessageGroupName]);
} }
} }

View File

@ -171,6 +171,7 @@ namespace ENI2.DetailViewControls
if (brka != null) if (brka != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(brka);
this._bkraMessage.Elements.Remove(brka); this._bkraMessage.Elements.Remove(brka);
this.dataGridBKRA.Items.Refresh(); this.dataGridBKRA.Items.Refresh();
} }

View File

@ -33,7 +33,7 @@
<CheckBox Name="checkBoxDangerousGoodsOnBoard" IsChecked="{Binding NoDPGOnBoardOnArrival, Converter={util:InverseBooleanConverter}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/> <CheckBox Name="checkBoxDangerousGoodsOnBoard" IsChecked="{Binding NoDPGOnBoardOnArrival, Converter={util:InverseBooleanConverter}}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxDGManifestOnBoard" IsChecked="{Binding DPGManifestOnBoardOnArrival}" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"/> <CheckBox Name="checkBoxDGManifestOnBoard" IsChecked="{Binding DPGManifestOnBoardOnArrival}" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"/>
<CheckBox Name="checkBoxMoUBaltic" IsChecked="{Binding MOUBaltic}" Grid.Row="1" Grid.Column="3" VerticalAlignment="Center"/> <CheckBox Name="checkBoxMoUBaltic" IsChecked="{Binding MOUBaltic}" Grid.Row="1" Grid.Column="3" VerticalAlignment="Center"/>
<ComboBox Name="comboBoxVesselClass" Grid.Row="1" Grid.Column="1" Margin="2" SelectedIndex="{Binding INFShipClass}"/> <ComboBox x:Name="comboBoxVesselClass" Grid.Row="1" Grid.Column="1" Margin="2" SelectedIndex="{Binding INFShipClass, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}"/>
<TabControl Name="tabControlPositions" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="5"> <TabControl Name="tabControlPositions" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="5">
<TabItem Header="{x:Static p:Resources.textIMDGItems}" Name="tabIMDGItems"> <TabItem Header="{x:Static p:Resources.textIMDGItems}" Name="tabIMDGItems">
<enictrl:ENIDataGrid x:Name="dataGridIMDGItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid x:Name="dataGridIMDGItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"

View File

@ -123,6 +123,7 @@ namespace ENI2.DetailViewControls
if (marpol != null) if (marpol != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(marpol);
this.haz.MARPOLPositions.Remove(marpol); this.haz.MARPOLPositions.Remove(marpol);
this.dataGridMARPOLItems.Items.Refresh(); this.dataGridMARPOLItems.Items.Refresh();
} }
@ -142,6 +143,7 @@ namespace ENI2.DetailViewControls
haz.MARPOLPositions.Add(eld.MARPOL); haz.MARPOLPositions.Add(eld.MARPOL);
this.dataGridMARPOLItems.Items.Refresh(); this.dataGridMARPOLItems.Items.Refresh();
eld.MARPOL = new MARPOL_Annex_I_Position(); eld.MARPOL = new MARPOL_Annex_I_Position();
eld.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions);
eld.MARPOL.HAZ = this.haz; eld.MARPOL.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -162,6 +164,7 @@ namespace ENI2.DetailViewControls
private void DataGridMARPOLItems_CreateRequested() private void DataGridMARPOLItems_CreateRequested()
{ {
MARPOL_Annex_I_Position marpol = new MARPOL_Annex_I_Position(); MARPOL_Annex_I_Position marpol = new MARPOL_Annex_I_Position();
marpol.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions);
EditMarpolDialog ebd = new EditMarpolDialog(); EditMarpolDialog ebd = new EditMarpolDialog();
ebd.MARPOL = marpol; ebd.MARPOL = marpol;
@ -172,6 +175,7 @@ namespace ENI2.DetailViewControls
ebd.MARPOL.HAZ = this.haz; ebd.MARPOL.HAZ = this.haz;
this.dataGridMARPOLItems.Items.Refresh(); this.dataGridMARPOLItems.Items.Refresh();
ebd.MARPOL = new MARPOL_Annex_I_Position(); ebd.MARPOL = new MARPOL_Annex_I_Position();
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions);
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -194,6 +198,7 @@ namespace ENI2.DetailViewControls
if (imsbc != null) if (imsbc != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imsbc);
this.haz.IMSBCPositions.Remove(imsbc); this.haz.IMSBCPositions.Remove(imsbc);
this.dataGridIMSBCItems.Items.Refresh(); this.dataGridIMSBCItems.Items.Refresh();
} }
@ -213,6 +218,7 @@ namespace ENI2.DetailViewControls
haz.IMSBCPositions.Add(eld.IMSBC); haz.IMSBCPositions.Add(eld.IMSBC);
this.dataGridIMSBCItems.Items.Refresh(); this.dataGridIMSBCItems.Items.Refresh();
eld.IMSBC = new IMSBCPosition(); eld.IMSBC = new IMSBCPosition();
eld.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
eld.IMSBC.HAZ = this.haz; eld.IMSBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -233,6 +239,7 @@ namespace ENI2.DetailViewControls
private void DataGridIMSBCItems_CreateRequested() private void DataGridIMSBCItems_CreateRequested()
{ {
IMSBCPosition imsbc = new IMSBCPosition(); IMSBCPosition imsbc = new IMSBCPosition();
imsbc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
EditIMSBCDialog ebd = new EditIMSBCDialog(); EditIMSBCDialog ebd = new EditIMSBCDialog();
ebd.IMSBC = imsbc; ebd.IMSBC = imsbc;
@ -243,6 +250,7 @@ namespace ENI2.DetailViewControls
ebd.IMSBC.HAZ = this.haz; ebd.IMSBC.HAZ = this.haz;
this.dataGridIMSBCItems.Items.Refresh(); this.dataGridIMSBCItems.Items.Refresh();
ebd.IMSBC = new IMSBCPosition(); ebd.IMSBC = new IMSBCPosition();
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -265,6 +273,7 @@ namespace ENI2.DetailViewControls
if (igc != null) if (igc != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(igc);
this.haz.IGCPositions.Remove(igc); this.haz.IGCPositions.Remove(igc);
this.dataGridIGCItems.Items.Refresh(); this.dataGridIGCItems.Items.Refresh();
} }
@ -284,6 +293,7 @@ namespace ENI2.DetailViewControls
haz.IGCPositions.Add(eld.IGC); haz.IGCPositions.Add(eld.IGC);
this.dataGridIGCItems.Items.Refresh(); this.dataGridIGCItems.Items.Refresh();
eld.IGC = new IGCPosition(); eld.IGC = new IGCPosition();
eld.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
eld.IGC.HAZ = this.haz; eld.IGC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -304,6 +314,7 @@ namespace ENI2.DetailViewControls
private void DataGridIGCItems_CreateRequested() private void DataGridIGCItems_CreateRequested()
{ {
IGCPosition igc = new IGCPosition(); IGCPosition igc = new IGCPosition();
igc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
EditIGCDialog ebd = new EditIGCDialog(); EditIGCDialog ebd = new EditIGCDialog();
ebd.IGC = igc; ebd.IGC = igc;
@ -314,6 +325,7 @@ namespace ENI2.DetailViewControls
ebd.IGC.HAZ = this.haz; ebd.IGC.HAZ = this.haz;
this.dataGridIGCItems.Items.Refresh(); this.dataGridIGCItems.Items.Refresh();
ebd.IGC = new IGCPosition(); ebd.IGC = new IGCPosition();
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -336,6 +348,7 @@ namespace ENI2.DetailViewControls
if (ibc != null) if (ibc != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ibc);
this.haz.IBCPositions.Remove(ibc); this.haz.IBCPositions.Remove(ibc);
this.dataGridIBCItems.Items.Refresh(); this.dataGridIBCItems.Items.Refresh();
} }
@ -355,6 +368,7 @@ namespace ENI2.DetailViewControls
haz.IBCPositions.Add(eld.IBC); haz.IBCPositions.Add(eld.IBC);
this.dataGridIBCItems.Items.Refresh(); this.dataGridIBCItems.Items.Refresh();
eld.IBC = new IBCPosition(); eld.IBC = new IBCPosition();
eld.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
eld.IBC.HAZ = this.haz; eld.IBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -375,6 +389,7 @@ namespace ENI2.DetailViewControls
private void DataGridIBCItems_CreateRequested() private void DataGridIBCItems_CreateRequested()
{ {
IBCPosition ibc = new IBCPosition(); IBCPosition ibc = new IBCPosition();
ibc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
EditIBCDialog ebd = new EditIBCDialog(); EditIBCDialog ebd = new EditIBCDialog();
ebd.IBC = ibc; ebd.IBC = ibc;
@ -385,6 +400,7 @@ namespace ENI2.DetailViewControls
ebd.IBC.HAZ = this.haz; ebd.IBC.HAZ = this.haz;
this.dataGridIBCItems.Items.Refresh(); this.dataGridIBCItems.Items.Refresh();
ebd.IBC = new IBCPosition(); ebd.IBC = new IBCPosition();
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -407,6 +423,7 @@ namespace ENI2.DetailViewControls
if (imdg != null) if (imdg != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(imdg);
this.haz.IMDGPositions.Remove(imdg); this.haz.IMDGPositions.Remove(imdg);
this.dataGridIMDGItems.Items.Refresh(); this.dataGridIMDGItems.Items.Refresh();
} }
@ -426,6 +443,7 @@ namespace ENI2.DetailViewControls
haz.IMDGPositions.Add(eld.IMDG); haz.IMDGPositions.Add(eld.IMDG);
this.dataGridIMDGItems.Items.Refresh(); this.dataGridIMDGItems.Items.Refresh();
eld.IMDG = new IMDGPosition(); eld.IMDG = new IMDGPosition();
eld.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
eld.IMDG.HAZ = this.haz; eld.IMDG.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };
@ -446,6 +464,7 @@ namespace ENI2.DetailViewControls
private void DataGridIMDGItems_CreateRequested() private void DataGridIMDGItems_CreateRequested()
{ {
IMDGPosition imdg = new IMDGPosition(); IMDGPosition imdg = new IMDGPosition();
imdg.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
EditIMDGDialog ebd = new EditIMDGDialog(); EditIMDGDialog ebd = new EditIMDGDialog();
ebd.IMDG = imdg; ebd.IMDG = imdg;
@ -456,6 +475,7 @@ namespace ENI2.DetailViewControls
ebd.IMDG.HAZ = this.haz; ebd.IMDG.HAZ = this.haz;
this.dataGridIMDGItems.Items.Refresh(); this.dataGridIMDGItems.Items.Refresh();
ebd.IMDG = new IMDGPosition(); ebd.IMDG = new IMDGPosition();
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA); this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}; };

View File

@ -80,11 +80,11 @@
<TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" /> <TextBox Name="textBoxPlaceOfIssue" Grid.Row="14" Grid.Column="1" MaxLength="100" Text="{Binding PlaceOfIssue}" Margin="2" />
<TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" /> <TextBox Name="textBoxStowawaysJoiningLocation" Grid.Row="11" Grid.RowSpan="3" Grid.Column="3" MaxLength="100" Text="{Binding CSOLastName}" Margin="2" />
<DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" /> <DatePicker Name="datePickerDateOfIssue" Grid.Row="14" Grid.Column="3" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" ContextMenu="{DynamicResource ClearContextMenu}" />
<enictrl:LocodeControl x:Name="locodePortWhereHealthDeclarationWasGiven" Grid.Row="1" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteMDHNotified}" /> <enictrl:LocodeControl x:Name="locodePortWhereHealthDeclarationWasGiven" Grid.Row="1" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteMDHNotified}" />
<xctk:IntegerUpDown Name="integerUpDownNumberOfDeaths" Grid.Row="3" Grid.Column="3" Value="{Binding NonAccidentalDeathsDuringVoyageCount}" Margin="2" /> <xctk:IntegerUpDown Name="integerUpDownNumberOfDeaths" Grid.Row="3" Grid.Column="3" Value="{Binding NonAccidentalDeathsDuringVoyageCount}" Margin="2" ShowButtonSpinner="False" />
<xctk:IntegerUpDown Name="integerUpDownNumberOfIllPersons" Grid.Row="7" Grid.Column="3" Value="{Binding NumberOfIllPersons}" Margin="2" /> <xctk:IntegerUpDown Name="integerUpDownNumberOfIllPersons" Grid.Row="7" Grid.Column="3" Value="{Binding NumberOfIllPersons}" Margin="2" ShowButtonSpinner="False" />

View File

@ -7,9 +7,10 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:local="clr-namespace:ENI2.DetailViewControls" xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="600"> d:DesignHeight="300" d:DesignWidth="800">
<xctk:BusyIndicator Name="busyIndicator"> <xctk:BusyIndicator Name="busyIndicator">
<xctk:BusyIndicator.ProgressBarStyle> <xctk:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar"> <Style TargetType="ProgressBar">
@ -104,7 +105,7 @@
<DataTemplate> <DataTemplate>
<!--Image Source="{Binding src:Util.ImageDict[ENINotificationDetailGroup]}" /--> <!--Image Source="{Binding src:Util.ImageDict[ENINotificationDetailGroup]}" /-->
<!--Image Source="{Binding Source={x:Static src:Util.ImageDict}, Path=[ENINotificationDetailGroup]}"></--> <!--Image Source="{Binding Source={x:Static src:Util.ImageDict}, Path=[ENINotificationDetailGroup]}"></-->
<Image Source="{Binding ENINotificationIconString}" /> <Image Source="{Binding ENINotificationIconString, Converter={util:NullImageConverter}}" />
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> </DataGridTemplateColumn>

View File

@ -62,7 +62,7 @@ namespace ENI2.DetailViewControls
this.labelCreated.Content = this.Core.Created?.ToString(); this.labelCreated.Content = this.Core.Created?.ToString();
Binding vtBinding = new Binding(); Binding vtBinding = new Binding();
vtBinding.Source = this.Core; vtBinding.Source = this.Core;
vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId"); vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId");
vtBinding.Mode = BindingMode.TwoWay; vtBinding.Mode = BindingMode.TwoWay;
vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;

View File

@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.DetailViewControls" xmlns:local="clr-namespace:ENI2.DetailViewControls"
@ -32,9 +33,9 @@
<Label Content="{x:Static p:Resources.textTanker}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/> <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"/> <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"/> <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, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/> <ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxTankerHullConfig" Margin="2" SelectedIndex="{Binding TankerHullConfiguration, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" 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"/> <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, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}" ContextMenu="{DynamicResource ClearContextMenu}"/> <ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={util:ByteConverter}}" 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"/> <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" IsEnabled="{Binding ElementName=checkBoxTanker, Path=IsChecked}"/> <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"/> <Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>

View File

@ -5,6 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ENI2.DetailViewControls" xmlns:local="clr-namespace:ENI2.DetailViewControls"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
@ -54,8 +55,8 @@
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="0" Grid.Column="1" Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea}"/> <ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" /> <ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall}" /> <TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall}" />
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower}" /> <TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower}" />
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower}" /> <TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower}" />

View File

@ -6,6 +6,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.DetailViewControls" xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d" mc:Ignorable="d"
@ -84,9 +85,9 @@
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedOutgoing" Grid.Row="1" Grid.Column="3" Value="{Binding KielCanalPassagePlannedOutgoing}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}"/> <xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedOutgoing" Grid.Row="1" Grid.Column="3" Value="{Binding KielCanalPassagePlannedOutgoing}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}"/>
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False" /> <ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False" />
<ComboBox Name="comboBoxISSCType" Grid.Row="14" Grid.Column="1" SelectedIndex="{Binding ISSCType}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/> <ComboBox Name="comboBoxISSCType" Grid.Row="14" Grid.Column="1" SelectedIndex="{Binding ISSCType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/>
<ComboBox Name="comboBoxISSCIssuerType" Grid.Row="14" Grid.Column="3" SelectedIndex="{Binding ISSCIssuerType}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/> <ComboBox Name="comboBoxISSCIssuerType" Grid.Row="14" Grid.Column="3" SelectedIndex="{Binding ISSCIssuerType, Converter={util:ByteConverter}}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/>
<ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="18" Grid.Column="3" IsEditable="True" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo}" Margin="2" IsTextSearchEnabled="False"/> <ComboBox Name="comboBoxGeneralDescriptionOfCargo" Grid.Row="18" Grid.Column="3" IsEditable="True" StaysOpenOnEdit="True" SelectedIndex="{Binding GeneralDescriptionOfCargo, Converter={util:ByteConverter}}" Margin="2" IsTextSearchEnabled="False"/>
<DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" /> <DatePicker Name="datePickerISSCDateOfExpiration" Grid.Row="15" Grid.Column="1" SelectedDate="{Binding ISSCDateOfExpiration}" Margin="2" />

View File

@ -7,6 +7,7 @@
xmlns:local="clr-namespace:ENI2.DetailViewControls" xmlns:local="clr-namespace:ENI2.DetailViewControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800"> d:DesignHeight="600" d:DesignWidth="800">
@ -41,7 +42,7 @@
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness}" /> <CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness}" />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption}" /> <CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption}" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxWasteDisposal" Margin="2" SelectedIndex="{Binding WasteDisposalDelivery}"/> <ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxWasteDisposal" Margin="2" SelectedIndex="{Binding WasteDisposalDelivery}"/>
<DatePicker Grid.Row="2" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate}" /> <DatePicker Grid.Row="2" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Converter={util:ByteConverter}}" />
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort}" /> <enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort}" />
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" /> <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" />
</Grid> </Grid>

View File

@ -35,7 +35,7 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion> <MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision> <ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>3.6.9.%2a</ApplicationVersion> <ApplicationVersion>3.6.9.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
@ -168,6 +168,9 @@
<Compile Include="Controls\LocodeControl.xaml.cs"> <Compile Include="Controls\LocodeControl.xaml.cs">
<DependentUpon>LocodeControl.xaml</DependentUpon> <DependentUpon>LocodeControl.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\ReportingPartyControl.xaml.cs">
<DependentUpon>ReportingPartyControl.xaml</DependentUpon>
</Compile>
<Compile Include="CustomCommands.cs" /> <Compile Include="CustomCommands.cs" />
<Compile Include="DetailBaseControl.cs" /> <Compile Include="DetailBaseControl.cs" />
<Compile Include="DetailRootControl.xaml.cs"> <Compile Include="DetailRootControl.xaml.cs">
@ -254,6 +257,9 @@
<Compile Include="EditControls\EditPortOfItineraryDialog.xaml.cs"> <Compile Include="EditControls\EditPortOfItineraryDialog.xaml.cs">
<DependentUpon>EditPortOfItineraryDialog.xaml</DependentUpon> <DependentUpon>EditPortOfItineraryDialog.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="EditControls\EditReportingPartyDialog.xaml.cs">
<DependentUpon>EditReportingPartyDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditSanitaryMeasureDialog.xaml.cs"> <Compile Include="EditControls\EditSanitaryMeasureDialog.xaml.cs">
<DependentUpon>EditSanitaryMeasureDialog.xaml</DependentUpon> <DependentUpon>EditSanitaryMeasureDialog.xaml</DependentUpon>
</Compile> </Compile>
@ -288,9 +294,11 @@
<DependentUpon>SucheControl.xaml</DependentUpon> <DependentUpon>SucheControl.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Util\BoolToVisibilityConverter.cs" /> <Compile Include="Util\BoolToVisibilityConverter.cs" />
<Compile Include="Util\ByteConverter.cs" />
<Compile Include="Util\DatabaseEntityWatchdog.cs" /> <Compile Include="Util\DatabaseEntityWatchdog.cs" />
<Compile Include="Util\GlobalStructures.cs" /> <Compile Include="Util\GlobalStructures.cs" />
<Compile Include="Util\InverseBooleanConverter.cs" /> <Compile Include="Util\InverseBooleanConverter.cs" />
<Compile Include="Util\NullImageConverter.cs" />
<Compile Include="VorgaengeControl.xaml.cs"> <Compile Include="VorgaengeControl.xaml.cs">
<DependentUpon>VorgaengeControl.xaml</DependentUpon> <DependentUpon>VorgaengeControl.xaml</DependentUpon>
</Compile> </Compile>
@ -303,6 +311,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Controls\ReportingPartyControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DetailRootControl.xaml"> <Page Include="DetailRootControl.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -415,6 +427,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="EditControls\EditReportingPartyDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditSanitaryMeasureDialog.xaml"> <Page Include="EditControls\EditSanitaryMeasureDialog.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

View File

@ -43,7 +43,7 @@
<Label Name="labelStowagePosition" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" /> <Label Name="labelStowagePosition" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" />
<Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" /> <Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" MaxLength="40" Margin="2" /> <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" IsReadOnly="True" MaxLength="40" Margin="2" />
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxProductName" MaxLength="255" Margin="2" /> <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxProductName" MaxLength="255" Margin="2" />
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxPollutionCategory" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/> <ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxPollutionCategory" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/>
<ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Name="comboBoxFlashpointInformation" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/> <ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Name="comboBoxFlashpointInformation" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/>

View File

@ -37,7 +37,7 @@
<Label Name="labelStowagePosition" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" /> <Label Name="labelStowagePosition" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" />
<Label Name="labelPortOfDischarge" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" /> <Label Name="labelPortOfDischarge" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" MaxLength="40" Margin="2" /> <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" IsReadOnly ="True" MaxLength="40" Margin="2" />
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxProductName" MaxLength="255" Margin="2" /> <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxProductName" MaxLength="255" Margin="2" />
<TextBox Grid.Row="2" Grid.Column="1" Name="textBoxUNNumber" MaxLength="4" Margin="2" /> <TextBox Grid.Row="2" Grid.Column="1" Name="textBoxUNNumber" MaxLength="4" Margin="2" />
<TextBox Grid.Row="2" Grid.Column="4" Name="textBoxIMOClass" MaxLength="4" Margin="2" /> <TextBox Grid.Row="2" Grid.Column="4" Name="textBoxIMOClass" MaxLength="4" Margin="2" />

View File

@ -78,7 +78,7 @@ Copyright (c) 2017 schick Informatik
<Label Name="labelPortOfDischarge" Grid.Row="10" Grid.Column="6" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" /> <Label Name="labelPortOfDischarge" Grid.Row="10" Grid.Column="6" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" />
<Label Name="labelContainerPositionTier" Grid.Row="11" Grid.Column="6" Content="{x:Static p:Resources.textContainerPositionTier}" HorizontalContentAlignment="Right" /> <Label Name="labelContainerPositionTier" Grid.Row="11" Grid.Column="6" Content="{x:Static p:Resources.textContainerPositionTier}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxIdentifier" Margin="2" MaxLength="100" Grid.ColumnSpan="2" /> <TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxIdentifier" IsReadOnly = "True" Margin="2" MaxLength="100" Grid.ColumnSpan="2" />
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxUNNumber" Margin="2" MaxLength="4" /> <TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxUNNumber" Margin="2" MaxLength="4" />
<TextBox Grid.Row="2" Grid.Column="1" Width="auto" Name="textBoxProperShippingName" Margin="2" MaxLength="255" Grid.ColumnSpan="2" /> <TextBox Grid.Row="2" Grid.Column="1" Width="auto" Name="textBoxProperShippingName" Margin="2" MaxLength="255" Grid.ColumnSpan="2" />
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="decimalUpDownNetExplosiveMass" Margin="2" ShowButtonSpinner="False" FormatString="N3"/> <xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="decimalUpDownNetExplosiveMass" Margin="2" ShowButtonSpinner="False" FormatString="N3"/>

View File

@ -40,7 +40,7 @@
<Label Name="labelQuantity" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textQuantity}" HorizontalContentAlignment="Right" /> <Label Name="labelQuantity" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textQuantity}" HorizontalContentAlignment="Right" />
<Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" /> <Label Name="labelPortOfDischarge" Grid.Row="5" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" MaxLength="40" Margin="2" /> <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" IsReadOnly="True" MaxLength="40" Margin="2" />
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxBulkCargoShippingName" MaxLength="255" Margin="2" /> <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxBulkCargoShippingName" MaxLength="255" Margin="2" />
<CheckBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="2" Name="checkBoxMaterialHazardous" /> <CheckBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="2" Name="checkBoxMaterialHazardous" />
<TextBox Grid.Row="2" Grid.Column="4" Name="textBoxUNNumber" MaxLength="4" Margin="2" /> <TextBox Grid.Row="2" Grid.Column="4" Name="textBoxUNNumber" MaxLength="4" Margin="2" />

View File

@ -37,7 +37,7 @@
<Label Name="labelStowagePosition" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" /> <Label Name="labelStowagePosition" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textStowagePosition}" HorizontalContentAlignment="Right" />
<Label Name="labelPortOfDischarge" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" /> <Label Name="labelPortOfDischarge" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textPortOfDischarge}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" MaxLength="40" Margin="2" /> <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="textBoxIdentifier" IsReadOnly="True" MaxLength="40" Margin="2" />
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxName" MaxLength="255" Margin="2" /> <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Name="textBoxName" MaxLength="255" Margin="2" />
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxFlashpointInformation" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/> <ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxFlashpointInformation" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="False"/>
<TextBox Grid.Row="2" Grid.Column="4" Name="textBoxFlashpoint" MaxLength="10" Margin="2" /> <TextBox Grid.Row="2" Grid.Column="4" Name="textBoxFlashpoint" MaxLength="10" Margin="2" />

View File

@ -0,0 +1,73 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditReportingPartyDialog"
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.textReportingParty}" Height="350" 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="8" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Label Name="labelName" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textName}" HorizontalContentAlignment="Right" />
<Label Name="labelEMail" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textEMail}" HorizontalContentAlignment="Right" />
<Label Name="labelFirstName" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" HorizontalContentAlignment="Right" />
<Label Name="labelLastName" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textLastName}" HorizontalContentAlignment="Right" />
<Label Name="labelStreetAndNumber" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textStreetAndNumber}" HorizontalContentAlignment="Right" />
<Label Name="labelPostalCode" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textPostalCode}" HorizontalContentAlignment="Right" />
<Label Name="labelCity" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textCity}" HorizontalContentAlignment="Right" />
<Label Name="labelCountry" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textCountry}" HorizontalContentAlignment="Right" />
<Label Name="labelPhone" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textPhone}" HorizontalContentAlignment="Right" />
<Label Name="labelFax" Grid.Row="4" Grid.Column="2" Content="{x:Static p:Resources.textFax}" HorizontalContentAlignment="Right" />
<TextBlock Background="LightBlue" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" />
<Label Name="labelLogon" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textLogin}" HorizontalContentAlignment="Right" />
<Label Name="labelPassword" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textPassword}" HorizontalContentAlignment="Right" />
<Label Name="labelUserEMail" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textEMail}" HorizontalContentAlignment="Right" />
<Label Name="labelAdmin" Grid.Row="7" Grid.Column="2" Content="{x:Static p:Resources.textAdministrator}" HorizontalContentAlignment="Right" />
<Label Name="labelArchived" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textArchived}" HorizontalContentAlignment="Right" />
<Label Name="labelCreated" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" HorizontalContentAlignment="Right" />
<Label Name="labelChanged" Grid.Row="9" Grid.Column="2" Content="{x:Static p:Resources.textChanged}" HorizontalContentAlignment="Right" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="0" Grid.Column="3" Width="auto" Name="textBoxEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="1" Width="auto" Name="textBoxFirstName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="3" Width="auto" Name="textBoxLastName" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="2" Grid.Column="1" Width="auto" Name="textBoxStreetNumber" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="2" Grid.Column="3" Width="auto" Name="textBoxPostalCode" Margin="2" MaxLength="25" VerticalContentAlignment="Center" />
<TextBox Grid.Row="3" Grid.Column="1" Width="auto" Name="textBoxCity" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="3" Grid.Column="3" Width="auto" Name="textBoxCountry" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="4" Grid.Column="1" Width="auto" Name="textBoxPhone" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="4" Grid.Column="3" Width="auto" Name="textBoxFax" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<TextBox Grid.Row="6" Grid.Column="1" Width="auto" Name="textBoxUserLogon" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<PasswordBox Grid.Row="6" Grid.Column="3" Width="auto" Name="passwordBoxPassword" Margin="2" VerticalContentAlignment="Center" />
<TextBox Grid.Row="7" Grid.Column="1" Width="auto" Name="textBoxUserEMail" Margin="2" MaxLength="100" VerticalContentAlignment="Center" />
<CheckBox Grid.Row="7" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxAdministrator" Margin="2" />
<CheckBox Grid.Row="8" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxArchived" Margin="2" />
<Label Grid.Row="9" Grid.Column="1" Name="dateTimePickerCreated" FontStyle="Italic" />
<Label Grid.Row="9" Grid.Column="3" Name="dateTimePickerChanged" FontStyle="Italic" />
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,82 @@
// Copyright (c) 2017 schick Informatik
// Description: Reporting party Bearbeitungsdialog
//
using System.Windows;
using bsmd.database;
using ENI2.Controls;
using ENI2.Util;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for EditReportingPartyDialog.xaml
/// </summary>
public partial class EditReportingPartyDialog : EditWindowBase
{
public EditReportingPartyDialog()
{
InitializeComponent();
Loaded += EditReportingPartyDialog_Loaded;
}
public ReportingParty ReportingParty { get; set; }
private void EditReportingPartyDialog_Loaded(object sender, RoutedEventArgs e)
{
this.textBoxCity.Text = this.ReportingParty.City;
this.textBoxCountry.Text = this.ReportingParty.Country;
this.textBoxEMail.Text = this.ReportingParty.EMail;
this.textBoxFax.Text = this.ReportingParty.Fax;
this.textBoxFirstName.Text = this.ReportingParty.FirstName;
this.textBoxLastName.Text = this.ReportingParty.LastName;
this.textBoxName.Text = this.ReportingParty.Name;
this.textBoxPhone.Text = this.ReportingParty.Phone;
this.textBoxPostalCode.Text = this.ReportingParty.PostalCode;
this.textBoxStreetNumber.Text = this.ReportingParty.StreetAndNumber;
this.textBoxUserEMail.Text = this.ReportingParty.UserEMail;
this.textBoxUserLogon.Text = this.ReportingParty.Logon;
this.checkBoxAdministrator.IsChecked = this.ReportingParty.IsAdmin;
this.checkBoxArchived.IsChecked = this.ReportingParty.IsArchived;
this.dateTimePickerChanged.Content = this.ReportingParty.Changed.HasValue ? this.ReportingParty.Changed.ToString() : "";
this.dateTimePickerCreated.Content = this.ReportingParty.Created.HasValue ? this.ReportingParty.Created.ToString() : "";
this.AddVisible = false; // hier mal nicht
this.OKClicked += EditReportingPartyDialog_OKClicked;
}
public void CopyValuesToEntity()
{
this.ReportingParty.City = this.textBoxCity.Text.Trim();
this.ReportingParty.Country = this.textBoxCountry.Text.Trim();
this.ReportingParty.EMail = this.textBoxEMail.Text.Trim();
this.ReportingParty.Fax = this.textBoxFax.Text.Trim();
this.ReportingParty.FirstName = this.textBoxFirstName.Text.Trim();
this.ReportingParty.LastName = this.textBoxLastName.Text.Trim();
this.ReportingParty.Name = this.textBoxName.Text.Trim();
this.ReportingParty.Phone = this.textBoxPhone.Text.Trim();
this.ReportingParty.PostalCode = this.textBoxPostalCode.Text.Trim();
this.ReportingParty.StreetAndNumber = this.textBoxStreetNumber.Text.Trim();
this.ReportingParty.UserEMail = this.textBoxUserEMail.Text.Trim();
this.ReportingParty.Logon = this.textBoxUserLogon.Text.Trim();
if(!this.passwordBoxPassword.Password.IsNullOrEmpty())
{
this.ReportingParty.SetPassword(this.passwordBoxPassword.Password);
}
this.ReportingParty.IsAdmin = this.checkBoxAdministrator.IsChecked ?? false;
this.ReportingParty.IsArchived = this.checkBoxArchived.IsChecked ?? false;
// save value
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.ReportingParty);
}
private void EditReportingPartyDialog_OKClicked()
{
this.CopyValuesToEntity();
}
}
}

View File

@ -52,15 +52,19 @@
</Grid> </Grid>
</xctk:BusyIndicator.BusyContent> </xctk:BusyIndicator.BusyContent>
<DockPanel Name="mainPanel"> <DockPanel Name="mainPanel">
<Grid DockPanel.Dock="Top" Height="80" Background="#FFE8F6FF"> <Grid DockPanel.Dock="Top" Height="80" Background="#FFE8F6FF">
<Image x:Name="logoImage" HorizontalAlignment="Left" Height="75" Width="75" Source="Resources/EUREPORT.png" Stretch="Fill" MouseUp="logoImage_MouseUp" /> <Grid.ColumnDefinitions>
<Button x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" Margin="101,25,0,0" VerticalAlignment="Top" Width="110" Height="23" Click="buttonNewTransitIdClick" Background="Transparent" /> <ColumnDefinition Width="auto" />
<!--Button x:Name="buttonAnmeldungen" Content="{x:Static p:Resources.textDeclarations}" HorizontalAlignment="Left" Margin="101,25,0,0" VerticalAlignment="Top" Width="95" Height="23" Click="buttonAnmeldungen_Click" Background="Transparent" /--> <ColumnDefinition Width="auto" />
<!--Button x:Name="buttonVorgaenge" Content="{x:Static p:Resources.textOperations}" HorizontalAlignment="Left" Margin="201,25,0,0" VerticalAlignment="Top" Width="95" Height="23" Click="buttonVorgaenge_Click" Background="Transparent" / --> <ColumnDefinition Width="auto" />
<!-- Button x:Name="buttonSuche" Content="{x:Static p:Resources.textSearch}" HorizontalAlignment="Left" Margin="301,25,0,0" VerticalAlignment="Top" Width="95" Height="23" Click="buttonSuche_Click" Background="Transparent" /--> <ColumnDefinition Width="*" />
</Grid> </Grid.ColumnDefinitions>
<Image Grid.Column="0" x:Name="logoImage" HorizontalAlignment="Left" Height="75" Width="75" Source="Resources/EUREPORT.png" Stretch="Fill" MouseUp="logoImage_MouseUp" Margin="2"/>
<Button Grid.Column="1" x:Name="buttonNewId" Content="{x:Static p:Resources.textNewVisitTransitId}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="buttonNewTransitIdClick" Background="Transparent" Margin="2"/>
<Button Grid.Column="2" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="buttonUserAdmin_Click" Background="Transparent" Visibility="Hidden" Margin="2"/>
</Grid>
<Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF"> <Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF">
<StatusBar> <StatusBar>
<StatusBar.ItemsPanel> <StatusBar.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
@ -96,12 +100,13 @@
</StatusBarItem> </StatusBarItem>
</StatusBar> </StatusBar>
</Grid> </Grid>
<Grid Name="rootContainer">
<TabControl Margin="10" Name="mainFrame"> <TabControl Margin="10" Name="mainFrame">
<TabItem Header="{x:Static p:Resources.textSearch}" Name="tabSearch"> <TabItem Header="{x:Static p:Resources.textSearch}" Name="tabSearch">
</TabItem> </TabItem>
</TabControl> </TabControl>
</DockPanel> </Grid>
</DockPanel>
<!--Rectangle Fill="White" Opacity="0.7" Visibility="{Binding IsWaiting, Converter={StaticResource BoolToHiddenConverter}}" /--> <!--Rectangle Fill="White" Opacity="0.7" Visibility="{Binding IsWaiting, Converter={StaticResource BoolToHiddenConverter}}" /-->
</xctk:BusyIndicator> </xctk:BusyIndicator>

View File

@ -30,6 +30,8 @@ namespace ENI2
#region Fields #region Fields
private bool userAdministrationVisible;
private ReportingPartyControl rpControl;
private bool dbConnected; private bool dbConnected;
private SucheControl sucheControl; private SucheControl sucheControl;
private List<MessageCore> anmeldungen = new List<MessageCore>(); private List<MessageCore> anmeldungen = new List<MessageCore>();
@ -61,10 +63,12 @@ namespace ENI2
App.SplashScreen.ShowMessage("done"); App.SplashScreen.ShowMessage("done");
Thread.Sleep(500); Thread.Sleep(500);
App.SplashScreen.LoadComplete(); App.SplashScreen.LoadComplete();
} }
#endregion #endregion
#region Search related event handler
private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore) private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore)
{ {
if(aMessageCore != null) if(aMessageCore != null)
@ -154,6 +158,8 @@ namespace ENI2
} }
} }
#endregion
#region Window control click event handler #region Window control click event handler
private void logoImage_MouseUp(object sender, MouseButtonEventArgs e) private void logoImage_MouseUp(object sender, MouseButtonEventArgs e)
@ -162,6 +168,31 @@ namespace ENI2
else Process.Start("http://www.eureport.de/"); else Process.Start("http://www.eureport.de/");
} }
private void buttonUserAdmin_Click(object sender, RoutedEventArgs e)
{
if(this.userAdministrationVisible)
{
// user admin control verstecken
this.rootContainer.Children.Remove(rpControl);
this.rootContainer.Children.Add(this.mainFrame);
this.buttonUserAdmin.Content = Properties.Resources.textUserAdministration;
}
else
{
// user admin control anzeigen
this.rootContainer.Children.Remove(this.mainFrame);
if(rpControl == null)
{
rpControl = new ReportingPartyControl();
Dictionary<Guid, ReportingParty> repPartyDict = DBManager.Instance.GetReportingPartyDict();
rpControl.ReportingParties = new List<ReportingParty>(repPartyDict.Values);
}
this.rootContainer.Children.Add(rpControl);
this.buttonUserAdmin.Content = Properties.Resources.textNotifications;
}
this.userAdministrationVisible = !this.userAdministrationVisible; // toggle
}
#endregion #endregion
#region window lifetime event handler #region window lifetime event handler
@ -178,7 +209,7 @@ namespace ENI2
{ {
efMode = true; efMode = true;
logoImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/ef_logo.png")); logoImage.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/ef_logo.png"));
} }
} }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
@ -204,6 +235,7 @@ namespace ENI2
private void Window_SourceInitialized(object sender, EventArgs e) private void Window_SourceInitialized(object sender, EventArgs e)
{ {
this.SetPlacement(Properties.Settings.Default.MainWindowPlacement); this.SetPlacement(Properties.Settings.Default.MainWindowPlacement);
this.textUsername.Focus();
} }
#endregion #endregion
@ -356,6 +388,7 @@ namespace ENI2
this.busyIndicator.IsBusy = false; this.busyIndicator.IsBusy = false;
this.labelStatusBar.Text = string.Format("Rep.Party: {0} {1} [{2}]", this.userEntity.FirstName, this.userEntity.LastName, this.userEntity.Logon); this.labelStatusBar.Text = string.Format("Rep.Party: {0} {1} [{2}]", this.userEntity.FirstName, this.userEntity.LastName, this.userEntity.Logon);
App.UserId = this.userEntity.Id; App.UserId = this.userEntity.Id;
if (this.userEntity.IsAdmin) this.buttonUserAdmin.Visibility = Visibility.Visible;
break; break;
case ReportingParty.LogonResult.FAILED: case ReportingParty.LogonResult.FAILED:
this.labelLoginResult.Content = Properties.Resources.textWrongPassword; this.labelLoginResult.Content = Properties.Resources.textWrongPassword;
@ -377,6 +410,6 @@ namespace ENI2
} }
#endregion #endregion
} }
} }

View File

@ -527,6 +527,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Administrator.
/// </summary>
public static string textAdministrator {
get {
return ResourceManager.GetString("textAdministrator", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Agent. /// Looks up a localized string similar to Agent.
/// </summary> /// </summary>
@ -581,6 +590,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Archived.
/// </summary>
public static string textArchived {
get {
return ResourceManager.GetString("textArchived", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Are you sure?. /// Looks up a localized string similar to Are you sure?.
/// </summary> /// </summary>
@ -2345,6 +2363,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Notifications.
/// </summary>
public static string textNotifications {
get {
return ResourceManager.GetString("textNotifications", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Number of deaths. /// Looks up a localized string similar to Number of deaths.
/// </summary> /// </summary>
@ -2885,6 +2912,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Reporting party.
/// </summary>
public static string textReportingParty {
get {
return ResourceManager.GetString("textReportingParty", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Requested position in port of call. /// Looks up a localized string similar to Requested position in port of call.
/// </summary> /// </summary>
@ -3515,6 +3551,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to User administration.
/// </summary>
public static string textUserAdministration {
get {
return ResourceManager.GetString("textUserAdministration", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Username. /// Looks up a localized string similar to Username.
/// </summary> /// </summary>

View File

@ -1339,4 +1339,19 @@
<data name="textMARPOLItem" xml:space="preserve"> <data name="textMARPOLItem" xml:space="preserve">
<value>MARPOL Annex I item</value> <value>MARPOL Annex I item</value>
</data> </data>
<data name="textNotifications" xml:space="preserve">
<value>Notifications</value>
</data>
<data name="textReportingParty" xml:space="preserve">
<value>Reporting party</value>
</data>
<data name="textUserAdministration" xml:space="preserve">
<value>User administration</value>
</data>
<data name="textAdministrator" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="textArchived" xml:space="preserve">
<value>Archived</value>
</data>
</root> </root>

View File

@ -0,0 +1,65 @@
// Copyright (c) 2017 schick Informatik
// Description: Helper class to convert database byte values to combobox Selected INdex int's
//
using System;
using System.Windows.Data;
using System.Windows.Markup;
namespace ENI2.Util
{
[ValueConversion(typeof(byte?), typeof(int))]
public class ByteConverter : MarkupExtension, IValueConverter
{
#region MarkupExtension implementation
private static ByteConverter _converter = null;
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (_converter == null)
{
_converter = new ByteConverter();
}
return _converter;
}
#endregion
#region IValueConverter implementation
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
int result = -1;
if (value is byte?)
{
if (((byte?)value).HasValue)
{
byte byteVal = (byte)value;
result = (int)byteVal;
}
}
return result;
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
byte? result = null;
if(value is int)
{
if ((int)value >= 0)
{
int intValue = (int)value;
result = (byte)intValue;
}
}
return result;
}
#endregion
}
}

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace ENI2.Util namespace ENI2.Util
{ {
class GlobalStructures static class GlobalStructures
{ {
private static List<string> itemList = null; private static List<string> itemList = null;
@ -92,5 +92,14 @@ namespace ENI2.Util
} }
} }
static bool IsNullable<T>(T obj)
{
if (obj == null) return true; // obvious
Type type = typeof(T);
if (!type.IsValueType) return true; // ref-type
if (Nullable.GetUnderlyingType(type) != null) return true; // Nullable<T>
return false; // value-type
}
} }
} }

View File

@ -0,0 +1,53 @@
// Copyright (c) 2017 schick Informatik
// Description: Helper converter for empty image source
//
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace ENI2.Util
{
public class NullImageConverter : MarkupExtension, IValueConverter
{
#region MarkupExtension implementation
private static NullImageConverter _converter = null;
public override object ProvideValue(IServiceProvider serviceProvider)
{
if (_converter == null)
{
_converter = new NullImageConverter();
}
return _converter;
}
#endregion
#region IValueConverter implementation
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return DependencyProperty.UnsetValue;
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
// According to https://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.convertback(v=vs.110).aspx#Anchor_1
// (kudos Scott Chamberlain), if you do not support a conversion
// back you should return a Binding.DoNothing or a
// DependencyProperty.UnsetValue
return Binding.DoNothing;
// Original code:
// throw new NotImplementedException();
}
#endregion
}
}

BIN
ENI-2/ExcelAltNeu/Alt.xlsx Normal file

Binary file not shown.

Binary file not shown.

BIN
ENI-2/ExcelAltNeu/Neu.xlsx Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,25 @@
<!--
- SystemError: Root Element
|- ErrorAt: Fehlerdatum
|- Meldetype: Meldetyp
|- ReferenceId: HIS-NORD ReferenceId
|- ProcessStatus: 5 = Systemfehler, 6 = Systemfehler wird versucht noch mal zu Senden
|- TransmissionRepeatedAt: Zeit wann erneut versucht wird zu senden (nur relevant bei ProcessStatus = 6)
|- ImportFilename: Dateiname (Herkunft der Daten)
|- VisitId: VisitId (nur relevant bei VisitId)
|- TransitId: TransitId (nur relevant bei TransitId)
|- ErrorCode: Fehlercode
|- ErrorMessage: Fehler Kurzbeschreibung
|- ErrorDescription: Fehler Beschreibung
-->
<SystemError>
<ErrorAt>2017-04-21T09:30:40.109+02:00</ErrorAt>
<Meldetype>MDH</Meldetype>
<ReferenceId>7696</ReferenceId>
<ProcessStatus>5</ProcessStatus>
<ImportFilename>ZZNOK-2017-AVNBEF_TRANSIT.xml</ImportFilename>
<TransitId>ZZNOK-2017-AVNBEF</TransitId>
<ErrorCode>-275</ErrorCode>
<ErrorMessage>Fehler in Feld "MDH_NOTIFIED_LOCODE" (Unlocode) wert=null</ErrorMessage>
<ErrorDescription>Fehler in Feld "MDH_NOTIFIED_LOCODE" (Unlocode) wert=null (Unlocode String - [A-Z]{2}[A-Z0-9]{3})</ErrorDescription>
</SystemError>

View File

@ -0,0 +1,26 @@
<!--
- SystemError: Root Element
|- ErrorAt: Fehlerdatum
|- Meldetype: Meldetyp
|- ReferenceId: HIS-NORD ReferenceId
|- ProcessStatus: 5 = Systemfehler, 6 = Systemfehler wird versucht noch mal zu Senden
|- TransmissionRepeatedAt: Zeit wann erneut versucht wird zu senden (nur relevant bei ProcessStatus = 6)
|- ImportFilename: Dateiname (Herkunft der Daten)
|- VisitId: VisitId (nur relevant bei VisitId)
|- TransitId: TransitId (nur relevant bei TransitId)
|- ErrorCode: Fehlercode
|- ErrorMessage: Fehler Kurzbeschreibung
|- ErrorDescription: Fehler Beschreibung
-->
<SystemError>
<ErrorAt>2017-04-21T09:34:49.208+02:00</ErrorAt>
<Meldetype>ATD</Meldetype>
<ReferenceId>976642</ReferenceId>
<ProcessStatus>6</ProcessStatus>
<TransmissionRepeatedAt>2017-04-21T09:39:49.208+02:00</TransmissionRepeatedAt>
<ImportFilename>DEBRB-2017-SRAJKA_VISIT.xml</ImportFilename>
<VisitId>DEBRB-2017-SRAJKA</VisitId>
<ErrorCode>-560</ErrorCode>
<ErrorMessage>WebServiceException;</ErrorMessage>
<ErrorDescription>WebServiceException (Could not send Message. java.net.ConnectException: ConnectException invoking https://api.national-single-window.de/atd: Verbindungsaufbau abgelehnt invoke);</ErrorDescription>
</SystemError>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="SystemError">
<xs:complexType>
<xs:sequence>
<xs:element name="ErrorAt" type="xs:string" minOccurs="0" />
<xs:element name="Meldetype" type="xs:string" minOccurs="0" />
<xs:element name="ReferenceId" type="xs:string" minOccurs="0" />
<xs:element name="ProcessStatus" type="xs:string" minOccurs="0" />
<xs:element name="TransmissionRepeatedAt" type="xs:string" minOccurs="0" />
<xs:element name="ImportFilename" type="xs:string" minOccurs="0" />
<xs:element name="VisitId" type="xs:string" minOccurs="0" />
<xs:element name="ErrorCode" type="xs:string" minOccurs="0" />
<xs:element name="ErrorMessage" type="xs:string" minOccurs="0" />
<xs:element name="ErrorDescription" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="SystemError" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Serialization;
//
// Dieser Quellcode wurde automatisch generiert von xsd, Version=4.6.1055.0.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class SystemError {
private string errorAtField;
private string meldetypeField;
private string referenceIdField;
private string processStatusField;
private string transmissionRepeatedAtField;
private string importFilenameField;
private string visitIdField;
private string errorCodeField;
private string errorMessageField;
private string errorDescriptionField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorAt {
get {
return this.errorAtField;
}
set {
this.errorAtField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Meldetype {
get {
return this.meldetypeField;
}
set {
this.meldetypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ReferenceId {
get {
return this.referenceIdField;
}
set {
this.referenceIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ProcessStatus {
get {
return this.processStatusField;
}
set {
this.processStatusField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string TransmissionRepeatedAt {
get {
return this.transmissionRepeatedAtField;
}
set {
this.transmissionRepeatedAtField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ImportFilename {
get {
return this.importFilenameField;
}
set {
this.importFilenameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VisitId {
get {
return this.visitIdField;
}
set {
this.visitIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorCode {
get {
return this.errorCodeField;
}
set {
this.errorCodeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorMessage {
get {
return this.errorMessageField;
}
set {
this.errorMessageField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorDescription {
get {
return this.errorDescriptionField;
}
set {
this.errorDescriptionField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class NewDataSet {
private SystemError[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("SystemError")]
public SystemError[] Items {
get {
return this.itemsField;
}
set {
this.itemsField = value;
}
}
}

View File

@ -271,7 +271,7 @@ namespace SendNSWMessageService
// Auf erhaltene Visit-Ids prüfen (HIS-NORD) // Auf erhaltene Visit-Ids prüfen (HIS-NORD)
// TODO // TODO
// bsmd.hisnord.Request.ReadAnswers(); bsmd.hisnord.Response.ReadAnswers();
DBManager.Instance.Disconnect(); DBManager.Instance.Disconnect();

View File

@ -13,6 +13,7 @@ using System.Data.SqlClient;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions;
namespace bsmd.database namespace bsmd.database
{ {
@ -23,12 +24,16 @@ namespace bsmd.database
protected string tablename; protected string tablename;
private Guid instance_id = Guid.NewGuid(); // Comparison id in case entity has not been saved private Guid instance_id = Guid.NewGuid(); // Comparison id in case entity has not been saved
#region enum ValidationBlock
public enum ValidationBlock public enum ValidationBlock
{ {
BLOCK1, BLOCK1,
BLOCK2 BLOCK2
} }
#endregion
#region Properties #region Properties
/// <summary> /// <summary>
@ -153,6 +158,46 @@ namespace bsmd.database
#endregion #endregion
#region public static funcs
/// <summary>
/// Wenn Positionen manuell (ENI-2) angelegt werden, kann mit dieser Funktion der neue "Identifier"
/// festgelegt werden
/// </summary>
/// <param name="sublist">Vorhandene Position</param>
/// <returns>Name des neuen Identifiers, der so nicht in der Liste vorkommt</returns>
public static string GetNewIdentifier(IEnumerable<ISublistElement> sublist)
{
int maxVal = -1;
string maxString = null;
foreach(ISublistElement element in sublist)
{
if (element.Identifier.IsNullOrEmpty()) continue;
int elementIdent;
// TODO: Beim Parsen auch Text- und allerlei bunte Erweiterungen tolerieren
// (z.B. MARPOL-000001)
Regex re = new Regex(@"\d+");
Match m = re.Match(element.Identifier);
if (m.Success)
{
elementIdent = Int32.Parse(m.Value);
if (elementIdent > maxVal)
{
maxVal = elementIdent;
maxString = element.Identifier.Replace(m.Value, (maxVal + 1).ToString());
}
}
}
if (maxVal == -1) return 1.ToString();
return maxString;
}
#endregion
#region IEquatable<T> implementation #region IEquatable<T> implementation
public bool Equals(DatabaseEntity other) public bool Equals(DatabaseEntity other)
@ -177,8 +222,6 @@ namespace bsmd.database
#endregion #endregion
#region IMessageParagraph implementation #region IMessageParagraph implementation
public virtual string Title public virtual string Title

View File

@ -25,6 +25,27 @@ namespace bsmd.database
public enum ReportingPartyTypeEnum public enum ReportingPartyTypeEnum
{ MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS } { MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS }
[Flags]
internal enum UserFlags : int
{
/// <summary>
/// "normaler" Anwender
/// </summary>
NONE = 0,
/// <summary>
/// Dieser Anwender "sieht" die Benutzerverwaltung
/// </summary>
ADMIN = 1,
/// <summary>
/// "gelöschte" Benutzer (inaktiv)
/// </summary>
ARCHIVED = 2,
/// <summary>
/// System-User (Testing, Tool)
/// </summary>
SYSTEM = 4
};
#endregion #endregion
public ReportingParty() public ReportingParty()
@ -101,6 +122,28 @@ namespace bsmd.database
public int Deleted { get; set; } public int Deleted { get; set; }
#region User Properties
public bool IsArchived
{
get { return (this.Flags & (int)UserFlags.ARCHIVED) != 0; }
set { this.SetUserFlag(value, UserFlags.ARCHIVED); }
}
public bool IsSystemUser
{
get { return (this.Flags & (int)UserFlags.SYSTEM) != 0; }
set { this.SetUserFlag(value, UserFlags.SYSTEM); }
}
public bool IsAdmin
{
get { return (this.Flags & (int)UserFlags.ADMIN) != 0; }
set { this.SetUserFlag(value, UserFlags.ADMIN); }
}
#endregion
#endregion #endregion
#endregion #endregion
@ -139,7 +182,7 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (RPName, RPStreetAndNumber, RPPostalCode, RPCity, RPCountry " + scmd.CommandText = string.Format("INSERT INTO {0} (RPName, RPStreetAndNumber, RPPostalCode, RPCity, RPCountry, " +
"RPLastName, RPFirstName, RPPhone, RPFax, RPEMail, Logon, PasswordHash, Salt, Flags, EMail) VALUES " + "RPLastName, RPFirstName, RPPhone, RPFax, RPEMail, Logon, PasswordHash, Salt, Flags, EMail) VALUES " +
"( @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P17 )", this.Tablename); "( @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P17 )", this.Tablename);
} }
@ -207,6 +250,27 @@ namespace bsmd.database
#endregion #endregion
public void SetPassword(string password)
{
using (SHA512 shaM = new SHA512Managed())
{
// first-time logon sets the password
if (this.Salt == null) this.Salt = Guid.NewGuid().ToString();
byte[] hashData = shaM.ComputeHash(Encoding.UTF8.GetBytes(password + this.Salt));
this.PasswordHash = BitConverter.ToString(hashData).Replace("-", "");
}
}
public string GetHash(string password)
{
using (SHA512 shaM = new SHA512Managed())
{
byte[] hashData = shaM.ComputeHash(Encoding.UTF8.GetBytes(password + this.Salt));
string calcPWHash = BitConverter.ToString(hashData).Replace("-", "");
return calcPWHash;
}
}
#region public static methods #region public static methods
public static LogonResult Login(string name, string password, out ReportingParty reportingParty) public static LogonResult Login(string name, string password, out ReportingParty reportingParty)
@ -218,29 +282,25 @@ namespace bsmd.database
Dictionary<Guid, ReportingParty> reportingPartyDict = DBManager.Instance.GetReportingPartyDict(); // passt nicht ganz aber egal Dictionary<Guid, ReportingParty> reportingPartyDict = DBManager.Instance.GetReportingPartyDict(); // passt nicht ganz aber egal
foreach(Guid key in reportingPartyDict.Keys) foreach(Guid key in reportingPartyDict.Keys)
{ {
if(reportingPartyDict[key].Logon.Equals(name)) if (reportingPartyDict[key].Logon.Equals(name))
{ {
// found user // found user
using (SHA512 shaM = new SHA512Managed())
// first-time logon sets the password
if (reportingPartyDict[key].PasswordHash == null)
{ {
// first-time logon sets the password reportingPartyDict[key].SetPassword(password);
if (reportingPartyDict[key].Salt == null) reportingPartyDict[key].Salt = Guid.NewGuid().ToString(); result = LogonResult.OK;
if (reportingPartyDict[key].PasswordHash == null) DBManager.Instance.Save(reportingPartyDict[key]);
{ reportingParty = reportingPartyDict[key];
byte[] hashData = shaM.ComputeHash(Encoding.UTF8.GetBytes(password + reportingPartyDict[key].Salt)); }
reportingPartyDict[key].PasswordHash = BitConverter.ToString(hashData).Replace("-", ""); else // calculate hash from PW
result = LogonResult.OK; {
DBManager.Instance.Save(reportingPartyDict[key]);
reportingParty = reportingPartyDict[key]; string calcPWHash = reportingPartyDict[key].GetHash(password);
} result = reportingPartyDict[key].PasswordHash.Equals(calcPWHash) ? LogonResult.OK : LogonResult.FAILED;
else // calculate hash from PW if (result == LogonResult.OK) reportingParty = reportingPartyDict[key];
{ }
byte[] hashData = shaM.ComputeHash(Encoding.UTF8.GetBytes(password + reportingPartyDict[key].Salt));
string calcPWHash = BitConverter.ToString(hashData).Replace("-", "");
result = reportingPartyDict[key].PasswordHash.Equals(calcPWHash) ? LogonResult.OK : LogonResult.FAILED;
if (result == LogonResult.OK) reportingParty = reportingPartyDict[key];
}
}
} }
} }
@ -249,5 +309,15 @@ namespace bsmd.database
#endregion #endregion
#region private methods
private void SetUserFlag(bool value, UserFlags flag)
{
if (value) this.Flags |= (int)flag;
else this.Flags &= (int)~flag;
}
#endregion
} }
} }

View File

@ -1376,7 +1376,7 @@ namespace bsmd.hisnord
#region serialize and save message #region serialize and save message
string filename = string.Format("{0}-{1}.xml", DateTime.Now.ToString("yyyyMMddHHmmss"), messages[0].MessageCore.Id.Value); string filename = string.Format("BSMD_{0}-{1}.xml", DateTime.Now.ToString("yyyyMMddHHmmss"), messages[0].MessageCore.Id.Value);
_log.InfoFormat("saving {0} to output directory", filename); _log.InfoFormat("saving {0} to output directory", filename);
string filePath = Path.Combine(Properties.Settings.Default.OutputDir, filename); string filePath = Path.Combine(Properties.Settings.Default.OutputDir, filename);
@ -1422,81 +1422,7 @@ namespace bsmd.hisnord
} }
return retval; return retval;
} }
#region ReadAnswers()
public static void ReadAnswers()
{
foreach (string answerFile in Directory.GetFiles(Properties.Settings.Default.AnswerDir))
{
VisitId aVisitId = VisitId.ReadVisitId(answerFile);
if (aVisitId != null)
{
_log.InfoFormat("HIS-NORD: Visit-ID {0} delivered for Core {1}", aVisitId.Value, aVisitId.MessageCoreId);
// update MessageCore
if (aVisitId.MessageCoreId.HasValue)
{
MessageCore answerCore = DBManager.Instance.GetMessageCoreById(aVisitId.MessageCoreId.Value);
if (answerCore == null)
{
_log.WarnFormat("HIS-NORD: Core not found for conveyance code {0}", aVisitId.ConveyanceCode);
}
else {
if (!answerCore.IsTransit)
answerCore.VisitId = aVisitId.Value;
else
answerCore.TransitId = aVisitId.Value;
answerCore.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED;
DBManager.Instance.Save(answerCore);
}
}
else
{
_log.WarnFormat("{0} ANSWER parsed, but MessageCoreId is no Guid: {1}",
Path.GetFileName(answerFile),
aVisitId.ConveyanceCode);
}
// archive file
File.Move(answerFile, Path.Combine(Properties.Settings.Default.AnswerArchiveDir, Path.GetFileName(answerFile)));
}
else
{
TransitId aTransitId = TransitId.ReadTransitId(answerFile);
if (aTransitId != null)
{
_log.InfoFormat("HIS-NORD: Transit-ID {0} delivered for Core {1}", aTransitId.Value, aTransitId.MessageCoreId);
// update MessageCore
if (aTransitId.MessageCoreId.HasValue)
{
MessageCore answerCore = DBManager.Instance.GetMessageCoreById(aTransitId.MessageCoreId.Value);
if (answerCore == null)
{
_log.WarnFormat("HIS-NORD: Core not found for conveyance code {0}", aTransitId.ConveyanceCode);
}
else {
if (!answerCore.IsTransit)
answerCore.VisitId = aTransitId.Value;
else
answerCore.TransitId = aTransitId.Value;
answerCore.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED;
DBManager.Instance.Save(answerCore);
}
}
else
{
_log.WarnFormat("{0} ANSWER parsed, but MessageCoreId is no Guid: {1}",
Path.GetFileName(answerFile),
aTransitId.ConveyanceCode);
}
// archive file
File.Move(answerFile, Path.Combine(Properties.Settings.Default.AnswerArchiveDir, Path.GetFileName(answerFile)));
}
}
}
}
#endregion
#region helper class to fill HAZ positions #region helper class to fill HAZ positions

View File

@ -0,0 +1,106 @@
using bsmd.database;
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
namespace bsmd.hisnord
{
public class Response
{
private static ILog _log = LogManager.GetLogger(typeof(Response));
public static void ReadAnswers()
{
foreach (string answerFile in Directory.GetFiles(Properties.Settings.Default.AnswerDir))
{
// TODO: klären was man hier liest: reguläre Antwort oder Schnittstellenfehler
VisitIdResponse visitIdResponse = ReadVisitId(answerFile);
if (visitIdResponse != null)
{
_log.InfoFormat("HIS-NORD: Visit-ID {0} delivered for Core {1}", visitIdResponse.VisitId, visitIdResponse.ClientRequestId);
// update MessageCore
if (visitIdResponse.ClientRequestId != null)
{
Guid messageCoreId;
if (Guid.TryParse(visitIdResponse.ClientRequestId, out messageCoreId))
{
MessageCore answerCore = DBManager.Instance.GetMessageCoreById(messageCoreId);
if (answerCore == null)
{
_log.WarnFormat("HIS-NORD: Core not found for notification id {0}", visitIdResponse.NotificationId);
}
else
{
if (!answerCore.IsTransit)
answerCore.VisitId = visitIdResponse.VisitId;
else
answerCore.TransitId = visitIdResponse.VisitId;
answerCore.BSMDStatusInternal = MessageCore.BSMDStatus.RESPONDED;
DBManager.Instance.Save(answerCore);
}
}
else
{
_log.WarnFormat("{0} ANSWER parsed, but MessageCoreId is no Guid: {1}",
Path.GetFileName(answerFile), visitIdResponse.ClientRequestId);
}
}
else
{
_log.WarnFormat("Client request id is null in {0}", answerFile);
}
// archive file
File.Move(answerFile, Path.Combine(Properties.Settings.Default.AnswerArchiveDir, Path.GetFileName(answerFile)));
}
}
}
internal static VisitIdResponse ReadVisitId (string filename)
{
VisitIdResponse visitIdResponse = null;
try
{
XmlSerializer serializer = new XmlSerializer(typeof(bsmd.hisnord.dataset));
using (FileStream fs = new FileStream(filename, FileMode.Open))
{
// aus dem Gewühl die Antwort fischen..
dataset aDataSet = (dataset)serializer.Deserialize(fs);
if (aDataSet != null)
{
for (int i = 0; i < aDataSet.Items.Length; i++)
{
if (aDataSet.Items[i] is Envelope)
{
Envelope anEnvelope = (Envelope)aDataSet.Items[i];
if (anEnvelope.Body.Length > 0)
{
visitIdResponse = anEnvelope.Body[0].VisitIdResponse;
break;
}
}
}
}
}
}
catch (Exception ex)
{
_log.ErrorFormat("Exception occurred during deserialization: {0}", ex.Message);
}
return visitIdResponse;
}
}
}

View File

@ -0,0 +1,217 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Serialization;
//
// Dieser Quellcode wurde automatisch generiert von xsd, Version=4.6.1055.0.
//
namespace bsmd.hisnord
{
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class SystemError
{
private string errorAtField;
private string meldetypeField;
private string referenceIdField;
private string processStatusField;
private string transmissionRepeatedAtField;
private string importFilenameField;
private string visitIdField;
private string errorCodeField;
private string errorMessageField;
private string errorDescriptionField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorAt
{
get
{
return this.errorAtField;
}
set
{
this.errorAtField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Meldetype
{
get
{
return this.meldetypeField;
}
set
{
this.meldetypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ReferenceId
{
get
{
return this.referenceIdField;
}
set
{
this.referenceIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ProcessStatus
{
get
{
return this.processStatusField;
}
set
{
this.processStatusField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string TransmissionRepeatedAt
{
get
{
return this.transmissionRepeatedAtField;
}
set
{
this.transmissionRepeatedAtField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ImportFilename
{
get
{
return this.importFilenameField;
}
set
{
this.importFilenameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VisitId
{
get
{
return this.visitIdField;
}
set
{
this.visitIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorCode
{
get
{
return this.errorCodeField;
}
set
{
this.errorCodeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorMessage
{
get
{
return this.errorMessageField;
}
set
{
this.errorMessageField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ErrorDescription
{
get
{
return this.errorDescriptionField;
}
set
{
this.errorDescriptionField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class NewDataSet
{
private SystemError[] itemsField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("SystemError")]
public SystemError[] Items
{
get
{
return this.itemsField;
}
set
{
this.itemsField = value;
}
}
}
}

View File

@ -59,6 +59,7 @@
<Link>Properties\AssemblyProjectKeyInfo.cs</Link> <Link>Properties\AssemblyProjectKeyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="his-nord.cs" /> <Compile Include="his-nord.cs" />
<Compile Include="nsw_response.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs"> <Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -66,6 +67,8 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
</Compile> </Compile>
<Compile Include="Request.cs" /> <Compile Include="Request.cs" />
<Compile Include="Response.cs" />
<Compile Include="SystemError.cs" />
<Compile Include="TransitId.cs" /> <Compile Include="TransitId.cs" />
<Compile Include="transmitter.cs" /> <Compile Include="transmitter.cs" />
<Compile Include="VisitId.cs" /> <Compile Include="VisitId.cs" />

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,9 @@
Neue Version (Stand 11.4.2017) mit einzelnen Meldeklassen Ergänzung Rückkanal (26.7.17)
Da wir keine XSD bekommen aus dem Beispiel-XML per xsd.exe bla.xml -> xsd.exe bla.xsd /classes -> bla.cs generiert.
Ich habe dann die Klassen hinzugefügt und mit dem bsmd.hisnord Namespace dekoriert.
Neue Version (Stand 11.4.2017) mit einzelnen Meldeklassen
Alle Informationen aus den E-Mails hier zusammengetragen: Alle Informationen aus den E-Mails hier zusammengetragen: