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" />
|
||||
<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"/>
|
||||
|
||||
<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>
|
||||
<!--Image Source="{Binding src:Util.ImageDict[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>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@ -276,7 +276,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</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>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
@ -320,7 +320,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</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>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
|
||||
@ -834,19 +834,19 @@ namespace ENI2.DetailViewControls
|
||||
private void buttonSendAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
|
||||
List<Message> readyToSendMessages = new List<Message>();
|
||||
List<Message.NotificationClass> readyToSendMessages = new List<Message.NotificationClass>();
|
||||
|
||||
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
|
||||
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.IsImportMode = false;
|
||||
|
||||
if ((sicd.ShowDialog() ?? false) && (sicd.SelectedClasses.Count > 0))
|
||||
{
|
||||
@ -854,7 +854,7 @@ namespace ENI2.DetailViewControls
|
||||
List<Message> toSendMessages = new List<Message>();
|
||||
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)
|
||||
{
|
||||
toSendMessages.Add(selectedMessage);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
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.RowDefinitions>
|
||||
<RowDefinition Height="1*" />
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// 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
|
||||
|
||||
using System;
|
||||
@ -17,7 +17,8 @@ namespace ENI2.EditControls
|
||||
public partial class SelectImportClassesDialog : ENI2.Controls.EditWindowBase
|
||||
{
|
||||
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()
|
||||
{
|
||||
@ -25,33 +26,62 @@ namespace ENI2.EditControls
|
||||
this.Loaded += SelectImportClassesDialog_Loaded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of all message classes that are available for selection
|
||||
/// </summary>
|
||||
public List<Message.NotificationClass> 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>
|
||||
/// These messages are needed to derive message classes from, already sorted in the right manner
|
||||
/// </summary>
|
||||
public List<Message> Messages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Flag to reduce selection amount in case of transit
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
|
||||
foreach(Message aMessage in this.Messages)
|
||||
|
||||
|
||||
foreach (Message aMessage in this.Messages)
|
||||
{
|
||||
// these are of no interest
|
||||
if ((aMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
|
||||
(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.ATD) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.STO)
|
||||
) continue;
|
||||
|
||||
if (IsTransit &&
|
||||
((aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.BPOL) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.BKRD) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.INFO) ||
|
||||
(aMessage.MessageNotificationClass == Message.NotificationClass.LADG) ||
|
||||
@ -65,13 +95,14 @@ namespace ENI2.EditControls
|
||||
)) continue;
|
||||
|
||||
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.IsSelected = false;
|
||||
sc.IsSelected = this._preselectedClasses.Contains(sc.Class);
|
||||
_selectClasses.Add(sc);
|
||||
}
|
||||
|
||||
|
||||
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
||||
this.checkListBoxClasses.ItemsSource = _selectClasses;
|
||||
this.OKClicked += SelectImportClassesDialog_OKClicked;
|
||||
}
|
||||
|
||||
|
||||
@ -66,32 +66,32 @@ namespace bsmd.database
|
||||
/// NSW notification class
|
||||
/// </summary>
|
||||
public enum NotificationClass
|
||||
{
|
||||
{
|
||||
VISIT, // 0
|
||||
TRANSIT, // 1
|
||||
NOA_NOD, // 2
|
||||
ATA,
|
||||
ATD,
|
||||
ATA,
|
||||
ATD,
|
||||
SEC, // 5
|
||||
POBA,
|
||||
POBD,
|
||||
NAME,
|
||||
TIEFA,
|
||||
POBA,
|
||||
POBD,
|
||||
NAME,
|
||||
TIEFA,
|
||||
TIEFD, // 10
|
||||
BKRA,
|
||||
BKRD,
|
||||
STAT,
|
||||
LADG,
|
||||
BKRA,
|
||||
BKRD,
|
||||
STAT,
|
||||
LADG,
|
||||
INFO, // 15
|
||||
SERV,
|
||||
PRE72H,
|
||||
MDH,
|
||||
WAS,
|
||||
SERV,
|
||||
PRE72H,
|
||||
MDH,
|
||||
WAS,
|
||||
CREWA, // 20
|
||||
PASA,
|
||||
BPOL,
|
||||
TOWA,
|
||||
TOWD,
|
||||
PASA,
|
||||
BPOL,
|
||||
TOWA,
|
||||
TOWD,
|
||||
HAZA, // 25
|
||||
HAZD,
|
||||
AGNT,
|
||||
@ -145,7 +145,7 @@ namespace bsmd.database
|
||||
WASRCPT_ID,
|
||||
BY_FILE_SEQ_NUM,
|
||||
BY_TYPE
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Message Status einer NSW Einzelnachricht
|
||||
@ -182,7 +182,7 @@ namespace bsmd.database
|
||||
|
||||
[Description("HIS-Nord")]
|
||||
DUDR,
|
||||
|
||||
|
||||
[Description("dbh / Maersk")]
|
||||
DBH_MAERSK
|
||||
}
|
||||
@ -213,7 +213,7 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Dieser Wert wird vom NSW / HIS vergeben
|
||||
/// </summary>
|
||||
public string ClientRequestId { set; get; }
|
||||
public string ClientRequestId { set; get; }
|
||||
|
||||
public Guid? MessageId { get; set; }
|
||||
|
||||
@ -269,6 +269,15 @@ namespace bsmd.database
|
||||
/// </summary>
|
||||
public BSMDStatus InternalStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Display helper property for overview status
|
||||
/// </summary>
|
||||
public string BSMDStatusOverviewDisplay {
|
||||
get {
|
||||
return (InternalStatus != BSMDStatus.UNDEFINED) ? InternalStatus.ToString() : "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vorheriger Status (z.B. für nach der Report-Generierung), wird nicht immer gesetzt
|
||||
/// </summary>
|
||||
@ -284,6 +293,17 @@ namespace bsmd.database
|
||||
/// </summary>
|
||||
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>
|
||||
/// Fehlerliste (Rückgabe vom NSW)
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user