Version 2.3.6.13:

Highlighting erster Ansatz, immer weitere Korrekturen rund um HIS-Nord Versand
This commit is contained in:
Daniel Schick 2017-08-24 16:54:40 +00:00
parent 551ecb3332
commit a9594e7702
41 changed files with 778 additions and 114 deletions

View File

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

View File

@ -0,0 +1,89 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ENI2">
<ControlTemplate x:Key="groupBoxTemplateError" TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="6" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="6" />
</Grid.RowDefinitions>
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="4,4,4,4" BorderBrush="#00FFFFFF" Background="{TemplateBinding Panel.Background}" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="4" Grid.RowSpan="3" />
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="4,4,4,4" BorderBrush="#FFFFFFFF" OpacityMask="{x:Null}" Grid.Row="1" Grid.ColumnSpan="4" Grid.RowSpan="3">
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="3,3,3,3" BorderBrush="{TemplateBinding Border.BorderBrush}">
<Border Background="#FFFFDDDD" BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="2,2,2,2" BorderBrush="#FFFFFFFF" />
</Border>
</Border>
<Border Padding="3,0,3,0" Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Background="#FFFFBBBB" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3" >
<ContentPresenter RecognizesAccessKey="True" Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" ContentStringFormat="{TemplateBinding HeaderedContentControl.HeaderStringFormat}" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" Margin="{TemplateBinding Control.Padding}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" />
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="groupBoxTemplateViolation" TargetType="{x:Type GroupBox}">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="6" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="6" />
</Grid.RowDefinitions>
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="4,4,4,4" BorderBrush="#00FFFFFF" Background="{TemplateBinding Panel.Background}" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="4" Grid.RowSpan="3" />
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="4,4,4,4" BorderBrush="#FFFFFF00" OpacityMask="{x:Null}" Grid.Row="1" Grid.ColumnSpan="4" Grid.RowSpan="3">
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="3,3,3,3" BorderBrush="{TemplateBinding Border.BorderBrush}">
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" CornerRadius="2,2,2,2" BorderBrush="#FFFFFFDD" />
</Border>
</Border>
<Border Padding="3,1,3,0" Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Background="#FFFFFFAA" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3">
<ContentPresenter RecognizesAccessKey="True" Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" ContentStringFormat="{TemplateBinding HeaderedContentControl.HeaderStringFormat}" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" Margin="{TemplateBinding Control.Padding}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" />
</Grid>
</ControlTemplate>
<Style TargetType="{x:Type ToolTip}" >
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="HasDropShadow" Value="True" />
<!--Setter Property="Foreground" Value="White" /-->
<Setter Property="FontSize" Value="14" />
<Setter Property="Placement" Value="Mouse" />
<!--Setter Property="VerticalOffset" Value="0" /-->
<Setter Property="Padding" Value="8" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToolTip}" >
<Border Name="Border" BorderThickness="1.5" CornerRadius="3"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}">
<Border.Background>
<SolidColorBrush Color="#FFF8F8EE" />
</Border.Background>
<Border.BorderBrush>
<SolidColorBrush Color="#FF888888" />
</Border.BorderBrush>
<ContentPresenter Margin="4" HorizontalAlignment="Left" VerticalAlignment="Top" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@ -0,0 +1,27 @@
// Copyright (c) 2017 schick Informatik
// Description: Interface für eine gemeinsame Basis von EditWindowBase und
// DetailBaseControl. Beide müssen auf externe Änderungen am Highlighting reagieren
// können und das mögliche Highlighting ihrer Controls abfragen können.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using bsmd.database;
using ENI2.Util;
namespace ENI2.Controls
{
public interface IHighlightControlContainer
{
void HighlightErrorMessageContainer();
void HighlightViolationMessageContainer();
void HighlightProperty(Message theMessage, string propertyName, string identifier, HighlightService.HighlightStyle style);
}
}

View File

@ -9,10 +9,11 @@ using System.Windows.Controls;
using bsmd.database;
using System.ComponentModel;
using ENI2.Util;
using ENI2.Controls;
namespace ENI2
{
public class DetailBaseControl : UserControl
public class DetailBaseControl : UserControl, IHighlightControlContainer
{
#region Fields
@ -224,6 +225,24 @@ namespace ENI2
#endregion
#region IHighlightControlContainer implementation
public virtual void HighlightErrorMessageContainer()
{
//throw new NotImplementedException();
}
public virtual void HighlightViolationMessageContainer()
{
//throw new NotImplementedException();
}
public virtual void HighlightProperty(Message theMessage, string propertyName, string identifier, HighlightService.HighlightStyle style)
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@ -29,6 +29,7 @@ namespace ENI2
private Dictionary<string, DetailBaseControl> controlCache = new Dictionary<string, DetailBaseControl>();
private Guid userId = Guid.NewGuid(); // remove THIS!!
private object messageListLock = new object();
private HighlightService highlightService = new HighlightService();
#endregion
@ -141,6 +142,7 @@ namespace ENI2
// Control has been created before: Set visibility of "save" button:
bool hasDirtyMessages = false;
DetailBaseControl dbc = controlCache[mg.MessageGroupName];
foreach (Message message in dbc.ControlMessages)
if (message.IsDirty)
hasDirtyMessages = true;
@ -149,6 +151,11 @@ namespace ENI2
// plug it in ;-)
detailView.Children.Clear();
// zuerst Vio dann Error
controlCache[mg.MessageGroupName].HighlightViolationMessageContainer();
controlCache[mg.MessageGroupName].HighlightErrorMessageContainer();
detailView.Children.Add(controlCache[mg.MessageGroupName]);
}
}
@ -181,8 +188,13 @@ namespace ENI2
{
if (message.IsDirty)
{
if ((message.Status == Message.MessageStatus.ACCEPTED) && (message.InternalStatus == Message.BSMDStatus.CONFIRMED))
if ((message.Status == Message.MessageStatus.ACCEPTED) &&
((message.InternalStatus == Message.BSMDStatus.CONFIRMED) || (message.InternalStatus == Message.BSMDStatus.VIOLATION)))
message.InternalStatus = Message.BSMDStatus.UPDATED;
string userName = "?";
if (this.LockedBy != null)
userName = this.LockedBy.Logon;
message.ChangedBy = string.Format("{0} at {1}", userName, DateTime.Now);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
@ -230,7 +242,7 @@ namespace ENI2
}
else
{
// locking failed: Notify User
// TODO: locking failed: Notify User
}
}

View File

@ -6,6 +6,7 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using System.Windows.Media;
namespace ENI2.DetailViewControls
{
@ -211,5 +212,25 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._ataMessage.HasErrors) this.ataGroupBox.BorderBrush = Brushes.Red;
if (this._bkraMessage.HasErrors) this.bkraGroupBox.BorderBrush = Brushes.Red;
if (this._pobaMessage.HasErrors) this.pobaGroupBox.BorderBrush = Brushes.Red;
if (this._tiefaMessage.HasErrors) this.tiefaGroupBox.BorderBrush = Brushes.Red;
}
public override void HighlightViolationMessageContainer()
{
if (this._ataMessage.HasViolations) this.ataGroupBox.BorderBrush = Brushes.Yellow;
if (this._bkraMessage.HasViolations) this.bkraGroupBox.BorderBrush = Brushes.Yellow;
if (this._pobaMessage.HasViolations) this.pobaGroupBox.BorderBrush = Brushes.Yellow;
if (this._tiefaMessage.HasViolations) this.tiefaGroupBox.BorderBrush = Brushes.Yellow;
}
#endregion
}
}

View File

@ -469,5 +469,30 @@ namespace ENI2.DetailViewControls
}
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._bpolMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxBorderPolice, HighlightService.HighlightStyle.ERROR, this._bpolMessage);
if (this._crewMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxCrewList, HighlightService.HighlightStyle.ERROR, this._crewMessage);
if (this._pasMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxPassengerList, HighlightService.HighlightStyle.ERROR, this._pasMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._bpolMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxBorderPolice, HighlightService.HighlightStyle.VIOLATION, this._bpolMessage);
if (this._crewMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxCrewList, HighlightService.HighlightStyle.VIOLATION, this._crewMessage);
if (this._pasMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxPassengerList, HighlightService.HighlightStyle.VIOLATION, this._pasMessage);
}
#endregion
}
}

View File

@ -490,5 +490,23 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._hazMessage.HasErrors)
{
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.ERROR, this._hazMessage);
}
}
public override void HighlightViolationMessageContainer()
{
if (this._hazMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.VIOLATION, this._hazMessage);
}
#endregion
}
}

View File

@ -6,6 +6,7 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
namespace ENI2.DetailViewControls
{
@ -210,5 +211,39 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._atdMessage.HasErrors)
HighlightService.HighlightControl(this.atdGroupBox, HighlightService.HighlightStyle.ERROR, this._atdMessage);
if (this._tiefdMessage.HasErrors)
HighlightService.HighlightControl(this.tiefdGroupBox, HighlightService.HighlightStyle.ERROR, this._tiefdMessage);
if (this._pobdMessage.HasErrors)
HighlightService.HighlightControl(this.pobdGroupBox, HighlightService.HighlightStyle.ERROR, this._pobdMessage);
if (this._bkrdMessage.HasErrors)
HighlightService.HighlightControl(this.bkrdGroupBox, HighlightService.HighlightStyle.ERROR, this._bkrdMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._atdMessage.HasViolations)
HighlightService.HighlightControl(this.atdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._atdMessage);
if (this._tiefdMessage.HasViolations)
HighlightService.HighlightControl(this.tiefdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._tiefdMessage);
if (this._pobdMessage.HasViolations)
HighlightService.HighlightControl(this.pobdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._pobdMessage);
if (this._bkrdMessage.HasViolations)
HighlightService.HighlightControl(this.bkrdGroupBox, HighlightService.HighlightStyle.VIOLATION, this._bkrdMessage);
}
#endregion
}
}

View File

@ -12,7 +12,7 @@
d:DesignHeight="600" d:DesignWidth="1024">
<TabControl Margin="10" Name="mainFrame">
<TabItem Header="{x:Static p:Resources.textMaritimeHealthDeclaration}" Name="tabMaritimeHealthDeclaration">
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textMDH}">
<GroupBox Name="mdhGroupBox" Header="{x:Static p:Resources.textMDH}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />

View File

@ -5,7 +5,7 @@
using System.Windows;
using System.Windows.Controls;
using ENI2.EditControls;
using ENI2.Util;
using bsmd.database;
@ -77,7 +77,7 @@ namespace ENI2.DetailViewControls
#endregion
this.portCallGroupBox.DataContext = mdh;
this.mdhGroupBox.DataContext = mdh;
this._mdh = mdh;
this.dataGridPortOfCallLast30Days.Initialize();
@ -169,7 +169,9 @@ namespace ENI2.DetailViewControls
this.textBoxPlaceOfIssue.IsEnabled = !simplified;
this.textBoxStowawaysJoiningLocation.IsEnabled = !simplified;
this.integerUpDownNumberOfDeaths.IsEnabled = !simplified;
this.integerUpDownNumberOfDeaths.IsReadOnly = simplified;
this.integerUpDownNumberOfIllPersons.IsEnabled = !simplified;
this.integerUpDownNumberOfIllPersons.IsReadOnly = simplified;
}
@ -411,5 +413,23 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._mdhMessage.HasErrors)
{
HighlightService.HighlightControl(this.mdhGroupBox, HighlightService.HighlightStyle.ERROR, this._mdhMessage);
}
}
public override void HighlightViolationMessageContainer()
{
if (this._mdhMessage.HasViolations)
HighlightService.HighlightControl(this.mdhGroupBox, HighlightService.HighlightStyle.VIOLATION, this._mdhMessage);
}
#endregion
}
}

View File

@ -160,7 +160,7 @@
<DataTemplate>
<Image x:Name="imageHasUpdate"/>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=HasUpdate}" Value="True">
<DataTrigger Binding="{Binding Path=HasUpdates}" Value="True">
<Setter Property="Source" Value="/Resources/recycle.png" TargetName="imageHasUpdate"/>
</DataTrigger>
</DataTemplate.Triggers>
@ -186,13 +186,6 @@
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding InternalStatus}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textReceivedAt}" Binding="{Binding ReceivedAt}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
@ -200,7 +193,21 @@
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.5*">
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding InternalStatus}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatusInfo}" Binding="{Binding StatusInfo}" IsReadOnly="True" Width="0.3*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.3*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>

View File

@ -376,12 +376,14 @@ namespace ENI2.DetailViewControls
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
selectedMessage.StatusInfo = string.Format(Properties.Resources.textMessageSentAt, DateTime.Now);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(selectedMessage);
}
// komplette Anmeldung auf "zu versenden" stellen
this.Core.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND;
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
this.dataGridMessages.Items.Refresh();
}
}
@ -393,12 +395,15 @@ namespace ENI2.DetailViewControls
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
selectedMessage.Reset = true;
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
selectedMessage.StatusInfo = string.Format(Properties.Resources.textMessageResetAt, DateTime.Now);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(selectedMessage);
}
// komplette Anmeldung auf "zu versenden" stellen
this.Core.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND;
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
this.dataGridMessages.Items.Refresh();
}
}

View File

@ -5,7 +5,7 @@
using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
namespace ENI2.DetailViewControls
{
@ -99,6 +99,23 @@ namespace ENI2.DetailViewControls
}
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._pre72hMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxPre72H, HighlightService.HighlightStyle.ERROR, this._pre72hMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._pre72hMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxPre72H, HighlightService.HighlightStyle.VIOLATION, this._pre72hMessage);
}
#endregion
}
}

View File

@ -7,6 +7,7 @@ using System.Windows.Controls;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
namespace ENI2.DetailViewControls
{
@ -168,5 +169,36 @@ namespace ENI2.DetailViewControls
this.SublistElementChanged(Message.NotificationClass.NOA_NOD);
}
}
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._noa_nod.MessageHeader.HasErrors)
{
HighlightService.HighlightControl(this.portCallGroupBox, HighlightService.HighlightStyle.ERROR, this._noa_nod.MessageHeader);
}
if (this._agnt.MessageHeader.HasErrors)
{
HighlightService.HighlightControl(this.agentGroupBox, HighlightService.HighlightStyle.ERROR, this._agnt.MessageHeader);
}
}
public override void HighlightViolationMessageContainer()
{
if (this._noa_nod.MessageHeader.HasViolations)
{
HighlightService.HighlightControl(this.portCallGroupBox, HighlightService.HighlightStyle.VIOLATION, this._noa_nod.MessageHeader);
}
if (this._agnt.MessageHeader.HasViolations)
{
HighlightService.HighlightControl(this.agentGroupBox, HighlightService.HighlightStyle.VIOLATION, this._agnt.MessageHeader);
}
}
#endregion
}
}

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using ENI2.EditControls;
using ENI2.Util;
using bsmd.database;
@ -240,5 +240,34 @@ namespace ENI2.DetailViewControls
{
this.DataGridSERV_CreateRequested();
}
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._nameMessage.HasErrors)
HighlightService.HighlightControl(this.nameGroupBox, HighlightService.HighlightStyle.ERROR, this._nameMessage);
if (this._infoMessage.HasErrors)
HighlightService.HighlightControl(this.infoGroupBox, HighlightService.HighlightStyle.ERROR, this._infoMessage);
if (this._servMessage.HasErrors)
HighlightService.HighlightControl(this.servGroupBox, HighlightService.HighlightStyle.ERROR, this._servMessage);
if (this._ladgMessage.HasErrors)
HighlightService.HighlightControl(this.ladgGroupBox, HighlightService.HighlightStyle.ERROR, this._ladgMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._nameMessage.HasViolations)
HighlightService.HighlightControl(this.nameGroupBox, HighlightService.HighlightStyle.VIOLATION, this._nameMessage);
if (this._infoMessage.HasViolations)
HighlightService.HighlightControl(this.infoGroupBox, HighlightService.HighlightStyle.VIOLATION, this._infoMessage);
if (this._servMessage.HasViolations)
HighlightService.HighlightControl(this.servGroupBox, HighlightService.HighlightStyle.VIOLATION, this._servMessage);
if (this._ladgMessage.HasViolations)
HighlightService.HighlightControl(this.ladgGroupBox, HighlightService.HighlightStyle.VIOLATION, this._ladgMessage);
}
#endregion
}
}

View File

@ -13,7 +13,7 @@
d:DesignHeight="600" d:DesignWidth="1024">
<TabControl Margin="10" Name="mainFrame">
<TabItem Header="{x:Static p:Resources.textSecurityNotification}" Name="tabSecurityNotification">
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textSEC}">
<GroupBox Name="secGroupBox" Header="{x:Static p:Resources.textSEC}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />

View File

@ -5,8 +5,9 @@
using System.Windows;
using System.Windows.Controls;
using ENI2.EditControls;
using ENI2.Util;
using bsmd.database;
using System.Windows.Data;
using System;
@ -65,7 +66,7 @@ namespace ENI2.DetailViewControls
_secMessage.Elements.Add(sec);
}
this.portCallGroupBox.DataContext = sec;
this.secGroupBox.DataContext = sec;
this._sec = sec;
this.comboBoxCurrentShipSecurityLevel.ItemsSource = Util.GlobalStructures.ShipSecurityLevels;
@ -299,5 +300,22 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._secMessage.HasErrors)
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.ERROR, this._secMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._secMessage.HasViolations)
HighlightService.HighlightControl(this.secGroupBox, HighlightService.HighlightStyle.VIOLATION, this._secMessage);
}
#endregion
}
}

View File

@ -10,7 +10,7 @@
xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.textShipData}">
<GroupBox Name="shipDataGroupBox" Header="{x:Static p:Resources.textShipData}" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="210" />

View File

@ -6,6 +6,8 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using System.Windows.Media;
using ENI2.Util;
namespace ENI2.DetailViewControls
{
@ -84,5 +86,24 @@ namespace ENI2.DetailViewControls
#endregion
}
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._statMessage.HasErrors)
{
HighlightService.HighlightControl(this.shipDataGroupBox, HighlightService.HighlightStyle.ERROR, this._statMessage);
}
}
public override void HighlightViolationMessageContainer()
{
if (this._statMessage.HasViolations)
HighlightService.HighlightControl(this.shipDataGroupBox, HighlightService.HighlightStyle.VIOLATION, this._statMessage);
}
#endregion
}
}

View File

@ -6,6 +6,7 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using ENI2.Util;
namespace ENI2.DetailViewControls
{
@ -216,5 +217,26 @@ namespace ENI2.DetailViewControls
{
this.DataGridTowageOnArrival_CreateRequested();
}
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._towaMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxTowageOnArrival, HighlightService.HighlightStyle.ERROR, this._towaMessage);
if (this._towdMessage.HasErrors)
HighlightService.HighlightControl(this.groupBoxTowageOnDeparture, HighlightService.HighlightStyle.ERROR, this._towdMessage);
}
public override void HighlightViolationMessageContainer()
{
if (this._towaMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxTowageOnArrival, HighlightService.HighlightStyle.VIOLATION, this._towaMessage);
if (this._towdMessage.HasViolations)
HighlightService.HighlightControl(this.groupBoxTowageOnDeparture, HighlightService.HighlightStyle.VIOLATION, this._towdMessage);
}
#endregion
}
}

View File

@ -11,7 +11,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textWaste}">
<GroupBox Name="wasGroupBox" Header="{x:Static p:Resources.textWaste}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220" />

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using ENI2.EditControls;
using ENI2.Util;
using bsmd.database;
namespace ENI2.DetailViewControls
@ -71,7 +71,7 @@ namespace ENI2.DetailViewControls
_wasMessage.Elements.Add(was);
}
this.portCallGroupBox.DataContext = was;
this.wasGroupBox.DataContext = was;
this._was = was;
this.dataGridWaste.Initialize();
@ -159,5 +159,23 @@ namespace ENI2.DetailViewControls
#endregion
#region Highlighting
public override void HighlightErrorMessageContainer()
{
if (this._wasMessage.HasErrors)
{
HighlightService.HighlightControl(this.wasGroupBox, HighlightService.HighlightStyle.ERROR, this._wasMessage);
}
}
public override void HighlightViolationMessageContainer()
{
if (this._wasMessage.HasViolations)
HighlightService.HighlightControl(this.wasGroupBox, HighlightService.HighlightStyle.VIOLATION, this._wasMessage);
}
#endregion
}
}

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>3.6.12.%2a</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.6.13.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -168,6 +168,7 @@
<Compile Include="Controls\ClosableTabItem.cs" />
<Compile Include="Controls\EditWindowBase.cs" />
<Compile Include="Controls\ENIDataGrid.cs" />
<Compile Include="Controls\IHighlightControlContainer.cs" />
<Compile Include="Controls\LocodeControl.xaml.cs">
<DependentUpon>LocodeControl.xaml</DependentUpon>
</Compile>
@ -309,6 +310,7 @@
<Compile Include="Util\ByteConverter.cs" />
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
<Compile Include="Util\GlobalStructures.cs" />
<Compile Include="Util\HighlightService.cs" />
<Compile Include="Util\InverseBooleanConverter.cs" />
<Compile Include="Util\NullImageConverter.cs" />
<Compile Include="Util\UtcToLocalDateTimeConverter.cs" />
@ -328,6 +330,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControlTemplates.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DetailRootControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -19,7 +19,14 @@
CanExecute="CanExecuteClearCommand" />
</Window.CommandBindings>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="ControlTemplates.xaml">
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<util:BoolToVisibilityConverter x:Key="BoolToHiddenConverter" TrueValue="Visible" FalseValue="Hidden" />
</ResourceDictionary>
</Window.Resources>
<xctk:BusyIndicator Name="busyIndicator" IsBusy="True">

View File

@ -2405,6 +2405,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Message reset at {0}.
/// </summary>
public static string textMessageResetAt {
get {
return ResourceManager.GetString("textMessageResetAt", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Message sent at {0}.
/// </summary>
public static string textMessageSentAt {
get {
return ResourceManager.GetString("textMessageSentAt", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MMSI number.
/// </summary>
@ -3467,6 +3485,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Status info.
/// </summary>
public static string textStatusInfo {
get {
return ResourceManager.GetString("textStatusInfo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Stern thruster power.
/// </summary>

View File

@ -1417,4 +1417,13 @@
<data name="textVisitTransitAlreadyInDatabase" xml:space="preserve">
<value>A data record with this Visit / TransitId is already in the database!</value>
</data>
<data name="textMessageResetAt" xml:space="preserve">
<value>Message reset at {0}</value>
</data>
<data name="textMessageSentAt" xml:space="preserve">
<value>Message sent at {0}</value>
</data>
<data name="textStatusInfo" xml:space="preserve">
<value>Status info</value>
</data>
</root>

View File

@ -0,0 +1,134 @@
// Copyright (c) 2017 schick Informatik
// Description: Diese Klasse steuert zentral hervorgehobene Controls. Diese können auf unterschiedliche(!) Art
// hervorgehoben sein: NSW Error / NSW Violation / Rule Fehler / Reminder
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using bsmd.database;
namespace ENI2.Util
{
public class HighlightService
{
private static ControlTemplate groupBoxDefaultTemplate;
#region Construction
public HighlightService()
{
}
#endregion
#region enums
public enum HighlightStyle
{
NONE,
VALIDATION,
UPDATE,
REMINDER,
ERROR,
VIOLATION
}
#endregion
#region events
public delegate void HighlightChangeNotificationHandler(Message relevantMessage, DatabaseEntity subElement, string identifier);
public event HighlightChangeNotificationHandler PropertyHighlightingChanged;
#endregion
#region public methods
public ControlTemplate GetStyle(string propertyName, object control)
{
ControlTemplate resultTemplate = null;
return resultTemplate;
}
public bool MessageHasViolations(Message theMessage)
{
return !theMessage.ViolationList.IsNullOrEmpty();
}
public bool MessageHasErrors(Message theMessage)
{
return !theMessage.ErrorList.IsNullOrEmpty();
}
#endregion
#region public static methods
public static void HighlightControl(object control, HighlightStyle highlightStyle, Message theMessage)
{
if(control is GroupBox)
{
GroupBox gp = (GroupBox)control;
if (groupBoxDefaultTemplate == null) // save for restore
groupBoxDefaultTemplate = gp.Template;
switch (highlightStyle)
{
case HighlightStyle.ERROR:
{
StringBuilder sb = new StringBuilder();
foreach (MessageError me in theMessage.ErrorList)
sb.AppendFormat("{0}: {1}\n", me.ErrorCode, me.ErrorText);
gp.ToolTip = sb.ToString();
gp.Template = Application.Current.MainWindow.TryFindResource("groupBoxTemplateError") as ControlTemplate;
}
break;
case HighlightStyle.VIOLATION:
{
StringBuilder sb = new StringBuilder();
foreach (MessageViolation mv in theMessage.ViolationList)
sb.AppendFormat("{0}: {1}\n", mv.ViolationCode, mv.ViolationText);
gp.ToolTip = sb.ToString();
gp.Template = Application.Current.MainWindow.FindResource("groupBoxTemplateViolation") as ControlTemplate;
}
break;
default:
gp.Template = groupBoxDefaultTemplate;
gp.ToolTip = null;
break;
}
}
}
#endregion
#region internal / private methods
protected void OnPropertyHighlightingChanged()
{
}
#endregion
}
}

BIN
ENI-2/data/crew_import.xlsx Normal file

Binary file not shown.

BIN
ENI-2/data/pas_import.xlsx Normal file

Binary file not shown.

Binary file not shown.

View File

@ -127,6 +127,8 @@ public partial class nsw {
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class conveyance {
private string codeField;
private object[] itemsField;
private ItemsChoiceType[] itemsElementNameField;
@ -137,6 +139,17 @@ public partial class conveyance {
private Items1ChoiceType[] items1ElementNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string code {
get {
return this.codeField;
}
set {
this.codeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("ENINumber", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("ETAPortOfCall", typeof(System.DateTime), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
@ -144,7 +157,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("PortOfCall", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("TransitId", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("VisitId", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("code", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("name", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
public object[] Items {
@ -280,9 +292,6 @@ public enum ItemsChoiceType {
/// <remarks/>
VisitId,
/// <remarks/>
code,
/// <remarks/>
name,
}
@ -1913,7 +1922,8 @@ public partial class portofcallmdh {
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShip", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute("PortOfCallLast30DaysCrewJoinedShipName", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public string[] PortOfCallLast30DaysCrewJoinedShip {
get {
return this.portOfCallLast30DaysCrewJoinedShipField;

View File

@ -36,12 +36,13 @@
<xs:complexType name="conveyance">
<xs:sequence>
<xs:element name="code" type="string1-99-type"/>
<xs:choice id="visit">
<xs:element name="VisitId" type="visitid-type"/>
<xs:element name="TransitId" type="transitid-type"/>
<xs:sequence>
<xs:element name="name" type="referenceid-type" minOccurs="0"/>
<xs:element name="code" type="string1-99-type"/>
<xs:choice id="imo">
<xs:element name="IMONumber" type="imonumber-type"/>
<xs:element name="ENINumber" type="eninumber-type"/>

View File

@ -66,7 +66,13 @@
<xs:element name="PortOfCallLast30DaysLocode" type="locode-type"/>
<xs:element name="PortOfCallLast30DaysDateOfDeparture" type="xs:date"/>
<xs:element name="PortOfCallLast30DaysCrewMembersJoined" type="yorn-type"/>
<xs:element name="PortOfCallLast30DaysCrewJoinedShip" type="string1-99-type" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="PortOfCallLast30DaysCrewJoinedShip" type="crewjoined" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="crewjoined">
<xs:sequence>
<xs:element name="PortOfCallLast30DaysCrewJoinedShipName" type="string1-99-type" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

View File

@ -245,6 +245,11 @@ namespace bsmd.database
/// </summary>
public BSMDStatus InternalStatus { get; set; }
/// <summary>
/// Erweiterte Erläuterung für Status(-wechsel) zur Darstellung im ENI
/// </summary>
public string StatusInfo { get; set; }
/// <summary>
/// die zur Kommunikation zu verwendende HIS Schnittstelle
/// </summary>
@ -362,13 +367,14 @@ namespace bsmd.database
cmd.Parameters.AddWithValue("@HIS", this.HIS);
cmd.Parameters.AddWithNullableValue("@CREATEDBY", this.CreatedBy);
cmd.Parameters.AddWithNullableValue("@CHANGEDBY", this.ChangedBy);
cmd.Parameters.AddWithNullableValue("@STATUSINFO", this.StatusInfo);
if (this.IsNew)
{
this.CreateId();
cmd.Parameters.AddWithValue("@ID", this.Id);
string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, CreatedBy, ChangedBy) " +
"VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY)",
string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, CreatedBy, ChangedBy, StatusInfo) " +
"VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO)",
this.Tablename);
cmd.CommandText = query;
}
@ -377,7 +383,7 @@ namespace bsmd.database
cmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("UPDATE {0} SET ClientRequestId = @CLIENTREQUESTID, MessageId = @MESSAGEID, SentAt = @SENTAT, ReceivedAt = @RECEIVEDAT, RequestedAt = @REQUESTEDAT, " +
"NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, HIS = @HIS, " +
"CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY WHERE Id = @ID", this.Tablename);
"CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO WHERE Id = @ID", this.Tablename);
}
}
@ -385,7 +391,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria )
{
string query = string.Format("SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, " +
"Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed FROM {0} ", this.Tablename);
"Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo FROM {0} ", this.Tablename);
switch (filter)
{
@ -463,6 +469,7 @@ namespace bsmd.database
if (!reader.IsDBNull(15)) msg.CreatedBy = reader.GetString(15);
if (!reader.IsDBNull(16)) msg.ChangedBy = reader.GetString(16);
if (!reader.IsDBNull(17)) msg.changed = reader.GetDateTime(17);
if (!reader.IsDBNull(18)) msg.StatusInfo = reader.GetString(18);
result.Add(msg);
}
reader.Close();

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.6.12")]
[assembly: AssemblyInformationalVersion("3.6.13")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("3.6.12.*")]
[assembly: AssemblyVersion("3.6.13.*")]

View File

@ -42,8 +42,11 @@ namespace bsmd.database
(message.MessageNotificationClass == Message.NotificationClass.WAS) ||
(message.MessageNotificationClass == Message.NotificationClass.TOWD) ||
(message.MessageNotificationClass == Message.NotificationClass.STO))
{
message.StatusInfo = "Meldeklasse bei Transitmeldung nicht versandt";
return false;
}
}
// Wenn kein Gefahrgut gemeldet ist soll die Meldeklasse gar nicht gesendet werden
if ((message.MessageNotificationClass == Message.NotificationClass.HAZA) ||
@ -54,8 +57,11 @@ namespace bsmd.database
HAZ haz = message.Elements[0] as HAZ;
if (haz != null)
{
if (haz.NoDPGOnBoardOnArrival ?? false) return false;
if (haz.NoDPGOnBoardOnArrival ?? false)
{
message.StatusInfo = "Meldeklasse nicht versandt: Kein Gefahrgut deklariert";
return false;
}
// Diese Einstellung wird im EU-NOAD Tool gemacht, muss bei anderen Quellen überarbeitet werden!
// if (haz.TransmissionType != "EU-NOAD") return false;
@ -73,9 +79,23 @@ namespace bsmd.database
if (message.Elements.Count > 0)
{
bsmd.database.ATD atd = message.Elements[0] as bsmd.database.ATD;
if (!atd.ATDPortOfCall.HasValue) return false;
if ((atd.ATDPortOfCall.Value - DateTime.UtcNow).TotalMinutes > 60) return false;
if ((DateTime.UtcNow - atd.ATDPortOfCall.Value).TotalDays > 7) return false;
if (!atd.ATDPortOfCall.HasValue)
{
message.StatusInfo = "ATD ohne Zeitpunkt wird nicht versandt";
return false;
}
if ((atd.ATDPortOfCall.Value - DateTime.UtcNow).TotalMinutes > 60)
{
message.StatusInfo = "ATD mehr als 60 Minuten in der Zukunft!";
return false;
}
/* RM Christin entfernt 17.8.17
if ((DateTime.UtcNow - atd.ATDPortOfCall.Value).TotalDays > 7)
{
message.StatusInfo = "ATD älter als eine Woche!";
return false;
}
*/
}
}
@ -85,8 +105,18 @@ namespace bsmd.database
if (message.Elements.Count > 0)
{
bsmd.database.ATA ata = message.Elements[0] as bsmd.database.ATA;
if (!ata.ATAPortOfCall.HasValue) return false;
if ((DateTime.UtcNow - ata.ATAPortOfCall.Value).TotalDays > 7) return false;
if (!ata.ATAPortOfCall.HasValue)
{
message.StatusInfo = "ATA ohne Zeitpunkt wird nicht versandt";
return false;
}
/* RM Christin entfernt 17.8.17
if ((DateTime.UtcNow - ata.ATAPortOfCall.Value).TotalDays > 7)
{
message.StatusInfo = "ATA älter als eine Woche!";
return false;
}
*/
}
}

View File

@ -153,6 +153,7 @@ namespace bsmd.hisnord
_nsw.conveyance.owner_sender.contact.fax = rp.Fax;
_nsw.document_reference = core.Id.Value.ToString();
_nsw.conveyance.code = core.Id.ToString();
if (!core.VisitId.IsNullOrEmpty())
{
@ -170,18 +171,16 @@ namespace bsmd.hisnord
}
else // liegt noch nichts vor, Id muss beantragt werden
{
_nsw.conveyance.Items = new object[5];
_nsw.conveyance.ItemsElementName = new ItemsChoiceType[5];
_nsw.conveyance.Items = new object[4];
_nsw.conveyance.ItemsElementName = new ItemsChoiceType[4];
_nsw.conveyance.Items[0] = core.Shipname;
_nsw.conveyance.ItemsElementName[0] = ItemsChoiceType.name;
_nsw.conveyance.Items[1] = core.Id.ToString();
_nsw.conveyance.ItemsElementName[1] = ItemsChoiceType.code;
_nsw.conveyance.Items[2] = core.IMO.IsNullOrEmpty() ? core.ENI : core.IMO;
_nsw.conveyance.ItemsElementName[2] = core.IMO.IsNullOrEmpty() ? ItemsChoiceType.ENINumber : ItemsChoiceType.IMONumber;
_nsw.conveyance.Items[3] = core.PoC;
_nsw.conveyance.ItemsElementName[3] = ItemsChoiceType.PortOfCall;
_nsw.conveyance.Items[4] = core.IsTransit ? core.ETAKielCanal : core.ETA; // TODO Datum konvertieren?
_nsw.conveyance.ItemsElementName[4] = ItemsChoiceType.ETAPortOfCall;
_nsw.conveyance.Items[1] = core.IMO.IsNullOrEmpty() ? core.ENI : core.IMO;
_nsw.conveyance.ItemsElementName[1] = core.IMO.IsNullOrEmpty() ? ItemsChoiceType.ENINumber : ItemsChoiceType.IMONumber;
_nsw.conveyance.Items[2] = core.PoC;
_nsw.conveyance.ItemsElementName[2] = ItemsChoiceType.PortOfCall;
_nsw.conveyance.Items[3] = core.IsTransit ? core.ETAKielCanal : core.ETA; // TODO Datum konvertieren?
_nsw.conveyance.ItemsElementName[3] = ItemsChoiceType.ETAPortOfCall;
}
#endregion
@ -1141,18 +1140,14 @@ namespace bsmd.hisnord
if (mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysDateOfDeparture.HasValue)
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysDateOfDeparture = mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysDateOfDeparture.Value;
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined = (mdh.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewMembersJoined ?? false) ? yorntype.Y : yorntype.N;
if (mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count > 0)
{
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = new poc30CrewJoinedShip();
List<string> crewJoinedShipList = new List<string>();
List<string> crewJoinedShipList = new List<string>();
for (int k = 0; k < mdh.PortOfCallLast30Days[j].CrewJoinedShip.Count; k++)
{
if (!mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName.IsNullOrEmpty())
crewJoinedShipList.Add(mdh.PortOfCallLast30Days[j].CrewJoinedShip[k].PortOfCallLast30DaysCrewJoinedShipName);
}
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip.PortOfCallLast30DaysCrewJoinedShipName = crewJoinedShipList.ToArray();
}
pocs.PortOfCallLast30Days[j].PortOfCallLast30DaysCrewJoinedShip = crewJoinedShipList.ToArray();
}
mdh_items.Add(pocs);

View File

@ -125,10 +125,24 @@ namespace bsmd.hisnord
if (nswResponse.Status != null)
{
bool isAccepted = (nswResponse.Status == "ACCEPTED");
aMessage.Status = isAccepted ? Message.MessageStatus.ACCEPTED : Message.MessageStatus.REJECTED;
aMessage.InternalStatus = isAccepted ? Message.BSMDStatus.CONFIRMED : Message.BSMDStatus.ERROR;
if(isAccepted)
{
aMessage.Status = Message.MessageStatus.ACCEPTED;
aMessage.InternalStatus = Message.BSMDStatus.CONFIRMED;
if (nswResponse.Violations.Count > 0)
{
aMessage.InternalStatus = Message.BSMDStatus.VIOLATION;
aMessage.StatusInfo = "Violations reported";
}
aMessage.ReceivedAt = nswResponse.ReceiveAt;
}
else
{
aMessage.Status = Message.MessageStatus.REJECTED;
aMessage.InternalStatus = Message.BSMDStatus.ERROR;
aMessage.StatusInfo = "Errors reported";
}
DBManager.Instance.Save(aMessage);
}

View File

@ -127,6 +127,8 @@ public partial class nsw {
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class conveyance {
private string codeField;
private object[] itemsField;
private ItemsChoiceType[] itemsElementNameField;
@ -137,6 +139,17 @@ public partial class conveyance {
private Items1ChoiceType[] items1ElementNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string code {
get {
return this.codeField;
}
set {
this.codeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("ENINumber", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("ETAPortOfCall", typeof(System.DateTime), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
@ -144,7 +157,6 @@ public partial class conveyance {
[System.Xml.Serialization.XmlElementAttribute("PortOfCall", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("TransitId", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("VisitId", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("code", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("name", typeof(string), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
public object[] Items {
@ -280,9 +292,6 @@ public enum ItemsChoiceType {
/// <remarks/>
VisitId,
/// <remarks/>
code,
/// <remarks/>
name,
}
@ -1877,7 +1886,7 @@ public partial class portofcallmdh {
private yorntype portOfCallLast30DaysCrewMembersJoinedField;
private poc30CrewJoinedShip portOfCallLast30DaysCrewJoinedShipField;
private string[] portOfCallLast30DaysCrewJoinedShipField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
@ -1913,8 +1922,9 @@ public partial class portofcallmdh {
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShip", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public poc30CrewJoinedShip PortOfCallLast30DaysCrewJoinedShip {
[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute("PortOfCallLast30DaysCrewJoinedShipName", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public string[] PortOfCallLast30DaysCrewJoinedShip {
get {
return this.portOfCallLast30DaysCrewJoinedShipField;
}
@ -1924,33 +1934,6 @@ public partial class portofcallmdh {
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class poc30CrewJoinedShip
{
private string[] portOfCallLast30DaysCrewJoinedShipNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PortOfCallLast30DaysCrewJoinedShipName", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[] PortOfCallLast30DaysCrewJoinedShipName
{
get
{
return this.portOfCallLast30DaysCrewJoinedShipNameField;
}
set
{
this.portOfCallLast30DaysCrewJoinedShipNameField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]