Compare commits
2 Commits
85bfd8b434
...
54aa91afc1
| Author | SHA1 | Date | |
|---|---|---|---|
| 54aa91afc1 | |||
| b979136467 |
@ -96,7 +96,7 @@
|
|||||||
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textATDPortOfCall}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textATDPortOfCall}" Margin="0,0,10,0" />
|
||||||
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
|
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" Minimum="1899.12.31 00:00" Maximum="2100.12.31 00:00"/>
|
||||||
|
|
||||||
<Label HorizontalAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
|
<Label HorizontalAlignment="Right" Grid.Row="8" Grid.Column="0" Content="{x:Static p:Resources.textRemarks}" Margin="0,0,10,0" />
|
||||||
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
|
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay, Converter={util:TrimStringConverter}}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
|
||||||
|
|
||||||
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
|
<Label HorizontalContentAlignment="Right" Grid.Row="9" Grid.Column="0" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
|
||||||
@ -262,7 +262,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
<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, Converter={util:NullImageConverter}}" />
|
<Image Source="{Binding ENINotificationIconString, Converter={util:NullImageConverter}}" Height="24" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
@ -276,7 +276,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
|
||||||
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding InternalStatus}" IsReadOnly="True" Width="0.1*">
|
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding BSMDStatusOverviewDisplay}" IsReadOnly="True" Width="0.1*">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="TextBlock">
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
@ -320,7 +320,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
|||||||
</DataGridTextColumn.ElementStyle>
|
</DataGridTextColumn.ElementStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
|
||||||
<DataGridTextColumn Header="HIS" Binding="{Binding HIS}" IsReadOnly="True" Width="0.1*">
|
<DataGridTextColumn Header="HIS" Binding="{Binding HISOverviewDisplay}" IsReadOnly="True" Width="0.1*">
|
||||||
<DataGridTextColumn.ElementStyle>
|
<DataGridTextColumn.ElementStyle>
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="TextBlock">
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
|||||||
@ -834,19 +834,19 @@ namespace ENI2.DetailViewControls
|
|||||||
private void buttonSendAll_Click(object sender, RoutedEventArgs e)
|
private void buttonSendAll_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
|
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
|
||||||
List<Message> readyToSendMessages = new List<Message>();
|
List<Message.NotificationClass> readyToSendMessages = new List<Message.NotificationClass>();
|
||||||
|
|
||||||
foreach (Message message in this.Messages)
|
foreach (Message message in this.Messages)
|
||||||
{
|
{
|
||||||
if (message.MessageNotificationClass == NotificationClass.STO) continue;
|
|
||||||
// other filters?
|
|
||||||
|
|
||||||
if (((message.ViolationCount ?? 0) > 0) || ((message.ErrorCount ?? 0) > 0)) continue; // these need more work
|
if (((message.ViolationCount ?? 0) > 0) || ((message.ErrorCount ?? 0) > 0)) continue; // these need more work
|
||||||
readyToSendMessages.Add(message);
|
if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) continue; // avoid suspend on empty list classes
|
||||||
|
readyToSendMessages.Add(message.MessageNotificationClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
sicd.Messages = readyToSendMessages;
|
sicd.Messages = this.Messages;
|
||||||
|
sicd.PreselectedClasses.AddRange(readyToSendMessages);
|
||||||
sicd.IsTransit = this.Core.IsTransit;
|
sicd.IsTransit = this.Core.IsTransit;
|
||||||
|
sicd.IsImportMode = false;
|
||||||
|
|
||||||
if ((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
|
if ((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
|
||||||
{
|
{
|
||||||
@ -854,7 +854,7 @@ namespace ENI2.DetailViewControls
|
|||||||
List<Message> toSendMessages = new List<Message>();
|
List<Message> toSendMessages = new List<Message>();
|
||||||
foreach(NotificationClass notificationClass in sicd.SelectedClasses)
|
foreach(NotificationClass notificationClass in sicd.SelectedClasses)
|
||||||
{
|
{
|
||||||
Message selectedMessage = readyToSendMessages.Find(x => x.MessageNotificationClass == notificationClass);
|
Message selectedMessage = this.Messages.Find(x => x.MessageNotificationClass == notificationClass);
|
||||||
if (selectedMessage != null)
|
if (selectedMessage != null)
|
||||||
{
|
{
|
||||||
toSendMessages.Add(selectedMessage);
|
toSendMessages.Add(selectedMessage);
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
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"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="{x:Static p:Resources.textSelectImportClasses}" Height="600" Width="250" Background="AliceBlue">
|
Title="{x:Static p:Resources.textSelectImportClasses}" Height="660" Width="250" Background="AliceBlue">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) 2017-today schick Informatik
|
// Copyright (c) 2017-today schick Informatik
|
||||||
// Description: Select classes for import
|
// Description: Select classes for import via Excel or for sending them once completed
|
||||||
// Returns: Array of selected classes as property
|
// Returns: Array of selected classes as property
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -17,7 +17,8 @@ namespace ENI2.EditControls
|
|||||||
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
|
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
|
||||||
{
|
{
|
||||||
private readonly List<SelectClass> _selectClasses = new List<SelectClass>();
|
private readonly List<SelectClass> _selectClasses = new List<SelectClass>();
|
||||||
private readonly List<bsmd.database.Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
|
private readonly List<Message.NotificationClass> _selectedClasses = new List<Message.NotificationClass>();
|
||||||
|
private readonly List<Message.NotificationClass> _preselectedClasses = new List<Message.NotificationClass>();
|
||||||
|
|
||||||
public SelectImportClassesDialog()
|
public SelectImportClassesDialog()
|
||||||
{
|
{
|
||||||
@ -25,33 +26,62 @@ namespace ENI2.EditControls
|
|||||||
this.Loaded += SelectImportClassesDialog_Loaded;
|
this.Loaded += SelectImportClassesDialog_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of all message classes that are available for selection
|
||||||
|
/// </summary>
|
||||||
public List<Message.NotificationClass> SelectedClasses
|
public List<Message.NotificationClass> SelectedClasses
|
||||||
{
|
{
|
||||||
get { return _selectedClasses; }
|
get { return _selectedClasses; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Classes that should be checked already when the dialog is opened (relevant for send mode)
|
||||||
|
/// </summary>
|
||||||
|
public List<Message.NotificationClass > PreselectedClasses
|
||||||
|
{
|
||||||
|
get { return _preselectedClasses; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// These messages are needed to derive message classes from, already sorted in the right manner
|
/// These messages are needed to derive message classes from, already sorted in the right manner
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Message> Messages { get; set; }
|
public List<Message> Messages { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flag to reduce selection amount in case of transit
|
||||||
|
/// </summary>
|
||||||
public bool IsTransit { get; set; }
|
public bool IsTransit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flag if dialog is used in import mode (default true). Set false for send all mode.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsImportMode { get; set; } = true;
|
||||||
|
|
||||||
private void SelectImportClassesDialog_Loaded(object sender, RoutedEventArgs e)
|
private void SelectImportClassesDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach(Message aMessage in this.Messages)
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
{
|
{
|
||||||
|
// these are of no interest
|
||||||
if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
|
if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
|
||||||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.STO))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// these are never imported but may be sent
|
||||||
|
if (IsImportMode)
|
||||||
|
{
|
||||||
|
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
|
||||||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// filter out messages not relevant for transit
|
||||||
|
if (IsTransit && (
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.STO)
|
(aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
||||||
) continue;
|
|
||||||
|
|
||||||
if (IsTransit &&
|
|
||||||
((aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) ||
|
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
|
||||||
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
|
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
|
||||||
@ -65,13 +95,14 @@ namespace ENI2.EditControls
|
|||||||
)) continue;
|
)) continue;
|
||||||
|
|
||||||
SelectClass sc = new SelectClass();
|
SelectClass sc = new SelectClass();
|
||||||
sc.Name = Enum.GetName(typeof(bsmd.database.Message.NotificationClass), aMessage.MessageNotificationClass);
|
sc.Name = Enum.GetName(typeof(Message.NotificationClass), aMessage.MessageNotificationClass);
|
||||||
sc.Class = aMessage.MessageNotificationClass;
|
sc.Class = aMessage.MessageNotificationClass;
|
||||||
sc.IsSelected = false;
|
sc.IsSelected = this._preselectedClasses.Contains(sc.Class);
|
||||||
_selectClasses.Add(sc);
|
_selectClasses.Add(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
||||||
this.OKClicked += SelectImportClassesDialog_OKClicked;
|
this.OKClicked += SelectImportClassesDialog_OKClicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,32 +66,32 @@ namespace bsmd.database
|
|||||||
/// NSW notification class
|
/// NSW notification class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum NotificationClass
|
public enum NotificationClass
|
||||||
{
|
{
|
||||||
VISIT, // 0
|
VISIT, // 0
|
||||||
TRANSIT, // 1
|
TRANSIT, // 1
|
||||||
NOA_NOD, // 2
|
NOA_NOD, // 2
|
||||||
ATA,
|
ATA,
|
||||||
ATD,
|
ATD,
|
||||||
SEC, // 5
|
SEC, // 5
|
||||||
POBA,
|
POBA,
|
||||||
POBD,
|
POBD,
|
||||||
NAME,
|
NAME,
|
||||||
TIEFA,
|
TIEFA,
|
||||||
TIEFD, // 10
|
TIEFD, // 10
|
||||||
BKRA,
|
BKRA,
|
||||||
BKRD,
|
BKRD,
|
||||||
STAT,
|
STAT,
|
||||||
LADG,
|
LADG,
|
||||||
INFO, // 15
|
INFO, // 15
|
||||||
SERV,
|
SERV,
|
||||||
PRE72H,
|
PRE72H,
|
||||||
MDH,
|
MDH,
|
||||||
WAS,
|
WAS,
|
||||||
CREWA, // 20
|
CREWA, // 20
|
||||||
PASA,
|
PASA,
|
||||||
BPOL,
|
BPOL,
|
||||||
TOWA,
|
TOWA,
|
||||||
TOWD,
|
TOWD,
|
||||||
HAZA, // 25
|
HAZA, // 25
|
||||||
HAZD,
|
HAZD,
|
||||||
AGNT,
|
AGNT,
|
||||||
@ -145,7 +145,7 @@ namespace bsmd.database
|
|||||||
WASRCPT_ID,
|
WASRCPT_ID,
|
||||||
BY_FILE_SEQ_NUM,
|
BY_FILE_SEQ_NUM,
|
||||||
BY_TYPE
|
BY_TYPE
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Message Status einer NSW Einzelnachricht
|
/// Message Status einer NSW Einzelnachricht
|
||||||
@ -182,7 +182,7 @@ namespace bsmd.database
|
|||||||
|
|
||||||
[Description("HIS-Nord")]
|
[Description("HIS-Nord")]
|
||||||
DUDR,
|
DUDR,
|
||||||
|
|
||||||
[Description("dbh / Maersk")]
|
[Description("dbh / Maersk")]
|
||||||
DBH_MAERSK
|
DBH_MAERSK
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ namespace bsmd.database
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dieser Wert wird vom NSW / HIS vergeben
|
/// Dieser Wert wird vom NSW / HIS vergeben
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ClientRequestId { set; get; }
|
public string ClientRequestId { set; get; }
|
||||||
|
|
||||||
public Guid? MessageId { get; set; }
|
public Guid? MessageId { get; set; }
|
||||||
|
|
||||||
@ -269,6 +269,15 @@ namespace bsmd.database
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public BSMDStatus InternalStatus { get; set; }
|
public BSMDStatus InternalStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Display helper property for overview status
|
||||||
|
/// </summary>
|
||||||
|
public string BSMDStatusOverviewDisplay {
|
||||||
|
get {
|
||||||
|
return (InternalStatus != BSMDStatus.UNDEFINED) ? InternalStatus.ToString() : "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vorheriger Status (z.B. für nach der Report-Generierung), wird nicht immer gesetzt
|
/// Vorheriger Status (z.B. für nach der Report-Generierung), wird nicht immer gesetzt
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -284,6 +293,17 @@ namespace bsmd.database
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public NSWProvider HIS { get; set; }
|
public NSWProvider HIS { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Display helper property for overview HIS
|
||||||
|
/// </summary>
|
||||||
|
public string HISOverviewDisplay
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (HIS != NSWProvider.UNDEFINED) ? HIS.ToString() : string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fehlerliste (Rückgabe vom NSW)
|
/// Fehlerliste (Rückgabe vom NSW)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user