Compare commits
4 Commits
3dd2439524
...
8a836ed096
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a836ed096 | |||
| cf81ec0225 | |||
| 43fc89c7d3 | |||
| 96ddbd5e0a |
@ -799,9 +799,15 @@ namespace ENI2
|
||||
else
|
||||
aMessage.ErrorCount = null;
|
||||
if (violations.Count > 0)
|
||||
{
|
||||
aMessage.ViolationCount = violations.Count;
|
||||
aMessage.PositionViolationCount = violations.Count(v => !v.Identifier.IsNullOrEmpty());
|
||||
}
|
||||
else
|
||||
aMessage.ViolationCount = null;
|
||||
{
|
||||
aMessage.ViolationCount = null;
|
||||
aMessage.PositionViolationCount = null;
|
||||
}
|
||||
|
||||
string messageGroup = this.MessageGroupForMessage(aMessage);
|
||||
|
||||
|
||||
@ -252,6 +252,15 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Background" Value="Yellow" />
|
||||
</MultiDataTrigger>
|
||||
<DataTrigger Binding="{Binding SendSuccess}" Value="True">
|
||||
<Setter Property="Background" Value="LightGreen"></Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding HasSystemErrors}" Value="True">
|
||||
<Setter Property="Background" Value="MistyRose"></Setter>
|
||||
</DataTrigger>
|
||||
<!--DataTrigger Binding="{Binding HasErrors}" Value="True">
|
||||
<Setter Property="Background" Value="PaleVioletRed"></Setter>
|
||||
</DataTrigger-->
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
@ -267,7 +276,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}" IsReadOnly="True" Width="0.075*" FontWeight="Bold">
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textNotificationClass}" Binding="{Binding MessageNotificationClassDisplay}" IsReadOnly="True" Width="0.1*" FontWeight="Bold">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
@ -300,7 +309,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textErrors}" IsReadOnly="True" Width="0.1*" Binding="{Binding ErrorCount}">
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textErrors}" IsReadOnly="True" Width="0.06*" Binding="{Binding ErrorCount}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
@ -310,7 +319,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textViolations}" IsReadOnly="True" Width="0.1*" Binding="{Binding ViolationCount}">
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textViolations}" IsReadOnly="True" Width="0.06*" Binding="{Binding ViolationCount}">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
@ -320,7 +329,7 @@ SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="HIS" Binding="{Binding HISOverviewDisplay}" IsReadOnly="True" Width="0.1*">
|
||||
<DataGridTextColumn Header="HIS" Binding="{Binding HISOverviewDisplay}" IsReadOnly="True" Width="0.06*">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
|
||||
@ -836,25 +836,52 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
SelectImportClassesDialog sicd = new SelectImportClassesDialog();
|
||||
List<Message.NotificationClass> readyToSendMessages = new List<Message.NotificationClass>();
|
||||
|
||||
|
||||
// Evaluate a number of criteria for messages that should not be preselected for sending
|
||||
bool addToSend;
|
||||
foreach (Message message in this.Messages)
|
||||
{
|
||||
// Evaluate a number of criteria for messages that should not be preselected for sending
|
||||
if (((message.ViolationCount ?? 0) > 0) || ((message.ErrorCount ?? 0) > 0)) continue; // these need more work
|
||||
if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) continue; // avoid suspend on empty list classes
|
||||
if ((message.MessageNotificationClass == Message.NotificationClass.HAZA) && !XtraSendLogic.ShouldSendMessage(message)) continue;
|
||||
if ((message.MessageNotificationClass == Message.NotificationClass.HAZD) && !XtraSendLogic.ShouldSendMessage(message)) continue;
|
||||
if (message.MessageNotificationClass == Message.NotificationClass.BPOL)
|
||||
{
|
||||
addToSend = true;
|
||||
|
||||
if ((message.ErrorCount ?? 0) > 0) continue;
|
||||
switch(message.MessageNotificationClass)
|
||||
{
|
||||
if (message.Elements.Count > 0)
|
||||
{
|
||||
if (message.Elements[0] is BPOL bpol)
|
||||
case NotificationClass.HAZA:
|
||||
addToSend = XtraSendLogic.ShouldSendMessage(message) && ((message.ViolationCount ?? 0) == 0); break;
|
||||
case NotificationClass.HAZD:
|
||||
addToSend = XtraSendLogic.ShouldSendMessage(message) && ((message.ViolationCount ?? 0) == 0); break;
|
||||
case NotificationClass.BPOL:
|
||||
if (message.Elements.Count > 0)
|
||||
{
|
||||
if (bpol.PortOfItineraries.Count == 0) continue;
|
||||
if (message.Elements[0] is BPOL bpol)
|
||||
{
|
||||
if (bpol.PortOfItineraries.Count == 0) addToSend = false;
|
||||
}
|
||||
if((message.ViolationCount ?? 0) > 0) addToSend = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NotificationClass.WAS:
|
||||
if ((message.PositionViolationCount ?? 0) > 0) addToSend = false;
|
||||
break;
|
||||
case NotificationClass.WAS_RCPT:
|
||||
addToSend = false;
|
||||
break;
|
||||
case NotificationClass.NOA_NOD:
|
||||
if ((message.PositionViolationCount ?? 0) > 0) addToSend = false;
|
||||
break;
|
||||
case NotificationClass.INFO:
|
||||
if (Core.PoC == "DEHAM") addToSend = false;
|
||||
else addToSend = ((message.ViolationCount ?? 0) > 0);
|
||||
break;
|
||||
default:
|
||||
if((message.ViolationCount ?? 0) > 0) addToSend = false;
|
||||
if(Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) addToSend = false;
|
||||
|
||||
break;
|
||||
}
|
||||
readyToSendMessages.Add(message.MessageNotificationClass);
|
||||
|
||||
if(addToSend)
|
||||
readyToSendMessages.Add(message.MessageNotificationClass);
|
||||
}
|
||||
|
||||
sicd.Messages = this.Messages;
|
||||
|
||||
@ -94,7 +94,7 @@ namespace ENI2.DetailViewControls
|
||||
}
|
||||
}
|
||||
|
||||
public async override void Initialize()
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@ -185,7 +185,7 @@ namespace ENI2.DetailViewControls
|
||||
|
||||
#region Waste receipt grid event handler
|
||||
|
||||
private async void DataGridWasteReceipt_CreateRequested()
|
||||
private void DataGridWasteReceipt_CreateRequested()
|
||||
{
|
||||
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
|
||||
epd.WAS_RCPT = new WAS_RCPT();
|
||||
@ -236,7 +236,7 @@ namespace ENI2.DetailViewControls
|
||||
}
|
||||
}
|
||||
|
||||
private async void DataGridWasteReceipt_EditRequested(DatabaseEntity obj)
|
||||
private void DataGridWasteReceipt_EditRequested(DatabaseEntity obj)
|
||||
{
|
||||
EditWasteReceiptDialog epd = new EditWasteReceiptDialog();
|
||||
epd.WAS_RCPT = obj as WAS_RCPT;
|
||||
|
||||
@ -1239,7 +1239,7 @@ namespace ENI2.Excel
|
||||
{
|
||||
if ((reader.Mode == ExcelReader.CountryMode.DE) && waste.IsDashWasteCode)
|
||||
{
|
||||
// waste.WasteDescription = "-";
|
||||
waste.WasteDescription = "-";
|
||||
// NOP
|
||||
}
|
||||
else if (reader.Mode == ExcelReader.CountryMode.DK)
|
||||
|
||||
@ -431,6 +431,12 @@ namespace bsmd.database
|
||||
/// </summary>
|
||||
public int? ViolationCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of violations during last validation that have the "identifier" set and are thus detected violations
|
||||
/// from underlying list elements
|
||||
/// </summary>
|
||||
public int? PositionViolationCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of errors during last validation
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user