Zwischenstand Validierung (Sicherung!)
This commit is contained in:
parent
f9d5c4f6e3
commit
867146eb54
@ -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>
|
||||
|
||||
23
ENI-2/ENI2/ENI2/Controls/ConditionGroupControl.xaml
Normal file
23
ENI-2/ENI2/ENI2/Controls/ConditionGroupControl.xaml
Normal file
@ -0,0 +1,23 @@
|
||||
<UserControl x:Class="ENI2.Controls.ConditionGroupControl"
|
||||
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:local="clr-namespace:ENI2.Controls"
|
||||
xmlns:db="clr-namespace:bsmd.database;assembly=bsmd.database"
|
||||
xmlns:util="clr-namespace:ENI2.Util"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="32" />
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton Grid.Row="0" Name="radioButtonOR" VerticalContentAlignment="Center" Content="OR" Margin="2" IsChecked="{Binding GroupOperator, Converter={util:EnumToBooleanConverter}, ConverterParameter={x:Static db:ConditionGroup+GroupOperatorEnum.OR}}"/>
|
||||
<RadioButton Grid.Row="1" Name="radioButtonAND" VerticalContentAlignment="Center" Content="AND" Margin="2" IsChecked="{Binding GroupOperator, Converter={util:EnumToBooleanConverter}, ConverterParameter={x:Static db:ConditionGroup+GroupOperatorEnum.AND}}"/>
|
||||
<RadioButton Grid.Row="2" Name="radioButtonNOT" VerticalContentAlignment="Center" Content="NOT" Margin="2" IsChecked="{Binding GroupOperator, Converter={util:EnumToBooleanConverter}, ConverterParameter={x:Static db:ConditionGroup+GroupOperatorEnum.NOT}}"/>
|
||||
<RadioButton Grid.Row="3" Name="radioButtonXOR" VerticalContentAlignment="Center" Content="XOR" Margin="2" IsChecked="{Binding GroupOperator, Converter={util:EnumToBooleanConverter}, ConverterParameter={x:Static db:ConditionGroup+GroupOperatorEnum.XOR}}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
30
ENI-2/ENI2/ENI2/Controls/ConditionGroupControl.xaml.cs
Normal file
30
ENI-2/ENI2/ENI2/Controls/ConditionGroupControl.xaml.cs
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (c) 2017 schick Informatik
|
||||
// Description: Plugin Control zur Auswahl der bool'schen Gruppenoperation
|
||||
//
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
using bsmd.database;
|
||||
|
||||
namespace ENI2.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ConditionGroupControl.xaml
|
||||
/// </summary>
|
||||
public partial class ConditionGroupControl : UserControl
|
||||
{
|
||||
public ConditionGroupControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += ConditionGroupControl_Loaded;
|
||||
}
|
||||
|
||||
public ConditionGroup ConditionGroup { get; set; }
|
||||
|
||||
private void ConditionGroupControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DataContext = this.ConditionGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,22 +3,15 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using bsmd.database;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ENI2.Controls
|
||||
{
|
||||
@ -171,15 +164,22 @@ namespace ENI2.Controls
|
||||
|
||||
protected void deleteItem(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if((this.SelectedItems != null) && (this.SelectedItems.Count == 1) && !this.IsReadOnly)
|
||||
if((this.SelectedItems != null) && (this.SelectedItems.Count > 0) && !this.IsReadOnly)
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show(Properties.Resources.textAreYouSure, Properties.Resources.textCaptionDeleteConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
DatabaseEntity deleteItem = this.SelectedItems[0] as DatabaseEntity;
|
||||
if (deleteItem != null) {
|
||||
this.DeleteRequested?.Invoke(deleteItem);
|
||||
}
|
||||
List<DatabaseEntity> deleteList = new List<DatabaseEntity>();
|
||||
foreach (DatabaseEntity deleteItem in this.SelectedItems)
|
||||
deleteList.Add(deleteItem);
|
||||
|
||||
foreach (DatabaseEntity deleteItem in deleteList)
|
||||
{
|
||||
if (deleteItem != null)
|
||||
{
|
||||
this.DeleteRequested?.Invoke(deleteItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,6 +68,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridBKRA" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Binding="{Binding BunkerFuelType}" IsReadOnly="True" Width="0.2*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" Binding="{Binding BunkerFuelQuantity_TNE, Mode=TwoWay}" IsReadOnly="True" Width="0.8*" />
|
||||
</DataGrid.Columns>
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
|
||||
<Label Content="{x:Static p:Resources.textItineraryPort}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Left" Margin="0,0,10,0"/>
|
||||
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfItinerary" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortOfItineraryName, Mode=TwoWay}" IsReadOnly="True" Width="0.5*" />
|
||||
<!--DataGridTextColumn Binding="{Binding PortOfItineraryLocode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /-->
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textETA}" Binding="{Binding PortOfItineraryETA, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}, StringFormat=\{0:dd.MM.yy HH:mm\}}" IsReadOnly="True" Width="0.5*" />
|
||||
@ -54,8 +55,9 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Button Name="buttonImportExcelCrew" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelCrew_Click" />
|
||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding CrewMemberLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding CrewMemberFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding CrewMemberGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
@ -80,8 +82,9 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Button Name="buttonImportExcelPassenger" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcelPassenger_Click" />
|
||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLastName}" Binding="{Binding PassengerLastName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding PassengerFirstName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textGender}" Binding="{Binding PassengerGenderDisplay}" IsReadOnly="True" Width="0.1*" />
|
||||
|
||||
@ -353,56 +353,65 @@ namespace ENI2.DetailViewControls
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "Excel Files|*.xls;*.xlsx";
|
||||
if(ofd.ShowDialog() ?? false)
|
||||
if (ofd.ShowDialog() ?? false)
|
||||
{
|
||||
using (var stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read))
|
||||
FileStream stream = null;
|
||||
try
|
||||
{
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
List<CREW> importCrew = new List<CREW>();
|
||||
|
||||
try
|
||||
{
|
||||
List<CREW> importCrew = new List<CREW>();
|
||||
|
||||
try
|
||||
do
|
||||
{
|
||||
|
||||
do
|
||||
while (reader.Read())
|
||||
{
|
||||
while (reader.Read())
|
||||
CREW crew = new CREW();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
|
||||
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberNationality = reader.GetString(3).Substring(0, 2);
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberDuty = reader.GetString(4);
|
||||
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6))
|
||||
{
|
||||
CREW crew = new CREW();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
|
||||
if (!reader.IsDBNull(1)) crew.CrewMemberFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) crew.CrewMemberGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) crew.CrewMemberNationality = reader.GetString(3).Substring(0, 2);
|
||||
if (!reader.IsDBNull(4)) crew.CrewMemberDuty = reader.GetString(4);
|
||||
if (!reader.IsDBNull(5)) crew.CrewMemberPlaceOfBirth = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6))
|
||||
{
|
||||
crew.CrewMemberDateOfBirth = reader.GetDateTime(6);
|
||||
}
|
||||
if (!reader.IsDBNull(7)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(7));
|
||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 8);
|
||||
if (!reader.IsDBNull(9)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 9);
|
||||
|
||||
crew.MessageHeader = this._crewMessage;
|
||||
crew.Identifier = CREW.GetNewIdentifier(this._crewMessage.Elements);
|
||||
importCrew.Add(crew);
|
||||
crew.CrewMemberDateOfBirth = reader.GetDateTime(6);
|
||||
}
|
||||
} while (reader.NextResult());
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
if (!reader.IsDBNull(7)) crew.CrewMemberIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(7));
|
||||
if (!reader.IsDBNull(8)) crew.CrewMemberIdentityDocumentId = this.getValueAsString(reader, 8);
|
||||
if (!reader.IsDBNull(9)) crew.CrewMemberVisaNumber = this.getValueAsString(reader, 9);
|
||||
|
||||
if(importCrew.Count > 0)
|
||||
{
|
||||
this._crewMessage.Elements.AddRange(importCrew);
|
||||
this.dataGridCrewList.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.CREW);
|
||||
}
|
||||
crew.MessageHeader = this._crewMessage;
|
||||
crew.Identifier = CREW.GetNewIdentifier(this._crewMessage.Elements);
|
||||
importCrew.Add(crew);
|
||||
}
|
||||
} while (reader.NextResult());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
if (importCrew.Count > 0)
|
||||
{
|
||||
this._crewMessage.Elements.AddRange(importCrew);
|
||||
this.dataGridCrewList.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.CREW);
|
||||
}
|
||||
}
|
||||
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,59 +421,68 @@ namespace ENI2.DetailViewControls
|
||||
ofd.Filter = "Excel Files|*.xls;*.xlsx";
|
||||
if (ofd.ShowDialog() ?? false)
|
||||
{
|
||||
using (var stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read))
|
||||
FileStream stream = null;
|
||||
try
|
||||
{
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
List<PAS> importPassenger = new List<PAS>();
|
||||
|
||||
try
|
||||
{
|
||||
List<PAS> importPassenger = new List<PAS>();
|
||||
|
||||
try
|
||||
do
|
||||
{
|
||||
do
|
||||
while (reader.Read())
|
||||
{
|
||||
while (reader.Read())
|
||||
PAS pas = new PAS();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetString(0);
|
||||
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) pas.PassengerNationality = reader.GetString(3).Substring(0, 2);
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfEmbarkation = reader.GetString(4);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||
pas.PassengerPortOfEmbarkation = null;
|
||||
if (!reader.IsDBNull(5)) pas.PassengerPortOfDisembarkation = reader.GetString(5);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||
pas.PassengerPortOfDisembarkation = null;
|
||||
if (!reader.IsDBNull(6)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(6));
|
||||
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
|
||||
if (!reader.IsDBNull(8))
|
||||
{
|
||||
PAS pas = new PAS();
|
||||
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
|
||||
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetString(0);
|
||||
if (!reader.IsDBNull(1)) pas.PassengerFirstName = reader.GetString(1);
|
||||
if (!reader.IsDBNull(2)) pas.PassengerGender = GlobalStructures.ParseGender(reader.GetString(2));
|
||||
if (!reader.IsDBNull(3)) pas.PassengerNationality = reader.GetString(3).Substring(0, 2);
|
||||
if (!reader.IsDBNull(4)) pas.PassengerPortOfEmbarkation = reader.GetString(4);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfEmbarkation) == null)
|
||||
pas.PassengerPortOfEmbarkation = null;
|
||||
if (!reader.IsDBNull(5)) pas.PassengerPortOfDisembarkation = reader.GetString(5);
|
||||
if (LocodeDB.PortNameFromLocode(pas.PassengerPortOfDisembarkation) == null)
|
||||
pas.PassengerPortOfDisembarkation = null;
|
||||
if (!reader.IsDBNull(6)) pas.PassengerInTransit = GlobalStructures.ReadBoolean(reader.GetString(6));
|
||||
if (!reader.IsDBNull(7)) pas.PassengerPlaceOfBirth = reader.GetString(7);
|
||||
if (!reader.IsDBNull(8))
|
||||
{
|
||||
pas.PassengerDateOfBirth = reader.GetDateTime(8);
|
||||
}
|
||||
if (!reader.IsDBNull(9)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(9));
|
||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 10);
|
||||
if (!reader.IsDBNull(11)) pas.PassengerVisaNumber = this.getValueAsString(reader, 11);
|
||||
|
||||
pas.MessageHeader = this._pasMessage;
|
||||
pas.Identifier = PAS.GetNewIdentifier(this._pasMessage.Elements);
|
||||
importPassenger.Add(pas);
|
||||
pas.PassengerDateOfBirth = reader.GetDateTime(8);
|
||||
}
|
||||
} while (reader.NextResult());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
if (!reader.IsDBNull(9)) pas.PassengerIdentityDocumentType = GlobalStructures.ReadIdentityDocumentType(reader.GetString(9));
|
||||
if (!reader.IsDBNull(10)) pas.PassengerIdentityDocumentId = this.getValueAsString(reader, 10);
|
||||
if (!reader.IsDBNull(11)) pas.PassengerVisaNumber = this.getValueAsString(reader, 11);
|
||||
|
||||
if (importPassenger.Count > 0)
|
||||
{
|
||||
this._pasMessage.Elements.AddRange(importPassenger);
|
||||
this.dataGridPassengerList.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.PAS);
|
||||
}
|
||||
pas.MessageHeader = this._pasMessage;
|
||||
pas.Identifier = PAS.GetNewIdentifier(this._pasMessage.Elements);
|
||||
importPassenger.Add(pas);
|
||||
}
|
||||
} while (reader.NextResult());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
if (importPassenger.Count > 0)
|
||||
{
|
||||
this._pasMessage.Elements.AddRange(importPassenger);
|
||||
this.dataGridPassengerList.Items.Refresh();
|
||||
this.SublistElementChanged(Message.NotificationClass.PAS);
|
||||
}
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<TabControl Name="tabControlPositions" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="5">
|
||||
<TabItem Header="{x:Static p:Resources.textIMDGItems}" Name="tabIMDGItems">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridIMDGItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="80" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="80" />
|
||||
@ -80,7 +80,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.textIBCItems}" Name="tabIBCItems">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridIBCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textProductName}" Binding="{Binding ProductName}" IsReadOnly="True" Width="auto" />
|
||||
@ -99,7 +99,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.textIGCItems}" Name="tabIGCItems">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridIGCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textProductName}" Binding="{Binding ProductName}" IsReadOnly="True" Width="auto" />
|
||||
@ -115,7 +115,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.textIMSBCItems}" Name="tabIMSBCItems">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridIMSBCItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBulkCargoShippingName}" Binding="{Binding BulkCargoShippingName}" IsReadOnly="True" Width="auto" />
|
||||
@ -132,7 +132,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static p:Resources.textMARPOLItems}" Name="tabMarpolItems">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridMARPOLItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding Name}" IsReadOnly="True" Width="auto" />
|
||||
|
||||
@ -66,8 +66,9 @@
|
||||
</GroupBox>
|
||||
<GroupBox Name="bkrdGroupBox" Header="{x:Static p:Resources.textBunkerOnDeparture}" Grid.Row="3">
|
||||
<enictrl:ENIDataGrid x:Name="dataGridBKRD" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerType}" Binding="{Binding BunkerFuelType}" IsReadOnly="True" Width="0.2*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textBunkerQuantity}" Binding="{Binding BunkerFuelQuantity_TNE, Mode=TwoWay}" IsReadOnly="True" Width="0.8*" />
|
||||
</DataGrid.Columns>
|
||||
|
||||
@ -88,6 +88,7 @@
|
||||
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfCallLast30Days" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortCall}" Binding="{Binding PortOfCallLast30DaysLocode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textATDPortOfCall}" Binding="{Binding PortOfCallLast30DaysDateOfDeparture, StringFormat=d}" IsReadOnly="True" Width="0.1*" />
|
||||
|
||||
@ -110,19 +111,22 @@
|
||||
<TabItem Header="{x:Static p:Resources.textVisitsInfectedAreas}" Name="tabInfectedAreas">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="30*" />
|
||||
<ColumnDefinition Width="95*"/>
|
||||
<ColumnDefinition Width="374*" />
|
||||
<ColumnDefinition Width="60*" />
|
||||
<ColumnDefinition Width="190*"/>
|
||||
<ColumnDefinition Width="430*" />
|
||||
<ColumnDefinition Width="17*"/>
|
||||
<ColumnDefinition Width="301*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="200"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShipVisitedInfectedArea}" Name="labelHasShipVisited" Margin="0,0,10,0" Grid.ColumnSpan="2"/>
|
||||
<CheckBox Name="checkBoxHasShipVisited" IsChecked="{Binding MDHSimplification}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="0,7"/>
|
||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" x:Name="dataGridInfectedAreas" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
<CheckBox Name="checkBoxHasShipVisited" IsChecked="{Binding MDHSimplification}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="0,8,0,7" Grid.ColumnSpan="3"/>
|
||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" x:Name="dataGridInfectedAreas" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textInfectedAreaPort}" Binding="{Binding InfectedAreaPort, Mode=TwoWay}" IsReadOnly="True" Width="0.5*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textInfectedAreaPort}" Binding="{Binding InfectedAreaDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.5*" />
|
||||
</DataGrid.Columns>
|
||||
@ -144,6 +148,7 @@
|
||||
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridSanitaryMeasures" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasureKind}" Binding="{Binding SanitaryMeasuresType, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasurePlace}" Binding="{Binding SanitaryMeasuresLocation, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textSanitaryMeasureDate}" Binding="{Binding SanitaryMeasuresDate, Mode=TwoWay, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.3*" />
|
||||
|
||||
@ -107,6 +107,8 @@
|
||||
-->
|
||||
</StackPanel>
|
||||
<Label Grid.Column="0" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelCancelled" VerticalContentAlignment="Center" FontWeight="Bold" />
|
||||
<Label Grid.Column="1" Grid.Row="7" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelHIS" VerticalContentAlignment="Center" Content="{x:Static p:Resources.textSendToHIS}" />
|
||||
<ComboBox Grid.Column="2" Grid.Row="7" Margin="2" Name="comboBoxInitialHis" VerticalContentAlignment="Center" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding Path=InitialHIS}" />
|
||||
|
||||
<!-- Data Grid -->
|
||||
<DataGrid Grid.Row="9" Grid.ColumnSpan="6" Margin="0,8,0,0" x:Name="dataGridMessages" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" CanUserAddRows="False"
|
||||
@ -194,6 +196,18 @@
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image x:Name="imageReset"/>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=Reset}" Value="True">
|
||||
<Setter Property="Source" Value="/Resources/refresh.png" TargetName="imageReset"/>
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.15*">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
|
||||
@ -64,6 +64,9 @@ namespace ENI2.DetailViewControls
|
||||
|
||||
this.labelCreated.Content = this.Core.Created?.ToString();
|
||||
|
||||
this.comboBoxInitialHis.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(Message.NSWProvider));
|
||||
this.comboBoxInitialHis.DataContext = this.Core;
|
||||
|
||||
Binding vtBinding = new Binding();
|
||||
vtBinding.Source = this.Core;
|
||||
vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId");
|
||||
@ -435,6 +438,7 @@ namespace ENI2.DetailViewControls
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
this.Core.Cancelled = true;
|
||||
this.Core.BSMDStatusInternal = MessageCore.BSMDStatus.TOSEND;
|
||||
this.ShowCancelledLabel();
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
|
||||
}
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridCallPurposes" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding CallPurposeCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding CallPurposeDescription, Mode=TwoWay}" IsReadOnly="True" Width="0.9*" />
|
||||
</DataGrid.Columns>
|
||||
|
||||
@ -70,6 +70,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textServiceName}" Binding="{Binding ServiceName, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textServiceBeneficiary}" Binding="{Binding ServiceBeneficiary, Mode=TwoWay}" IsReadOnly="True" Width="0.3*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
|
||||
@ -81,6 +82,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoHandlingType}" Binding="{Binding CargoHandlingTypeDisplay}" IsReadOnly="True" Width="0.15*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLACodes}" Binding="{Binding CargoLACode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCargoCodeNST}" Binding="{Binding CargoCodeNST, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
|
||||
@ -95,6 +95,7 @@
|
||||
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortFacilityPortName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortLocode}" Binding="{Binding PortFacilityPortLoCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPortCountry}" Binding="{Binding PortFacilityPortCountry}" IsReadOnly="True" Width="0.1*" />
|
||||
@ -121,6 +122,7 @@
|
||||
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLocationName}" Binding="{Binding ShipToShipActivityLocationName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textLocationLocode}" Binding="{Binding ShipToShipActivityLocationLoCode, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDateFrom}" Binding="{Binding ShipToShipActivityDateFrom, StringFormat=\{0:dd.MM.yyyy\}}" IsReadOnly="True" Width="0.1*" />
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridTowageOnArrival" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnArrivalName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textPurposeOfCall}" Binding="{Binding TowageOnArrivalPurposeOfCall}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnArrivalFlag}" IsReadOnly="True" Width="Auto" />
|
||||
@ -44,6 +45,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridTowageOnDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnDepartureName}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textFlag}" Binding="{Binding TowageOnDepartureFlag}" IsReadOnly="True" Width="Auto" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDraughtInDecimetre}" Binding="{Binding TowageOnDepartureDraught_DMT}" IsReadOnly="True" Width="Auto" />
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
<enictrl:ENIDataGrid x:Name="dataGridWaste" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding WasteTypeDisplayGrid}" IsReadOnly="True" Width="0.2*" />
|
||||
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding WasteDescription}" IsReadOnly="True" Width="0.15*" />
|
||||
<DataGridTemplateColumn IsReadOnly="True" Width="0.1*">
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>3.7.1.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
@ -166,6 +166,9 @@
|
||||
<Link>Locode\LocodeDB.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ClosableTabItem.cs" />
|
||||
<Compile Include="Controls\ConditionGroupControl.xaml.cs">
|
||||
<DependentUpon>ConditionGroupControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\EditWindowBase.cs" />
|
||||
<Compile Include="Controls\ENIDataGrid.cs" />
|
||||
<Compile Include="Controls\IHighlightControlContainer.cs" />
|
||||
@ -318,6 +321,9 @@
|
||||
<Compile Include="Util\BoolToVisibilityConverter.cs" />
|
||||
<Compile Include="Util\ByteConverter.cs" />
|
||||
<Compile Include="Util\DatabaseEntityWatchdog.cs" />
|
||||
<Compile Include="Util\EnumHelper.cs" />
|
||||
<Compile Include="Util\EnumToBooleanConverter.cs" />
|
||||
<Compile Include="Util\EnumToCollectionConverter.cs" />
|
||||
<Compile Include="Util\GlobalStructures.cs" />
|
||||
<Compile Include="Util\HighlightService.cs" />
|
||||
<Compile Include="Util\InverseBooleanConverter.cs" />
|
||||
@ -332,6 +338,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\ConditionGroupControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Controls\LocodeControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -614,6 +624,7 @@
|
||||
<Resource Include="Resources\logic_not.png" />
|
||||
<Resource Include="Resources\logic_or.png" />
|
||||
<Resource Include="Resources\logic_xor.png" />
|
||||
<Resource Include="Resources\refresh.png" />
|
||||
<Content Include="x64\SQLite.Interop.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
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:local="clr-namespace:ENI2.EditControls"
|
||||
xmlns:db="clr-namespace:bsmd.database;assembly=bsmd.database"
|
||||
xmlns:enictrl="clr-namespace:ENI2.Controls"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:p="clr-namespace:ENI2.Properties"
|
||||
@ -37,9 +38,44 @@
|
||||
<TextBlock Name="textBlockCreatedBy" Grid.Row="2" Grid.Column="3" FontWeight="Bold" VerticalAlignment="Center" />
|
||||
<Label Name="labelIsActive" Content="{x:Static p:Resources.textIsActive}" Grid.Row="3" Grid.Column="0" HorizontalContentAlignment="Right" VerticalContentAlignment="Center" />
|
||||
<CheckBox Name="checkBoxIsActive" Grid.Row="3" Grid.Column="1" VerticalContentAlignment="Center" Margin="2" />
|
||||
<TreeView Name="treeViewRules" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="2"/>
|
||||
<TreeView Name="treeViewRules" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="4, 10, 4, 2" SelectedItemChanged="treeViewRules_SelectedItemChanged">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type db:ConditionGroup}" ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image x:Name="groupImg" Source="../Resources/logic_or.png" Margin="0,0,2,0" />
|
||||
<TextBlock x:Name="groupName" Text="{Binding Name}" VerticalAlignment="Center" FontWeight="Bold" />
|
||||
<!--TextBlock Text="{x:Static p:Resources.textGroup}" VerticalAlignment="Center" /-->
|
||||
</StackPanel>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding GroupOperator}" Value="{x:Static db:ConditionGroup+GroupOperatorEnum.AND}" >
|
||||
<Setter TargetName="groupImg" Property="Source" Value="../Resources/logic_and.png" />
|
||||
<Setter TargetName="groupName" Property="Text" Value="AND" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding GroupOperator}" Value="{x:Static db:ConditionGroup+GroupOperatorEnum.OR}">
|
||||
<Setter TargetName="groupImg" Property="Source" Value="../Resources/logic_or.png" />
|
||||
<Setter TargetName="groupName" Property="Text" Value="OR" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding GroupOperator}" Value="{x:Static db:ConditionGroup+GroupOperatorEnum.XOR}">
|
||||
<Setter TargetName="groupImg" Property="Source" Value="../Resources/logic_xor.png" />
|
||||
<Setter TargetName="groupName" Property="Text" Value="XOR" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding GroupOperator}" Value="{x:Static db:ConditionGroup+GroupOperatorEnum.NOT}">
|
||||
<Setter TargetName="groupImg" Property="Source" Value="../Resources/logic_not.png" />
|
||||
<Setter TargetName="groupName" Property="Text" Value="NOT" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type db:ValidationCondition}" ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="../Resources/bullet_ball_grey.png" Margin="0,0,2,0" />
|
||||
<TextBlock Text="{Binding FieldName}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.Resources>
|
||||
</TreeView>
|
||||
|
||||
<GroupBox Name="groupBoxConditionDetails" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" Margin="0" Header="{x:Static p:Resources.textCondition}">
|
||||
<Grid>
|
||||
<Grid Name="groupBoxConditionContainer">
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
@ -9,6 +9,7 @@ using ENI2.Controls;
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace ENI2.EditControls
|
||||
{
|
||||
@ -17,6 +18,10 @@ namespace ENI2.EditControls
|
||||
/// </summary>
|
||||
public partial class EditRulesDialog : EditWindowBase
|
||||
{
|
||||
private ConditionGroup rootCondition;
|
||||
private ObservableCollection<ConditionGroup> rootGroupList = new ObservableCollection<ConditionGroup>();
|
||||
private ConditionGroupControl groupControl = new ConditionGroupControl();
|
||||
|
||||
public EditRulesDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -27,88 +32,9 @@ namespace ENI2.EditControls
|
||||
|
||||
public bsmd.database.ValidationRule ValidationRule { get; set; }
|
||||
|
||||
public ConditionGroup RootCondition
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.treeViewRules.Items.Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConditionGroup cg = new ConditionGroup();
|
||||
cg.Conditions = new List<ValidationCondition>();
|
||||
cg.SubGroups = new List<ConditionGroup>();
|
||||
cg.GroupOperator = ((GroupNode)this.treeViewRules.Items[0]).ConditionGroup.GroupOperator;
|
||||
this.BuildConditionGroups(this.treeViewRules.Items, cg);
|
||||
return cg;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null) return;
|
||||
GroupNode rootNode = this.CreateGroupNode(value);
|
||||
this.treeViewRules.Items.Add(rootNode);
|
||||
this.BuildTree(rootNode.Items, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void BuildTree(ItemCollection items, ConditionGroup root)
|
||||
{
|
||||
if (root.Conditions == null)
|
||||
root.Conditions = new List<ValidationCondition>();
|
||||
|
||||
foreach (ValidationCondition vc in root.Conditions)
|
||||
{
|
||||
ConditionNode cn = new ConditionNode();
|
||||
cn.Condition = vc;
|
||||
cn.Header = cn.ToString();
|
||||
//cn.ImageIndex = 4; // TODO : set image
|
||||
//cn.SelectedImageIndex = 4;
|
||||
items.Add(cn);
|
||||
}
|
||||
|
||||
if (root.SubGroups == null)
|
||||
root.SubGroups = new List<ConditionGroup>();
|
||||
|
||||
foreach (ConditionGroup cg in root.SubGroups)
|
||||
{
|
||||
GroupNode gn = this.CreateGroupNode(cg);
|
||||
items.Add(gn);
|
||||
this.BuildTree(gn.Items, cg);
|
||||
}
|
||||
}
|
||||
|
||||
private GroupNode CreateGroupNode(ConditionGroup cg)
|
||||
{
|
||||
GroupNode gn = new GroupNode();
|
||||
gn.ConditionGroup = cg;
|
||||
gn.Header = gn.ToString();
|
||||
|
||||
// TODO: Icon setzen je nach typ
|
||||
|
||||
|
||||
return gn;
|
||||
}
|
||||
|
||||
private void BuildConditionGroups(ItemCollection items, ConditionGroup parent)
|
||||
{
|
||||
foreach(TreeViewItem node in items)
|
||||
{
|
||||
if(node is ConditionNode)
|
||||
{
|
||||
parent.Conditions.Add(((ConditionNode)node).Condition);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConditionGroup cg = ((GroupNode) node).ConditionGroup;
|
||||
cg.Conditions.Clear();
|
||||
parent.SubGroups.Add(cg);
|
||||
this.BuildConditionGroups(node.Items, cg); // recurse down
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@ -124,8 +50,28 @@ namespace ENI2.EditControls
|
||||
|
||||
// TODO: init logic tree with rule
|
||||
|
||||
this.rootCondition = ValidationCondition.LoadFromString(this.ValidationRule.Rule);
|
||||
if(this.rootCondition == null)
|
||||
{
|
||||
this.rootCondition = new ConditionGroup();
|
||||
this.rootCondition.GroupOperator = ConditionGroup.GroupOperatorEnum.OR;
|
||||
/* testing
|
||||
this.rootCondition.SubGroups.Add(new ConditionGroup() { GroupOperator = ConditionGroup.GroupOperatorEnum.NOT });
|
||||
this.rootCondition.SubGroups.Add(new ConditionGroup() { GroupOperator = ConditionGroup.GroupOperatorEnum.AND });
|
||||
this.rootCondition.SubGroups.Add(new ConditionGroup() { GroupOperator = ConditionGroup.GroupOperatorEnum.XOR });
|
||||
this.rootCondition.Conditions.Add(new ValidationCondition()
|
||||
{
|
||||
FieldName = "Bla"
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
this.rootGroupList.Add(this.rootCondition);
|
||||
|
||||
this.treeViewRules.ItemsSource = this.rootGroupList;
|
||||
|
||||
this.OKClicked += EditRulesDialog_OKClicked;
|
||||
this.AddVisible = false;
|
||||
this.AddVisible = false;
|
||||
|
||||
// init tree context Menu
|
||||
this.treeViewRules.ContextMenu = new ContextMenu();
|
||||
@ -136,6 +82,12 @@ namespace ENI2.EditControls
|
||||
addItem.Click += this.createNewGroup;
|
||||
this.treeViewRules.ContextMenu.Items.Add(addItem);
|
||||
|
||||
MenuItem addConditionItem = new MenuItem();
|
||||
addConditionItem.Header = Properties.Resources.textNewCondition;
|
||||
addConditionItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/check.png")) };
|
||||
addConditionItem.Click += this.createNewCondition;
|
||||
this.treeViewRules.ContextMenu.Items.Add(addConditionItem);
|
||||
|
||||
MenuItem deleteItem = new MenuItem();
|
||||
deleteItem.Header = Properties.Resources.textDelete;
|
||||
deleteItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/delete.png")) };
|
||||
@ -146,12 +98,35 @@ namespace ENI2.EditControls
|
||||
|
||||
private void deleteItem(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
object selectedNode = this.treeViewRules.SelectedItem;
|
||||
if (selectedNode == null) return;
|
||||
if(selectedNode is ConditionGroup)
|
||||
{
|
||||
this.rootCondition.Remove(selectedNode as ConditionGroup);
|
||||
}
|
||||
else if (selectedNode is ValidationCondition)
|
||||
{
|
||||
this.rootCondition.RemoveCondition(selectedNode as ValidationCondition);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewGroup(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (treeViewRules.SelectedItem == null) return;
|
||||
if (!(treeViewRules.SelectedItem is ConditionGroup)) return;
|
||||
|
||||
ConditionGroup newGroup = new ConditionGroup();
|
||||
((ConditionGroup)treeViewRules.SelectedItem).SubGroups.Add(newGroup);
|
||||
}
|
||||
|
||||
private void createNewCondition(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (treeViewRules.SelectedItem == null) return;
|
||||
if (!(treeViewRules.SelectedItem is ConditionGroup)) return;
|
||||
|
||||
ValidationCondition newCondition = new ValidationCondition();
|
||||
((ConditionGroup)treeViewRules.SelectedItem).Conditions.Add(newCondition);
|
||||
|
||||
}
|
||||
|
||||
public void CopyValuesToEntity()
|
||||
@ -161,9 +136,7 @@ namespace ENI2.EditControls
|
||||
this.ValidationRule.IsActive = this.checkBoxIsActive.IsChecked;
|
||||
|
||||
// TODO: serialize logical tree back into string
|
||||
this.ValidationRule.Rule = bsmd.database.ValidationCondition.SaveToString(this.RootCondition);
|
||||
|
||||
|
||||
this.ValidationRule.Rule = bsmd.database.ValidationCondition.SaveToString(this.rootCondition);
|
||||
}
|
||||
|
||||
private void EditRulesDialog_OKClicked()
|
||||
@ -171,40 +144,27 @@ namespace ENI2.EditControls
|
||||
this.CopyValuesToEntity();
|
||||
}
|
||||
|
||||
#region class GroupNode
|
||||
|
||||
internal class GroupNode : TreeViewItem
|
||||
private void treeViewRules_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||
{
|
||||
public ConditionGroup ConditionGroup { get; set; }
|
||||
this.groupBoxConditionContainer.Children.Clear();
|
||||
|
||||
public override string ToString()
|
||||
if (treeViewRules.SelectedItem == null)
|
||||
{
|
||||
if (this.ConditionGroup == null) return "+++";
|
||||
return string.Format("{0}", Enum.GetName(typeof(ConditionGroup.GroupOperatorEnum), this.ConditionGroup.GroupOperator));
|
||||
// unselect, clear groupview
|
||||
this.groupBoxConditionDetails.Header = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region class ConditionNode
|
||||
|
||||
internal class ConditionNode : TreeViewItem
|
||||
{
|
||||
public ValidationCondition Condition { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
else if(treeViewRules.SelectedItem is ConditionGroup)
|
||||
{
|
||||
if (this.Condition == null) return "---";
|
||||
return string.Format("{0} {1} {2}",
|
||||
this.Condition.FieldName,
|
||||
Enum.GetName(typeof(ValidationCondition.ConditionOperatorEnum), this.Condition.ConditionOperator),
|
||||
this.Condition.Value);
|
||||
// ConditionGroup
|
||||
this.groupBoxConditionDetails.Header = Properties.Resources.textGroup;
|
||||
this.groupControl.ConditionGroup = (ConditionGroup)treeViewRules.SelectedItem;
|
||||
this.groupBoxConditionContainer.Children.Add(this.groupControl);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Condition
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ namespace ENI2.EditControls
|
||||
|
||||
this.TOWA.TowageOnArrivalOperatorCompanyName = this.textBoxOperatorName.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorStreetNameAndNumber = this.textBoxStreetNumber.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorPostalCode = this.textBoxPurposeOfCall.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorPostalCode = this.textBoxPostalCode.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorCountry = this.textBoxCountry.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorPhone = this.textBoxPhone.Text.Trim();
|
||||
this.TOWA.TowageOnArrivalOperatorEmail = this.textBoxEMail.Text.Trim();
|
||||
|
||||
@ -66,13 +66,15 @@
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</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="buttonNewWithId" Content="{x:Static p:Resources.textNewWithId}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="buttonNewWithIdClick" Background="Transparent" Margin="2"/>
|
||||
<Button Grid.Column="3" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="buttonUserAdmin_Click" Background="Transparent" Visibility="Hidden" Margin="2"/>
|
||||
<Button Grid.Column="4" x:Name="buttonEditRules" Content="{x:Static p:Resources.textEditRules}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="buttonEditRules_Click" Background="Transparent" Visibility="Hidden" Margin="2" />
|
||||
<RadioButton Grid.Column="3" x:Name="buttonNotifications" Content="{x:Static p:Resources.textNotifications}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2" IsChecked="True" />
|
||||
<RadioButton Grid.Column="4" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2"/>
|
||||
<RadioButton Grid.Column="5" x:Name="buttonEditRules" Content="{x:Static p:Resources.textEditRules}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2" />
|
||||
</Grid>
|
||||
|
||||
<Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF">
|
||||
|
||||
@ -31,8 +31,6 @@ namespace ENI2
|
||||
|
||||
#region Fields
|
||||
|
||||
private bool userAdministrationVisible;
|
||||
private bool rulesVisible;
|
||||
private ReportingPartyControl rpControl;
|
||||
private RuleControl ruleControl;
|
||||
private bool dbConnected;
|
||||
@ -110,10 +108,10 @@ namespace ENI2
|
||||
DetailRootControl drc = new DetailRootControl(aMessageCore);
|
||||
drc.LockedByOtherUser = !iDidLockIt;
|
||||
|
||||
if (!aMessageCore.Cancelled ?? false)
|
||||
{
|
||||
//if (!aMessageCore.Cancelled ?? false)
|
||||
//{
|
||||
drc.LockedBy = iDidLockIt ? this.userEntity : DBManager.Instance.GetReportingPartyDict()[lockedUserId];
|
||||
}
|
||||
//}
|
||||
|
||||
searchResultItem.Content = drc;
|
||||
this.mainFrame.Items.Add(searchResultItem);
|
||||
@ -180,52 +178,34 @@ namespace ENI2
|
||||
else Process.Start("http://www.eureport.de/");
|
||||
}
|
||||
|
||||
private void buttonUserAdmin_Click(object sender, RoutedEventArgs e)
|
||||
private void radioButton_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
|
||||
}
|
||||
this.rootContainer.Children.Clear();
|
||||
|
||||
private void buttonEditRules_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(this.rulesVisible)
|
||||
if(sender == this.buttonNotifications)
|
||||
{
|
||||
this.rootContainer.Children.Remove(ruleControl);
|
||||
this.rootContainer.Children.Add(this.mainFrame);
|
||||
this.buttonEditRules.Content = Properties.Resources.textEditRules;
|
||||
}
|
||||
else
|
||||
else if(sender == this.buttonUserAdmin)
|
||||
{
|
||||
this.rootContainer.Children.Remove(this.mainFrame);
|
||||
if(this.ruleControl == null)
|
||||
if (this.rpControl == null)
|
||||
{
|
||||
this.rpControl = new ReportingPartyControl();
|
||||
Dictionary<Guid, ReportingParty> repPartyDict = DBManager.Instance.GetReportingPartyDict();
|
||||
this.rpControl.ReportingParties = new List<ReportingParty>(repPartyDict.Values);
|
||||
}
|
||||
this.rootContainer.Children.Add(this.rpControl);
|
||||
}
|
||||
else if(sender == this.buttonEditRules)
|
||||
{
|
||||
if (this.ruleControl == null)
|
||||
{
|
||||
this.ruleControl = new RuleControl();
|
||||
this.ruleControl.UserEntity = this.userEntity;
|
||||
this.ruleControl.ValidationRules = DBManager.Instance.GetValidationRules();
|
||||
}
|
||||
this.rootContainer.Children.Add(ruleControl);
|
||||
this.buttonEditRules.Content = Properties.Resources.textNotifications;
|
||||
}
|
||||
this.rulesVisible = !this.rulesVisible;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -492,6 +472,10 @@ namespace ENI2
|
||||
this.buttonUserAdmin.Visibility = Visibility.Visible;
|
||||
this.buttonEditRules.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonNotifications.IsEnabled = false;
|
||||
}
|
||||
break;
|
||||
case ReportingParty.LogonResult.FAILED:
|
||||
this.labelLoginResult.Content = Properties.Resources.textWrongPassword;
|
||||
|
||||
28
ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
generated
28
ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
generated
@ -560,6 +560,16 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
public static System.Drawing.Bitmap refresh {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("refresh", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@ -1879,6 +1889,15 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Group.
|
||||
/// </summary>
|
||||
public static string textGroup {
|
||||
get {
|
||||
return ResourceManager.GetString("textGroup", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Border police notification.
|
||||
/// </summary>
|
||||
@ -3454,6 +3473,15 @@ namespace ENI2.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Send to HIS.
|
||||
/// </summary>
|
||||
public static string textSendToHIS {
|
||||
get {
|
||||
return ResourceManager.GetString("textSendToHIS", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Send to NSW.
|
||||
/// </summary>
|
||||
|
||||
@ -1486,4 +1486,13 @@
|
||||
<data name="textNewGroup" xml:space="preserve">
|
||||
<value>New group</value>
|
||||
</data>
|
||||
<data name="refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\refresh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="textSendToHIS" xml:space="preserve">
|
||||
<value>Send to HIS</value>
|
||||
</data>
|
||||
<data name="textGroup" xml:space="preserve">
|
||||
<value>Group</value>
|
||||
</data>
|
||||
</root>
|
||||
BIN
ENI-2/ENI2/ENI2/Resources/refresh.png
Normal file
BIN
ENI-2/ENI2/ENI2/Resources/refresh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
29
ENI-2/ENI2/ENI2/Util/EnumHelper.cs
Normal file
29
ENI-2/ENI2/ENI2/Util/EnumHelper.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ENI2.Util
|
||||
{
|
||||
public static class EnumHelper
|
||||
{
|
||||
public static string Description (this Enum eValue)
|
||||
{
|
||||
var nAttributes = eValue.GetType().GetField(eValue.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
if (nAttributes.Any())
|
||||
return (nAttributes.First() as DescriptionAttribute).Description;
|
||||
return eValue.ToString();
|
||||
}
|
||||
|
||||
public static IEnumerable<KeyValuePair<string, string>> GetAllValuesAndDescription(Type t)
|
||||
{
|
||||
if (!t.IsEnum)
|
||||
throw new ArgumentException("t must be an enum");
|
||||
return from e in Enum.GetValues(t).Cast<Enum>()
|
||||
select new KeyValuePair<string, string>(e.ToString(), e.Description());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
38
ENI-2/ENI2/ENI2/Util/EnumToBooleanConverter.cs
Normal file
38
ENI-2/ENI2/ENI2/Util/EnumToBooleanConverter.cs
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright (c) 2017 schick Informatik
|
||||
// Description:
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace ENI2.Util
|
||||
{
|
||||
/// <summary>
|
||||
/// Um ein ENUM an Radiobuttons zu binden
|
||||
/// </summary>
|
||||
public class EnumToBooleanConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
private static EnumToBooleanConverter _converter;
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value.Equals(parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value.Equals(true) ? parameter : Binding.DoNothing;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
if (_converter == null)
|
||||
{
|
||||
_converter = new EnumToBooleanConverter();
|
||||
}
|
||||
return _converter;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
ENI-2/ENI2/ENI2/Util/EnumToCollectionConverter.cs
Normal file
30
ENI-2/ENI2/ENI2/Util/EnumToCollectionConverter.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace ENI2.Util
|
||||
{
|
||||
[ValueConversion(typeof(Enum), typeof(IEnumerable<KeyValuePair<string, string>>))]
|
||||
public class EnumToCollectionConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return EnumHelper.GetAllValuesAndDescription(value.GetType());
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -58,7 +58,8 @@ namespace bsmd.ExcelReadService
|
||||
|
||||
ScanPAS(messages, messageCore, reader);
|
||||
|
||||
// BPOL nicht im sheet
|
||||
// BPOL wieder reingenommen nach RS mit CH (27.9.17)
|
||||
ScanBPOL(messages, messageCore, reader);
|
||||
|
||||
ScanTOWA(messages, messageCore, reader);
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ namespace bsmd.database
|
||||
|
||||
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
|
||||
{
|
||||
string query = string.Format("SELECT Id, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier FROM {0}", this.Tablename);
|
||||
string query = string.Format("SELECT Id, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier FROM {0} ", this.Tablename);
|
||||
|
||||
switch (filter)
|
||||
{
|
||||
@ -85,6 +85,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ namespace bsmd.database
|
||||
|
||||
public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
|
||||
{
|
||||
string query = string.Format("SELECT Id, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier FROM {0}", this.Tablename);
|
||||
string query = string.Format("SELECT Id, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier FROM {0} ", this.Tablename);
|
||||
|
||||
switch (filter)
|
||||
{
|
||||
@ -84,7 +84,7 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY Identifier";
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ namespace bsmd.database
|
||||
switch (filter)
|
||||
{
|
||||
case Message.LoadFilter.NOA_NODID:
|
||||
query += " WHERE NOA_NODId = @NNID";
|
||||
query += " WHERE NOA_NODId = @NNID ";
|
||||
((SqlCommand)cmd).Parameters.AddWithValue("@NNID", criteria[0]);
|
||||
break;
|
||||
case Message.LoadFilter.ALL:
|
||||
@ -76,7 +76,7 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -138,5 +138,13 @@ namespace bsmd.database
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string Truncate(this string str, int length)
|
||||
{
|
||||
if (length < 0) throw new ArgumentOutOfRangeException("length", "length must be >= 0");
|
||||
if (str == null) return null;
|
||||
int maxLen = Math.Min(str.Length, length);
|
||||
return str.Substring(0, maxLen);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,6 +193,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -116,6 +116,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -319,6 +319,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -121,6 +121,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,9 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -126,6 +126,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -168,12 +169,17 @@ namespace bsmd.database
|
||||
/// </summary>
|
||||
public enum NSWProvider
|
||||
{
|
||||
[Description("Unspecified")]
|
||||
UNDEFINED,
|
||||
DBH,
|
||||
DAKOSY,
|
||||
[Description("HIS-Nord")]
|
||||
DUDR,
|
||||
[Description("DBH Testsystem")]
|
||||
DBH_TEST,
|
||||
[Description("Dakosy Testsystem")]
|
||||
DAKOSY_TEST,
|
||||
[Description("HIS-Nord Testsystem")]
|
||||
DUDR_TEST
|
||||
}
|
||||
|
||||
@ -517,6 +523,29 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsListClass(NotificationClass notificationClass)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
switch(notificationClass)
|
||||
{
|
||||
case NotificationClass.BKRA:
|
||||
case NotificationClass.BKRD:
|
||||
case NotificationClass.CREW:
|
||||
case NotificationClass.CREWD:
|
||||
case NotificationClass.LADG:
|
||||
case NotificationClass.PAS:
|
||||
case NotificationClass.PASD:
|
||||
case NotificationClass.SERV:
|
||||
case NotificationClass.STO:
|
||||
case NotificationClass.TOWA:
|
||||
case NotificationClass.TOWD:
|
||||
return true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ISublistContainer implementation
|
||||
|
||||
@ -180,7 +180,7 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY Identifier";
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
@ -160,6 +160,9 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -76,6 +76,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +85,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
|
||||
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||
[assembly: AssemblyInformationalVersion("3.7.0")]
|
||||
[assembly: AssemblyInformationalVersion("3.7.1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("3.7.0.*")]
|
||||
[assembly: AssemblyVersion("3.7.1.*")]
|
||||
|
||||
|
||||
@ -103,6 +103,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -86,6 +86,9 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -75,6 +75,9 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -73,6 +73,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -172,6 +172,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -159,6 +159,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -154,11 +154,16 @@ namespace bsmd.database
|
||||
message.CreatedBy = string.Format("ENI-2: {0}", user.Logon);
|
||||
message.MessageCore = core;
|
||||
message.MessageCoreId = core.Id;
|
||||
message.MessageNotificationClass = notificationClass;
|
||||
DatabaseEntity classElement = DBManager.CreateMessage(notificationClass);
|
||||
message.MessageNotificationClass = notificationClass;
|
||||
|
||||
// abgesehen von "Listen" für die Nachrichtenklassen auch untergeordnete Elemente erzeugen
|
||||
DatabaseEntity classElement = null;
|
||||
if (!Message.IsListClass(notificationClass))
|
||||
classElement = DBManager.CreateMessage(notificationClass);
|
||||
|
||||
DBManager.Instance.Save(message);
|
||||
|
||||
if (classElement != null) // null für Visit/Transit
|
||||
if (classElement != null) // null für Visit/Transit/List
|
||||
{
|
||||
classElement.MessageHeader = message;
|
||||
DBManager.Instance.Save(classElement);
|
||||
|
||||
@ -7,9 +7,13 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
[Serializable]
|
||||
public class ValidationCondition : ICloneable
|
||||
{
|
||||
private static ILog log = LogManager.GetLogger(typeof(ValidationCondition));
|
||||
@ -33,6 +37,7 @@ namespace bsmd.database
|
||||
public string Value { get; set; }
|
||||
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@ -266,9 +271,14 @@ namespace bsmd.database
|
||||
XOR
|
||||
}
|
||||
|
||||
public ConditionGroup() { }
|
||||
public ConditionGroup() {
|
||||
Conditions = new ObservableCollection<ValidationCondition>();
|
||||
SubGroups = new ObservableCollection<ConditionGroup>();
|
||||
}
|
||||
|
||||
public List<ValidationCondition> Conditions
|
||||
#region Properties
|
||||
|
||||
public ObservableCollection<ValidationCondition> Conditions
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@ -280,12 +290,59 @@ namespace bsmd.database
|
||||
set;
|
||||
}
|
||||
|
||||
public List<ConditionGroup> SubGroups
|
||||
public ObservableCollection<ConditionGroup> SubGroups
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public IList Children
|
||||
{
|
||||
get
|
||||
{
|
||||
return new CompositeCollection()
|
||||
{
|
||||
new CollectionContainer() { Collection = SubGroups },
|
||||
new CollectionContainer() { Collection = Conditions }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return this.GroupOperator.ToString(); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public recursive removal methods
|
||||
|
||||
public void Remove(ConditionGroup group)
|
||||
{
|
||||
if(this.SubGroups.Contains(group))
|
||||
{
|
||||
this.SubGroups.Remove(group);
|
||||
return;
|
||||
}
|
||||
// try recursive
|
||||
foreach (ConditionGroup subGroup in this.SubGroups)
|
||||
subGroup.Remove(group);
|
||||
}
|
||||
|
||||
public void RemoveCondition(ValidationCondition condition)
|
||||
{
|
||||
if(this.Conditions.Contains(condition))
|
||||
{
|
||||
this.Conditions.Remove(condition);
|
||||
return;
|
||||
}
|
||||
// try recursive
|
||||
foreach (ConditionGroup subGroup in this.SubGroups)
|
||||
subGroup.RemoveCondition(condition);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -166,7 +166,7 @@ namespace bsmd.database
|
||||
|
||||
break;
|
||||
}
|
||||
query += " ORDER BY WasteType";
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
@ -78,6 +78,8 @@ namespace bsmd.database
|
||||
break;
|
||||
}
|
||||
|
||||
query += " ORDER BY CAST(Identifier AS INT)";
|
||||
|
||||
cmd.CommandText = query;
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -54,6 +55,7 @@
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AGNT.cs" />
|
||||
|
||||
@ -20,6 +20,7 @@ namespace bsmd.hisnord
|
||||
private string _visitId;
|
||||
private string _transitId;
|
||||
private Message.NotificationClass _notificationClass;
|
||||
private bool _isReset;
|
||||
|
||||
private List<MessageViolation> _violations = new List<MessageViolation>();
|
||||
private List<MessageError> _errors = new List<MessageError>();
|
||||
@ -62,7 +63,7 @@ namespace bsmd.hisnord
|
||||
XNamespace pasNS = "http://api.national-single-window.de/pas";
|
||||
XNamespace bpolNS = "http://api.national-single-window.de/bpol";
|
||||
XNamespace towaNS = "http://api.national-single-window.de/towa";
|
||||
XNamespace towdNS = "http://api.national-single-window.de/towa";
|
||||
XNamespace towdNS = "http://api.national-single-window.de/towd";
|
||||
|
||||
XName idName = "ConveyanceCode";
|
||||
var elem = xml.Descendants(idName);
|
||||
@ -83,6 +84,7 @@ namespace bsmd.hisnord
|
||||
foreach (Message.NotificationClass messageClassType in Enum.GetValues(typeof(Message.NotificationClass)))
|
||||
{
|
||||
XName lookupName;
|
||||
XName resetLookup;
|
||||
|
||||
switch (messageClassType)
|
||||
{
|
||||
@ -93,96 +95,130 @@ namespace bsmd.hisnord
|
||||
|
||||
case Message.NotificationClass.VISIT:
|
||||
lookupName = ns15 + "VisitIdResponse";
|
||||
resetLookup = ns15 + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.TRANSIT:
|
||||
lookupName = ns16 + "TransitIdResponse";
|
||||
resetLookup = ns16 + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.LADG:
|
||||
lookupName = ladgNS + "LADGResponse";
|
||||
resetLookup = ladgNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.HAZA:
|
||||
lookupName = hazaNS + "HAZAResponse";
|
||||
resetLookup = hazaNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.HAZD:
|
||||
lookupName = hazdNS + "HAZDResponse";
|
||||
resetLookup = hazdNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.MDH:
|
||||
lookupName = mdhNS + "MDHResponse";
|
||||
resetLookup = mdhNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.AGNT:
|
||||
lookupName = agntNS + "AGNTResponse";
|
||||
resetLookup = agntNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.SEC:
|
||||
lookupName = secNS + "SECResponse";
|
||||
resetLookup = secNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.STAT:
|
||||
lookupName = statNS + "STATResponse";
|
||||
resetLookup = statNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.NOA_NOD:
|
||||
lookupName = noa_nodNS + "NOA_NODResponse";
|
||||
resetLookup = noa_nodNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.ATA:
|
||||
lookupName = ataNS + "ATAResponse";
|
||||
resetLookup = ataNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.ATD:
|
||||
lookupName = atdNS + "ATDResponse";
|
||||
resetLookup = atdNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.POBA:
|
||||
lookupName = pobaNS + "POBAResponse";
|
||||
resetLookup = pobaNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.POBD:
|
||||
lookupName = pobdNS + "POBDResponse";
|
||||
resetLookup = pobdNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.NAME:
|
||||
lookupName = nameNS + "NAMEResponse";
|
||||
resetLookup = nameNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.TIEFA:
|
||||
lookupName = tiefaNS + "TIEFAResponse";
|
||||
resetLookup = tiefaNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.TIEFD:
|
||||
lookupName = tiefdNS + "TIEFDResponse";
|
||||
resetLookup = tiefdNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.BKRA:
|
||||
lookupName = bkraNS + "BKRAResponse";
|
||||
resetLookup = bkraNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.BKRD:
|
||||
lookupName = bkrdNS + "BKRDResponse";
|
||||
resetLookup = bkrdNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.INFO:
|
||||
lookupName = infoNS + "INFOResponse";
|
||||
resetLookup = infoNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.SERV:
|
||||
lookupName = servNS + "SERVResponse";
|
||||
resetLookup = servNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.PRE72H:
|
||||
lookupName = pre72hNS + "PRE72HResponse";
|
||||
resetLookup = pre72hNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.WAS:
|
||||
lookupName = wasNS + "WASResponse";
|
||||
resetLookup = wasNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.CREW:
|
||||
lookupName = crewNS + "CREWResponse";
|
||||
resetLookup = crewNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.PAS:
|
||||
lookupName = pasNS + "PASResponse";
|
||||
resetLookup = pasNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.BPOL:
|
||||
lookupName = bpolNS + "BPOLResponse";
|
||||
resetLookup = bpolNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.TOWA:
|
||||
lookupName = towaNS + "TOWAResponse";
|
||||
resetLookup = towaNS + "ResetResponse";
|
||||
break;
|
||||
case Message.NotificationClass.TOWD:
|
||||
lookupName = towdNS + "TOWDResponse";
|
||||
resetLookup = towdNS + "ResetResponse";
|
||||
break;
|
||||
default:
|
||||
lookupName = "dontmatchmeplease";
|
||||
resetLookup = "dontmatchmeplease";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(xml.Descendants(lookupName).Count() > 0)
|
||||
bool lookupMatch = (xml.Descendants(lookupName).Count() > 0);
|
||||
bool resetMatch = (xml.Descendants(resetLookup).Count() > 0);
|
||||
|
||||
if(lookupMatch || resetMatch)
|
||||
{
|
||||
|
||||
_isReset = resetMatch;
|
||||
|
||||
_notificationClass = messageClassType;
|
||||
|
||||
// match found
|
||||
@ -287,7 +323,9 @@ namespace bsmd.hisnord
|
||||
public List<MessageError> Errors { get { return _errors; } }
|
||||
|
||||
public Message.NotificationClass NotificationClass { get { return this._notificationClass; } }
|
||||
|
||||
|
||||
public bool IsReset { get { return this._isReset; } }
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@ -54,16 +54,22 @@ namespace bsmd.hisnord
|
||||
{
|
||||
core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
||||
|
||||
/*
|
||||
MessageError error = new MessageError();
|
||||
error.MessageHeaderId = visitTransitHeader.Id.Value;
|
||||
error.ErrorCode = theResult.code;
|
||||
|
||||
if ((theResult.detail != null) && (theResult.detail.Length > 255))
|
||||
error.ErrorText = theResult.detail.Substring(0, 255);
|
||||
Message helperRefMessage = null;
|
||||
if (core.IsTransit)
|
||||
helperRefMessage = DBManager.Instance.GetMessage(core, Message.NotificationClass.TRANSIT);
|
||||
else
|
||||
error.ErrorText = theResult.detail;
|
||||
*/
|
||||
helperRefMessage = DBManager.Instance.GetMessage(core, Message.NotificationClass.VISIT);
|
||||
|
||||
SystemError se = new SystemError();
|
||||
se.ErrorCode = theResult.code;
|
||||
se.ErrorMessage = theResult.message.Truncate(255);
|
||||
se.ErrorDescription = theResult.detail.Truncate(255);
|
||||
se.ErrorAt = DateTime.Now;
|
||||
se.MessageCoreId = core.Id.Value;
|
||||
if (helperRefMessage != null)
|
||||
se.MessageHeaderId = helperRefMessage.Id;
|
||||
|
||||
DBManager.Instance.Save(se);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -86,19 +92,29 @@ namespace bsmd.hisnord
|
||||
{
|
||||
if (noteMessageDict[notificationClass].InternalStatus == Message.BSMDStatus.TOSEND)
|
||||
{
|
||||
if (!XtraSendLogic.ShouldSendMessage(noteMessageDict[notificationClass]))
|
||||
// "leere" Nachrichten mit Listenelementen ausfiltern!
|
||||
if (Message.IsListClass(notificationClass) && (noteMessageDict[notificationClass].Elements.Count == 0))
|
||||
{
|
||||
_log.DebugFormat("skipping {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
||||
_log.DebugFormat("skipping empty list class {0},", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
||||
noteMessageDict[notificationClass].StatusInfo = "Meldeklasse ist leer";
|
||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
DBManager.Instance.Save(noteMessageDict[notificationClass]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.DebugFormat("preparing {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SENT;
|
||||
noteMessageDict[notificationClass].SentAt = DateTime.Now;
|
||||
DBManager.Instance.DeleteSystemErrors(noteMessageDict[notificationClass]);
|
||||
result = noteMessageDict[notificationClass];
|
||||
if (!XtraSendLogic.ShouldSendMessage(noteMessageDict[notificationClass]))
|
||||
{
|
||||
_log.DebugFormat("skipping {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
}
|
||||
else
|
||||
{
|
||||
_log.DebugFormat("preparing {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
||||
noteMessageDict[notificationClass].StatusInfo = "";
|
||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SENT;
|
||||
noteMessageDict[notificationClass].SentAt = DateTime.Now;
|
||||
DBManager.Instance.DeleteSystemErrors(noteMessageDict[notificationClass]);
|
||||
result = noteMessageDict[notificationClass];
|
||||
}
|
||||
}
|
||||
DBManager.Instance.Save(noteMessageDict[notificationClass]);
|
||||
}
|
||||
|
||||
@ -139,6 +139,12 @@ namespace bsmd.hisnord
|
||||
aMessage.ReceivedAt = nswResponse.ReceiveAt;
|
||||
|
||||
bool isAccepted = (nswResponse.Status == "ACCEPTED");
|
||||
|
||||
if (aMessage.Reset && nswResponse.IsReset && isAccepted)
|
||||
_log.InfoFormat("Message {0} RESET confirmed", aMessage.Id);
|
||||
if (nswResponse.IsReset && !aMessage.Reset)
|
||||
aMessage.Reset = nswResponse.IsReset;
|
||||
|
||||
if(isAccepted)
|
||||
{
|
||||
aMessage.Status = Message.MessageStatus.ACCEPTED;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user