3.8.8.1: Weitere Korrekturen und statische Validierungsregeln umgesetzt, dazu einige Änderungen von Christin

This commit is contained in:
Daniel Schick 2017-11-23 18:44:57 +00:00
parent a70e5024ee
commit 94d3062770
59 changed files with 795 additions and 152 deletions

View File

@ -12,7 +12,7 @@
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textUserAdministration}">
<local:ENIDataGrid Margin="2,8,2,2" x:Name="dataGridReportingParties" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" >
AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textFirstName}" Binding="{Binding FirstName}" IsReadOnly="True" Width="0.1*" />

View File

@ -7,7 +7,7 @@ using System.Windows;
using bsmd.database;
using ENI2.EditControls;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Controls;
namespace ENI2.Controls
@ -23,7 +23,7 @@ namespace ENI2.Controls
Loaded += ReportingPartyControl_Loaded;
}
public List<ReportingParty> ReportingParties { get; set; }
public ObservableCollection<ReportingParty> ReportingParties { get; set; }
private void ReportingPartyControl_Loaded(object sender, RoutedEventArgs e)
{

View File

@ -0,0 +1,39 @@
<UserControl x:Class="ENI2.Controls.ServerStatusControl"
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:p="clr-namespace:ENI2.Properties"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="600">
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textServerStatus}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="Excel:" />
<Label Name="labelStatusExcel" Content="?" FontWeight="Bold" />
<Label Content="Transmitter:" />
<Label Name="labelStatusTransmitter" Content="?" FontWeight="Bold" />
<Label Content="Report:" />
<Label Name="labelStatusReport" Content="?" FontWeight="Bold" />
</StackPanel>
<local:ENIDataGrid Grid.Row="1"
Margin="2,4,2,2" x:Name="dataGridStatus" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textClass}" Binding="{Binding Class}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textStatus}" Binding="{Binding Status}" IsReadOnly="True" Width="0.1*" />
<DataGridTextColumn Header="{x:Static p:Resources.textCreated}" Binding="{Binding Timestamp}" IsReadOnly="True" Width="0.2*" />
<DataGridTextColumn Header="{x:Static p:Resources.textVisitTransitId}" Binding="{Binding Id}" IsReadOnly="True" Width="0.2*" />
</DataGrid.Columns>
</local:ENIDataGrid>
</Grid>
</GroupBox>
</UserControl>

View File

@ -0,0 +1,125 @@
// Copyright (c) 2017 schick Informatik
// Description: Controls zur Statusanzeige auf dem Server
//
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Text.RegularExpressions;
using System.Globalization;
using log4net;
using bsmd.database;
using System.ServiceProcess;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for ServerStatusControl.xaml
/// </summary>
public partial class ServerStatusControl : UserControl
{
private ObservableCollection<StatusEntry> entries = new ObservableCollection<StatusEntry>();
private static Regex regex = new Regex(@"BSMD_(\d*)-(.*)-(\w*)");
private static ILog _log = LogManager.GetLogger("ServerStatus");
public ServerStatusControl()
{
InitializeComponent();
this.dataGridStatus.ItemsSource = this.entries;
}
internal void Update(LockingServiceReference.ServerStatus serverStatus)
{
System.Windows.Application.Current.Dispatcher.Invoke(delegate {
// Die Dateien müssen in die Objekte
entries.Clear();
foreach (StatusEntry se in StatusEntry.CreateFromList(serverStatus.IMPFiles, "IMP"))
entries.Add(se);
foreach (StatusEntry se in StatusEntry.CreateFromList(serverStatus.READYFiles, "READY"))
entries.Add(se);
foreach (StatusEntry se in StatusEntry.CreateFromList(serverStatus.CORRUPTFiles, "CORRUPT"))
entries.Add(se);
// Enumeration parsen und text ausgeben
ServiceControllerStatus excel = (ServiceControllerStatus)serverStatus.Excel;
this.labelStatusExcel.Content = excel.ToString();
ServiceControllerStatus report = (ServiceControllerStatus)serverStatus.Report;
this.labelStatusReport.Content = report.ToString();
ServiceControllerStatus transmitter = (ServiceControllerStatus)serverStatus.Transmitter;
this.labelStatusTransmitter.Content = transmitter.ToString();
//this.dataGridStatus.Items.Refresh();
});
}
public class StatusEntry
{
private static Dictionary<string, string> guidIdDict = new Dictionary<string, string>();
public string Class { get; set; }
public DateTime Timestamp { get; set; }
public string Id { get; set; }
public string Status { get; set; }
public static List<StatusEntry> CreateFromList(string[] aList, string status)
{
List<StatusEntry> result = new List<StatusEntry>();
foreach(string listEntry in aList)
{
if (regex.IsMatch(listEntry))
{
try
{
StatusEntry entry = new StatusEntry();
Match m = regex.Match(listEntry);
entry.Timestamp = DateTime.ParseExact(m.Groups[1].Value, "yyyyMMddHHmmss", CultureInfo.InvariantCulture);
string guidString = m.Groups[2].Value;
if (!guidIdDict.ContainsKey(guidString))
{
string idString = "";
Guid coreId;
if (Guid.TryParse(m.Groups[2].Value, out coreId))
{
MessageCore aCore = DBManager.Instance.GetMessageCoreById(coreId);
if (aCore != null)
{
idString = aCore.DisplayId;
}
}
guidIdDict[guidString] = idString;
}
entry.Id = guidIdDict[guidString];
entry.Class = m.Groups[3].Value;
entry.Status = status;
result.Add(entry);
}
catch(Exception ex)
{
_log.WarnFormat("Problem reading status info: {0}", ex.Message);
}
}
}
return result;
}
}
}
}

View File

@ -27,7 +27,7 @@
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Content="ATA" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:DateTimePicker Grid.Column="1" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
</Grid>
</GroupBox>
<GroupBox Name="tiefaGroupBox" Header="{x:Static p:Resources.textDraughtOnArrival}" Grid.Row="1">
@ -66,7 +66,7 @@
</GroupBox>
<GroupBox Name="bkraGroupBox" Header="{x:Static p:Resources.textBunkerOnArrival}" Grid.Row="3">
<enictrl:ENIDataGrid x:Name="dataGridBKRA" 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*" />

View File

@ -451,7 +451,7 @@ namespace ENI2.DetailViewControls
if (importCrew.Count > 0)
{
this.dataGridCrewList.Items.Refresh();
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
MessageBox.Show(String.Format(Properties.Resources.textCrewImported, importCrew.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}

View File

@ -27,7 +27,7 @@
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Content="ATD" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:DateTimePicker Grid.Column="1" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
</Grid>
</GroupBox>
<GroupBox Name="tiefdGroupBox" Header="{x:Static p:Resources.textDraughtOnDeparture}" Grid.Row="1">

View File

@ -67,20 +67,15 @@
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="3" Content="{x:Static p:Resources.textETDPortOfCall}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textATAPortOfCall}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="3" Content="{x:Static p:Resources.textATDPortOfCall}" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" />
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" />
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="2" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerETD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATAPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="3" Value="{Binding ATDPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePickerATD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<Label HorizontalAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textTicketNo}" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="3" Content="{x:Static p:Resources.textCreated}" Margin="0,0,10,0" />
<Label Name="labelCreated" Grid.Column="4" Grid.Row="4" Margin="2, 0, 0, 0" />
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay}" Margin="2" VerticalContentAlignment="Center"/>
<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="7" Visibility="Hidden" Name="stackPanelLock">
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
</StackPanel>
<Label Grid.Column="0" Grid.Row="6" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" />
<Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="6" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}"/>
<Button IsEnabled="False" Name="buttonCopy" Grid.Column="2" Grid.Row="6" Margin="2" Click="buttonCopy_Click" Content="{x:Static p:Resources.textCopyData}"/>
@ -110,6 +105,11 @@
<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}" />
<StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="7" Visibility="Hidden" Name="stackPanelLock">
<Image Source="../Resources/lock.png" Margin="0,0,5,0" Height="24" />
<TextBlock Name="textBlockLockUserName" VerticalAlignment="Center" />
</StackPanel>
<!-- Data Grid -->
<DataGrid Grid.Row="9" Grid.ColumnSpan="6" Margin="0,8,0,0" x:Name="dataGridMessages" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" CanUserAddRows="False"
SelectionMode="Extended" AutoGenerateColumns="False" MouseDoubleClick="dataGrid_MouseDoubleClick" PreviewKeyDown="dataGrid_PreviewKeyDown">

View File

@ -369,6 +369,10 @@ namespace ENI2.DetailViewControls
this.stackPanelLock.Visibility = Visibility.Visible;
this.textBlockLockUserName.Text = reportingParty.FirstName + " " + reportingParty.LastName;
}
else
{
MessageBox.Show("Reporting party empty, cannot show locked by!", "Notification", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
#endregion

View File

@ -42,14 +42,14 @@
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textETDLastPort}" Name="label_ETDFromLastport" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textETANextPort}" Name="label_ETAToNextPort" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textAnchored}" Name="label_IsAnchored" Margin="0,0,10,0" />
<xctk:DateTimePicker Grid.Column="1" Grid.Row="0" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.Row="0" Value="{Binding ETAToPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Value="{Binding ETDFromPortOfCall, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromPortOfCall" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="1" Grid.Row="1" Value="{Binding ETAToKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="1" Value="{Binding ETDFromKielCanal, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromKielCanal" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="2" Width="Auto" x:Name="locodeControl_LastPort" LocodeValue="{Binding LastPort, Mode=TwoWay}"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Value="{Binding ETDFromLastPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETDFromLastPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Column="1" Grid.Row="3" Width="Auto" x:Name="locodeControl_NextPort" LocodeValue="{Binding NextPort, Mode=TwoWay}" LocodeSource="SSN" />
<xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Grid.Column="3" Grid.Row="3" Value="{Binding ETAToNextPort, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" Name="dateTimePicker_ETAToNextPort" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="True" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>

View File

@ -68,8 +68,8 @@
<Label HorizontalContentAlignment="Right" Grid.Row="18" Grid.Column="2" Content="{x:Static p:Resources.textGeneralCargoDescription}" Name="label_GeneralCargoDescription" Margin="0,0,10,0"/>
<CheckBox Name="checkBoxKielCanalPassagePlanned" IsChecked="{Binding KielCanalPassagePlanned}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedIncomming" Grid.Row="1" Grid.Column="1" Value="{Binding KielCanalPassagePlannedIncomming, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedOutgoing" Grid.Row="1" Grid.Column="3" Value="{Binding KielCanalPassagePlannedOutgoing, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left"/>
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedIncomming" Grid.Row="1" Grid.Column="1" Value="{Binding KielCanalPassagePlannedIncomming, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" AllowTextInput="True"/>
<xctk:DateTimePicker Name="dateTimePickerKielCanalPassagePlannedOutgoing" Grid.Row="1" Grid.Column="3" Value="{Binding KielCanalPassagePlannedOutgoing, Converter={util:UtcToLocalDateTimeConverter}}" Margin="2" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" ContextMenu="{DynamicResource ClearContextMenu}" TextAlignment="Left" AllowTextInput="True"/>
<ComboBox Name="comboBoxCurrentShipSecurityLevel" Grid.Row="3" Grid.Column="1" SelectedValue="{Binding CurrentShipSecurityLevel}" Margin="2" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<CheckBox Name="checkBoxSECSimplification" IsChecked="{Binding SECSimplification}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"/>
<enictrl:LocodeControl x:Name="locodePortOfCallWhereCompleteSECNotified" Grid.Row="6" Grid.Column="1" LocodeValue="{Binding PortOfCallWhereCompleteSECNotified, Mode=TwoWay}" />

View File

@ -90,7 +90,7 @@
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="3" Content="{x:Static p:Resources.textCity}" Margin="0,0,10,0" />
<TextBox Name="textBoxCompanyName" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyName}" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId}" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Name="textBoxCompanyId" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyId}" MaxLength="7" VerticalContentAlignment="Center"/>
<TextBox Name="textBoxStreetNumber" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyStreetAndNumber}" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Name="textBoxCity" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="2" Text="{Binding ISMCompanyCity}" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Name="textBoxPostalCode" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Margin="2" Text="{Binding ISMCompanyPostalCode}" MaxLength="24" VerticalContentAlignment="Center"/>

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.8.7.%2a</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.8.8.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -112,6 +112,7 @@
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
@ -182,6 +183,9 @@
<Compile Include="Controls\RuleControl.xaml.cs">
<DependentUpon>RuleControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\ServerStatusControl.xaml.cs">
<DependentUpon>ServerStatusControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\ValidationConditionControl.xaml.cs">
<DependentUpon>ValidationConditionControl.xaml</DependentUpon>
</Compile>
@ -365,6 +369,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\ServerStatusControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\ValidationConditionControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -594,6 +602,9 @@
<None Include="Service References\LockingServiceReference\ENI2.LockingServiceReference.CoreLock.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Service References\LockingServiceReference\ENI2.LockingServiceReference.ServerStatus.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Service References\LockingServiceReference\LockingService.wsdl" />
<None Include="Service References\LockingServiceReference\LockingService.xsd">
<SubType>Designer</SubType>

View File

@ -39,7 +39,7 @@ namespace ENI2.EditControls
this.OKClicked += EditCallPurposeDialog_OKClicked;
this.AddVisible = true;
this.comboBoxCode.ItemsSource = Util.GlobalStructures.Edifact8025;
this.comboBoxCode.ItemsSource = Util.GlobalStructures.Edifact8025WithKey;
if((this.CallPurpose != null) && (this.CallPurpose.CallPurposeCode != 0))
{
this.comboBoxCode.SelectedValue = this.CallPurpose.CallPurposeCode;

View File

@ -21,7 +21,7 @@
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textPortname}" />
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textETA}" />
<TextBox Grid.Column="1" Grid.Row="0" x:Name="textBoxPortName" MaxLength="100" Margin="2" VerticalContentAlignment="Center" />
<xctk:DateTimePicker Name="dateTimePickerETA" Grid.Column="1" Grid.Row="1" Margin="2" ShowButtonSpinner="False" Format="Custom" FormatString="dd.MM.yyyy HH:mm" VerticalContentAlignment="Center" TextAlignment="Left"/>
<xctk:DateTimePicker Name="dateTimePickerETA" Grid.Column="1" Grid.Row="1" Margin="2" ShowButtonSpinner="False" Format="Custom" FormatString="dd.MM.yyyy HH:mm" VerticalContentAlignment="Center" TextAlignment="Left" AllowTextInput="True"/>
</Grid>
</enictrl:EditWindowBase>

View File

@ -19,7 +19,13 @@
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="0.08*" />
<DataGridTextColumn Header="{x:Static p:Resources.textClass}" Binding="{Binding NotificationClass}" IsReadOnly="True" Width="0.15*" />
<DataGridTextColumn Header="{x:Static p:Resources.textGroup}" Binding="{Binding MessageGroupName}" IsReadOnly="True" Width="0.15*" />
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding ErrorText}" IsReadOnly="True" Width="0.5*" />
<DataGridTemplateColumn Header="{x:Static p:Resources.textDescription}" Width="0.5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextWrapping="Wrap" Text="{Binding ErrorText}" FontSize="11" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn >
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>

View File

@ -59,6 +59,6 @@
Watermark="Enter ENI" ValueChanged="doubleUpDownENI_ValueChanged" TextAlignment="Left"/>
<DatePicker Name="datePickerETA" Grid.Row="3" Grid.Column="1" Margin="2" Grid.ColumnSpan="2"
SelectedDateChanged="datePickerETA_SelectedDateChanged" />
<ComboBox Name="comboBoxInitialHIS" Grid.Row="4" Grid.Column="1" Margin="2" Grid.ColumnSpan="2" DisplayMemberPath="Value" SelectedValuePath="Key" />
<ComboBox Name="comboBoxInitialHIS" Grid.Row="4" Grid.Column="1" Margin="2" Grid.ColumnSpan="2" DisplayMemberPath="Value" SelectedValuePath="Key" SelectionChanged="comboBoxInitialHIS_SelectionChanged"/>
</Grid>
</enictrl:EditWindowBase>

View File

@ -70,7 +70,11 @@ namespace ENI2.EditControls
bool imo_OR_eni = ((doubleUpDownIMO.Value.HasValue) && (doubleUpDownIMO.Value >= 1000000) && (doubleUpDownIMO.Value <= 9999999)) ||
((doubleUpDownENI.Value.HasValue) && (doubleUpDownENI.Value >= 100000) && (doubleUpDownENI.Value <= 99999999));
isComplete &= imo_OR_eni;
isComplete &= imo_OR_eni;
bool isHISSelected = (this.comboBoxInitialHIS.SelectedValue != null);
isComplete &= isHISSelected;
this.EnableOK(isComplete);
@ -92,5 +96,10 @@ namespace ENI2.EditControls
{
this.CheckComplete();
}
private void comboBoxInitialHIS_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.CheckComplete();
}
}
}

View File

@ -24,7 +24,13 @@
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="0.08*" />
<DataGridTextColumn Header="{x:Static p:Resources.textClass}" Binding="{Binding NotificationClass}" IsReadOnly="True" Width="0.15*" />
<DataGridTextColumn Header="{x:Static p:Resources.textGroup}" Binding="{Binding MessageGroupName}" IsReadOnly="True" Width="0.15*" />
<DataGridTextColumn Header="{x:Static p:Resources.textDescription}" Binding="{Binding ViolationText}" IsReadOnly="True" Width="0.5*" />
<DataGridTemplateColumn Header="{x:Static p:Resources.textDescription}" Width="0.5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextWrapping="Wrap" Text="{Binding ViolationText}" FontSize="11" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn >
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>

View File

@ -67,6 +67,7 @@
<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"/>
@ -75,7 +76,8 @@
<RadioButton Grid.Column="3" x:Name="buttonNotifications" Content="{x:Static p:Resources.textNotifications}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Margin="2,5,0,0" IsChecked="True" />
<RadioButton Grid.Column="4" x:Name="buttonUserAdmin" Content="{x:Static p:Resources.textUserAdministration}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0"/>
<RadioButton Grid.Column="5" x:Name="buttonEditRules" Content="{x:Static p:Resources.textEditRules}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0" />
<Button Grid.Column="6" x:Name="buttonAbout" Content="?" HorizontalAlignment="Right" VerticalAlignment="Top" Background="Transparent" Margin="2" Padding="5,0,5,0" Click="buttonAbout_Click"/>
<RadioButton Grid.Column="6" x:Name="buttonStatus" Content="{x:Static p:Resources.textServerStatus}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="auto" Click="radioButton_Click" Background="Transparent" Visibility="Hidden" Margin="2,5,0,0" />
<Button Grid.Column="7" x:Name="buttonAbout" Content="?" HorizontalAlignment="Right" VerticalAlignment="Top" Background="Transparent" Margin="2" Padding="5,0,5,0" Click="buttonAbout_Click"/>
</Grid>
<Grid DockPanel.Dock="Bottom" Height="22" Background="#FFE8F6FF">

View File

@ -4,12 +4,14 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Threading;
using System.Timers;
using bsmd.database;
using System.Windows.Controls;
@ -33,10 +35,12 @@ namespace ENI2
private ReportingPartyControl rpControl;
private RuleControl ruleControl;
private bool dbConnected;
private ServerStatusControl statusControl;
private SucheControl sucheControl;
private List<MessageCore> anmeldungen = new List<MessageCore>();
private bool efMode = false;
private bool dbConnected;
ScaleTransform _transform = new ScaleTransform(1.0, 1.0);
private Dictionary<Guid, ClosableTabItem> openTabs = new Dictionary<Guid, ClosableTabItem>();
private Dictionary<ClosableTabItem, Guid> lockedCores = new Dictionary<ClosableTabItem, Guid>();
@ -44,6 +48,7 @@ namespace ENI2
private ReportingParty userEntity = null;
private ILog _log = LogManager.GetLogger(typeof(MainWindow));
private DatabaseEntityWatchdog _dbWatchDog;
private System.Timers.Timer _statusTimer;
#endregion
@ -64,7 +69,12 @@ namespace ENI2
App.SplashScreen.ShowMessage("done");
Thread.Sleep(500);
App.SplashScreen.LoadComplete();
}
this._statusTimer = new System.Timers.Timer();
this._statusTimer.AutoReset = true;
this._statusTimer.Elapsed += _statusTimer_Elapsed; // TODO: Timer konfigurierbar
this._statusTimer.Interval = 10000; // alle 10 Sekunden
this._statusTimer.Start();
}
#endregion
@ -108,7 +118,7 @@ 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];
}
@ -211,7 +221,7 @@ namespace ENI2
{
this.rpControl = new ReportingPartyControl();
Dictionary<Guid, ReportingParty> repPartyDict = DBManager.Instance.GetReportingPartyDict();
this.rpControl.ReportingParties = new List<ReportingParty>(repPartyDict.Values);
this.rpControl.ReportingParties = new ObservableCollection<ReportingParty>(repPartyDict.Values);
}
this.rootContainer.Children.Add(this.rpControl);
}
@ -225,6 +235,14 @@ namespace ENI2
}
this.rootContainer.Children.Add(ruleControl);
}
else if(sender == this.buttonStatus)
{
if(this.statusControl == null)
{
this.statusControl = new ServerStatusControl();
}
this.rootContainer.Children.Add(this.statusControl);
}
this.buttonNewId.Visibility = newButtonsVisible ? Visibility.Visible : Visibility.Hidden;
this.buttonNewWithId.Visibility = newButtonsVisible ? Visibility.Visible : Visibility.Hidden;
@ -493,6 +511,7 @@ namespace ENI2
{
this.buttonUserAdmin.Visibility = Visibility.Visible;
this.buttonEditRules.Visibility = Visibility.Visible;
this.buttonStatus.Visibility = Visibility.Visible;
}
else
{
@ -519,6 +538,29 @@ namespace ENI2
}
#endregion
#region Service Status timer handler
private void _statusTimer_Elapsed(object sender, ElapsedEventArgs e)
{
if(App.LockingServiceClient != null)
{
try
{
LockingServiceReference.ServerStatus serverStatus = App.LockingServiceClient.GetStatus();
if ((serverStatus != null) && (this.statusControl != null))
{
this.statusControl.Update(serverStatus);
}
}
catch(Exception ex)
{
_log.DebugFormat("LockingService.GetStatus() threw an exception: {0}", ex.Message);
}
}
}
#endregion
}
}

View File

@ -3731,6 +3731,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Server status.
/// </summary>
public static string textServerStatus {
get {
return ResourceManager.GetString("textServerStatus", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Beneficiary.
/// </summary>

View File

@ -1588,4 +1588,7 @@
<data name="textClass" xml:space="preserve">
<value>Class</value>
</data>
<data name="textServerStatus" xml:space="preserve">
<value>Server status</value>
</data>
</root>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ServerStatus" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>ENI2.LockingServiceReference.ServerStatus, Service References.LockingServiceReference.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -38,6 +38,12 @@
<wsdl:message name="IService_Log_OutputMessage">
<wsdl:part name="parameters" element="tns:LogResponse" />
</wsdl:message>
<wsdl:message name="IService_GetStatus_InputMessage">
<wsdl:part name="parameters" element="tns:GetStatus" />
</wsdl:message>
<wsdl:message name="IService_GetStatus_OutputMessage">
<wsdl:part name="parameters" element="tns:GetStatusResponse" />
</wsdl:message>
<wsdl:portType name="IService">
<wsdl:operation name="Lock">
<wsdl:input wsaw:Action="http://tempuri.org/IService/Lock" message="tns:IService_Lock_InputMessage" />
@ -59,6 +65,10 @@
<wsdl:input wsaw:Action="http://tempuri.org/IService/Log" message="tns:IService_Log_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IService/LogResponse" message="tns:IService_Log_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetStatus">
<wsdl:input wsaw:Action="http://tempuri.org/IService/GetStatus" message="tns:IService_GetStatus_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IService/GetStatusResponse" message="tns:IService_GetStatus_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IService" type="tns:IService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
@ -107,6 +117,15 @@
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetStatus">
<soap:operation soapAction="http://tempuri.org/IService/GetStatus" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="LockingService">
<wsdl:port name="BasicHttpBinding_IService" binding="tns:BasicHttpBinding_IService">

View File

@ -7,4 +7,10 @@
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfguid" nillable="true" type="tns:ArrayOfguid" />
<xs:complexType name="ArrayOfstring">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfstring" nillable="true" type="tns:ArrayOfstring" />
</xs:schema>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:tns="http://schemas.datacontract.org/2004/07/bsmd.LockingService" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/bsmd.LockingService" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="http://localhost:11651/LockingService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xs:import schemaLocation="http://localhost:11651/LockingService.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<xs:complexType name="ArrayOfCoreLock">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="CoreLock" nillable="true" type="tns:CoreLock" />
@ -14,4 +15,15 @@
</xs:sequence>
</xs:complexType>
<xs:element name="CoreLock" nillable="true" type="tns:CoreLock" />
<xs:complexType name="ServerStatus">
<xs:sequence>
<xs:element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="CORRUPTFiles" nillable="true" type="q1:ArrayOfstring" />
<xs:element minOccurs="0" name="Excel" type="xs:int" />
<xs:element xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="IMPFiles" nillable="true" type="q2:ArrayOfstring" />
<xs:element xmlns:q3="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="READYFiles" nillable="true" type="q3:ArrayOfstring" />
<xs:element minOccurs="0" name="Report" type="xs:int" />
<xs:element minOccurs="0" name="Transmitter" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="ServerStatus" nillable="true" type="tns:ServerStatus" />
</xs:schema>

View File

@ -70,4 +70,16 @@
<xs:sequence />
</xs:complexType>
</xs:element>
<xs:element name="GetStatus">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
<xs:element name="GetStatusResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q10="http://schemas.datacontract.org/2004/07/bsmd.LockingService" minOccurs="0" name="GetStatusResult" nillable="true" type="q10:ServerStatus" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -74,6 +74,131 @@ namespace ENI2.LockingServiceReference {
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="ServerStatus", Namespace="http://schemas.datacontract.org/2004/07/bsmd.LockingService")]
[System.SerializableAttribute()]
public partial class ServerStatus : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string[] CORRUPTFilesField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private int ExcelField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string[] IMPFilesField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string[] READYFilesField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private int ReportField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private int TransmitterField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string[] CORRUPTFiles {
get {
return this.CORRUPTFilesField;
}
set {
if ((object.ReferenceEquals(this.CORRUPTFilesField, value) != true)) {
this.CORRUPTFilesField = value;
this.RaisePropertyChanged("CORRUPTFiles");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public int Excel {
get {
return this.ExcelField;
}
set {
if ((this.ExcelField.Equals(value) != true)) {
this.ExcelField = value;
this.RaisePropertyChanged("Excel");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string[] IMPFiles {
get {
return this.IMPFilesField;
}
set {
if ((object.ReferenceEquals(this.IMPFilesField, value) != true)) {
this.IMPFilesField = value;
this.RaisePropertyChanged("IMPFiles");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string[] READYFiles {
get {
return this.READYFilesField;
}
set {
if ((object.ReferenceEquals(this.READYFilesField, value) != true)) {
this.READYFilesField = value;
this.RaisePropertyChanged("READYFiles");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public int Report {
get {
return this.ReportField;
}
set {
if ((this.ReportField.Equals(value) != true)) {
this.ReportField = value;
this.RaisePropertyChanged("Report");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public int Transmitter {
get {
return this.TransmitterField;
}
set {
if ((this.TransmitterField.Equals(value) != true)) {
this.TransmitterField = value;
this.RaisePropertyChanged("Transmitter");
}
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="LockingServiceReference.IService")]
public interface IService {
@ -107,6 +232,12 @@ namespace ENI2.LockingServiceReference {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Log", ReplyAction="http://tempuri.org/IService/LogResponse")]
System.Threading.Tasks.Task LogAsync(string msg, string host, System.Guid userId);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/GetStatus", ReplyAction="http://tempuri.org/IService/GetStatusResponse")]
ENI2.LockingServiceReference.ServerStatus GetStatus();
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/GetStatus", ReplyAction="http://tempuri.org/IService/GetStatusResponse")]
System.Threading.Tasks.Task<ENI2.LockingServiceReference.ServerStatus> GetStatusAsync();
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
@ -175,5 +306,13 @@ namespace ENI2.LockingServiceReference {
public System.Threading.Tasks.Task LogAsync(string msg, string host, System.Guid userId) {
return base.Channel.LogAsync(msg, host, userId);
}
public ENI2.LockingServiceReference.ServerStatus GetStatus() {
return base.Channel.GetStatus();
}
public System.Threading.Tasks.Task<ENI2.LockingServiceReference.ServerStatus> GetStatusAsync() {
return base.Channel.GetStatusAsync();
}
}
}

View File

@ -33,30 +33,45 @@ namespace ENI2.Util
public static byte[] ShipSecurityLevels = { 1, 2, 3 };
public static Dictionary<int, string> Edifact8025 = new Dictionary<int, string> {
{1, "1 Cargo operations" },
{2, "2 Passenger movement" },
{3, "3 Taking bunkers" },
{4, "4 Changing crew" },
{5, "5 Goodwill visit" },
{6, "6 Taking supplies" },
{7, "7 Repair" },
{8, "8 Laid-up" },
{9, "9 Awaiting orders" },
{10, "10 Miscellaneous" },
{11, "11 Crew movement" },
{12, "12 Cruise, leisure and recreation" },
{13, "13 Under government order" },
{14, "14 Quarantine inspection" },
{15, "15 Refuge" },
{16, "16 Unloading cargo" },
{17, "17 Loading cargo" },
{18, "18 Repair in dry dock" },
{19, "19 Repair in wet dock" },
{20, "20 Cargo tank cleaning" },
{21, "21 Means of transport customs clearance" },
{22, "22 De-gassing" },
{23, "23 Waste disposal" }
};
{1, "Cargo operations" },
{2, "Passenger movement" },
{3, "Taking bunkers" },
{4, "Changing crew" },
{5, "Goodwill visit" },
{6, "Taking supplies" },
{7, "Repair" },
{8, "Laid-up" },
{9, "Awaiting orders" },
{10, "Miscellaneous" },
{11, "Crew movement" },
{12, "Cruise, leisure and recreation" },
{13, "Under government order" },
{14, "Quarantine inspection" },
{15, "Refuge" },
{16, "Unloading cargo" },
{17, "Loading cargo" },
{18, "Repair in dry dock" },
{19, "Repair in wet dock" },
{20, "Cargo tank cleaning" },
{21, "Means of transport customs clearance" },
{22, "De-gassing" },
{23, "Waste disposal" }
};
private static Dictionary<int, string> _edifact8025WithKey = null;
public static Dictionary<int, string> Edifact8025WithKey
{
get
{
if(_edifact8025WithKey == null)
{
_edifact8025WithKey = new Dictionary<int, string>();
foreach (int key in Edifact8025.Keys)
_edifact8025WithKey.Add(key, string.Format("{0} {1}", key, Edifact8025[key]));
}
return _edifact8025WithKey;
}
}
public static string[] vesselClasses =
{

View File

@ -74,25 +74,32 @@ namespace bsmd.ExcelReadService
public void Dispose()
{
if (this._portcall != null)
try
{
this._portcall.Close(0);
_log.Debug("Close Worksheet");
Marshal.ReleaseComObject(this._portcall);
}
if (this._portcall != null)
{
this._portcall.Close(0);
_log.Debug("Close Worksheet");
Marshal.ReleaseComObject(this._portcall);
}
if (this._excelWorkbooks != null)
{
this._excelWorkbooks.Close();
_log.Debug("Close Workbooks");
Marshal.ReleaseComObject(this._excelWorkbooks);
// this._excelWorkbooks.Close();
if (this._excelWorkbooks != null)
{
this._excelWorkbooks.Close();
_log.Debug("Close Workbooks");
Marshal.ReleaseComObject(this._excelWorkbooks);
// this._excelWorkbooks.Close();
}
if (this._excelApp != null)
{
_log.Debug("Quit Excel");
this._excelApp.Quit();
Marshal.ReleaseComObject(this._excelApp);
}
}
if (this._excelApp != null)
catch(Exception ex)
{
_log.Debug("Quit Excel");
this._excelApp.Quit();
Marshal.ReleaseComObject(this._excelApp);
_log.ErrorFormat("Exception disposing ExcelReader: {0}", ex.Message);
}
}

View File

@ -8,6 +8,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
namespace bsmd.ExcelReadService
{
@ -21,7 +23,8 @@ namespace bsmd.ExcelReadService
public ExcelWriter(CountryMode countryMode)
{
switch(countryMode)
_log = LogManager.GetLogger(typeof(ExcelWriter));
switch (countryMode)
{
case CountryMode.DK:

View File

@ -2546,6 +2546,11 @@ namespace bsmd.ExcelReadService
result = DBManager.Instance.GetMessageCoreByTransitId(visitTransitId);
}
}
else
{
message = "Visit / Transit Id missing!";
return null;
}
if (result != null)
{

View File

@ -52,6 +52,10 @@ namespace bsmd.LockingService
[WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
void Log(string msg, string host, Guid userId);
[OperationContract]
[WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
ServerStatus GetStatus();
}
}

View File

@ -6,7 +6,9 @@ using System.Collections.Generic;
using log4net;
using bsmd.database;
using System.ServiceModel.Activation;
using System.ServiceProcess;
using System.Timers;
using System.IO;
namespace bsmd.LockingService
{
@ -116,6 +118,63 @@ namespace bsmd.LockingService
return result;
}
public ServerStatus GetStatus()
{
ServerStatus serverStatus = new ServerStatus();
// Test if processes are running
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController serviceController in services)
{
switch (serviceController.ServiceName)
{
case "NSW Report Generator":
serverStatus.Report = (int)serviceController.Status;
break;
case "NSWSendService":
serverStatus.Transmitter = (int)serviceController.Status;
break;
case "ExcelReadService":
serverStatus.Excel = (int)serviceController.Status;
break;
default:
break;
}
}
// collect file Names
// TODO: evtl. könnte es Sinn ergeben, wenn man diese Daten z.B. nur alle 10 Sekunden erzeugt und
// dann allen Aufrufern liefert.
serverStatus.IMPFiles = new List<string>();
string impPath = Path.Combine(Properties.Settings.Default.TransmitterRoot, "IMP");
if(Directory.Exists(impPath))
{
foreach(string file in Directory.GetFiles(impPath))
serverStatus.IMPFiles.Add(Path.GetFileNameWithoutExtension(file));
}
serverStatus.READYFiles = new List<string>();
string readyPath = Path.Combine(Properties.Settings.Default.TransmitterRoot, "READY");
if (Directory.Exists(readyPath))
{
foreach (string file in Directory.GetFiles(readyPath))
serverStatus.READYFiles.Add(Path.GetFileNameWithoutExtension(file));
}
serverStatus.CORRUPTFiles = new List<string>();
string corruptPath = Path.Combine(Properties.Settings.Default.TransmitterRoot, "CORRUPT");
if (Directory.Exists(corruptPath))
{
foreach (string file in Directory.GetFiles(corruptPath))
serverStatus.CORRUPTFiles.Add(Path.GetFileNameWithoutExtension(file));
}
return serverStatus;
}
#endregion
#region class LockEntry

View File

@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace bsmd.LockingService.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string TransmitterRoot {
get {
return ((string)(this["TransmitterRoot"]));
}
}
}
}

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.LockingService.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="TransmitterRoot" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@ -11,19 +11,25 @@ namespace bsmd.LockingService
public class ServerStatus
{
/// <summary>
/// Flag zeigt an ob ExcelReader läuft
/// Flag zeigt an ob ExcelReader läuft. Der int ist gecastet von der ServiceControllerStatus Enum
/// </summary>
public bool? Excel { get; set; }
public int Excel { get; set; }
/// <summary>
/// Flag zeigt an, ob NSWSendService läuft
/// </summary>
public bool? Transmitter { get; set; }
public int Transmitter { get; set; }
/// <summary>
/// Flag zeigt an, ob ReportServer läuft
/// </summary>
public bool? Report { get; set; }
public int Report { get; set; }
public List<string> IMPFiles { get; set; }
public List<string> READYFiles { get; set; }
public List<string> CORRUPTFiles { get; set; }
}
}

View File

@ -1,6 +1,11 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bsmd.LockingService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
@ -43,4 +48,11 @@
<proxy bypassonlocal="False" usesystemdefault="True" proxyaddress="http://127.0.0.1:8888" />
</defaultProxy>
</system.net>
<applicationSettings>
<bsmd.LockingService.Properties.Settings>
<setting name="TransmitterRoot" serializeAs="String">
<value>E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool</value>>
</setting>
</bsmd.LockingService.Properties.Settings>
</applicationSettings>
</configuration>

View File

@ -48,6 +48,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
@ -89,6 +90,11 @@
</Compile>
<Compile Include="IService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="ServerStatus.cs" />
</ItemGroup>
<ItemGroup>
@ -101,6 +107,10 @@
<Link>bsmdKey.snk</Link>
</Content>
<Content Include="log4net.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>

View File

@ -7,9 +7,14 @@
<body style="background-color:darkslategray;color:lemonchiffon;">
<div style="float:left; margin-right:5px;"><img src="lock.png" /></div>
<div style="float:right; margin-left:5px;"><img src="logo_transparent_babyblau.png" width="256" height="256" /></div>
(c) 2017 <a href="http://www.textbausteine.net/">schick Informatik</a> - Locking Service <br />
WCF Service für die ausschließliche Bearbeitung von Erfassungsmasken in ENI-2.
<h2>Locking Service (WCF)</h2>
<h3>Funktionen</h3>
<ul>
<li>Ausschließliche Bearbeitung von Erfassungsmasken in ENI-2 (Sperren).</li>
<li>Server Prozesse abfragen (Running / Paused / Stopped)</li>
<li>Aktuell verarbeitete Dateien abfragen (Transmitter-Verzeichnis)</li>
</ul>
(c) 2017 <a href="http://www.textbausteine.net/">schick Informatik</a>
</body>

View File

@ -156,6 +156,10 @@ namespace bsmd.ReportGenerator
Style style = doc.Styles["Normal"];
style.Font.Name = "Verdana";
Style grayStyle = doc.Styles.AddStyle("Gray", "Normal");
grayStyle.Font.Size = 9;
grayStyle.Font.Color = Colors.Gray;
Style tableStyle = doc.Styles.AddStyle("Table", "Normal");
tableStyle.Font.Name = "Verdana";
tableStyle.Font.Size = 9;
@ -294,18 +298,18 @@ namespace bsmd.ReportGenerator
row = table.AddRow();
row.Cells[1].AddParagraph("Visit-ID");
paragraph = row.Cells[2].AddParagraph(coverInfos["Visit-ID"]);
paragraph = row.Cells[2].AddParagraph(coverInfos["Visit-ID"] ?? "");
paragraph.Style = "TableValue";
row.Cells[3].AddParagraph("Name");
paragraph = row.Cells[4].AddParagraph(coverInfos["Ship"]);
paragraph = row.Cells[4].AddParagraph(coverInfos["Ship"] ?? "");
paragraph.Style = "TableValue";
row = table.AddRow();
row.Cells[1].AddParagraph("Port of call");
paragraph = row.Cells[2].AddParagraph(coverInfos["Port of call"]);
paragraph = row.Cells[2].AddParagraph(coverInfos["Port of call"] ?? "");
paragraph.Style = "TableValue";
row.Cells[3].AddParagraph("ETA");
paragraph = row.Cells[4].AddParagraph(coverInfos["ETA"]);
paragraph = row.Cells[4].AddParagraph(coverInfos["ETA"] ?? "");
paragraph.Style = "TableValue";
row = table.AddRow();
@ -316,26 +320,26 @@ namespace bsmd.ReportGenerator
row = table.AddRow();
row.Cells[1].AddParagraph("Organization");
paragraph = row.Cells[2].AddParagraph(rp.Name);
paragraph = row.Cells[2].AddParagraph(rp.Name ?? "");
paragraph.Style = "TableValue";
row.Cells[2].MergeRight = 2;
row = table.AddRow();
row.Cells[1].AddParagraph("Last name");
paragraph = row.Cells[2].AddParagraph(rp.LastName);
paragraph = row.Cells[2].AddParagraph(rp.LastName ?? "");
paragraph.Style = "TableValue";
row.Cells[3].AddParagraph("City");
paragraph = row.Cells[4].AddParagraph(rp.City);
paragraph = row.Cells[4].AddParagraph(rp.City ?? "");
paragraph.Style = "TableValue";
row = table.AddRow();
row.Cells[1].AddParagraph("Phone");
paragraph = row.Cells[2].AddParagraph(rp.Phone);
paragraph = row.Cells[2].AddParagraph(rp.Phone ?? "");
paragraph.Style = "TableValue";
row.Cells[3].AddParagraph("Email");
paragraph = row.Cells[4].AddParagraph(rp.EMail);
paragraph = row.Cells[4].AddParagraph(rp.EMail ?? "");
paragraph.Style = "TableValue";
}
@ -1015,7 +1019,9 @@ namespace bsmd.ReportGenerator
KeyValuePair<string, string> elem = messageText[i];
Row row = table.AddRow();
Cell cell = row.Cells[0];
cell.AddParagraph(elem.Key);
Paragraph aParagraph = cell.AddParagraph(elem.Key);
if (elem.Value.IsNullOrEmpty())
aParagraph.Style = "Gray";
string val = elem.Value;
// funktioniert leider nicht, müsste das auf PDFsharp umstellen (http://www.pdfsharp.net/wiki/Unicode-sample.ashx)
if (val == "True") val = "Yes"; // @"\u2611"; // unicode ballot box with check

View File

@ -280,6 +280,7 @@ namespace bsmd.ReportGenerator
// prepare and send E-Mail with generated attachment
// Schiffsname_ID_Meldeklassen.pdf
string shipName = DBManager.Instance.GetShipNameFromCore(reportCore);
if (shipName.IsNullOrEmpty()) shipName = "UNKNOWN";
shipName = shipName.Replace(' ', '_');
string fullPath = string.Format("{0}\\{1}_{2}_{3}.pdf", Properties.Settings.Default.OutputDirectory, shipName, reportCore.DisplayId, classes);

View File

@ -36,6 +36,7 @@ namespace bsmd.database
[LookupName("AGNT.AgentCompanyName")]
[MaxLength(100)]
[ENI2Validation]
[Validation(ValidationCode.NOT_NULL)]
public string AgentCompanyName { get; set; }
[ShowReport]
@ -67,6 +68,7 @@ namespace bsmd.database
[Validation2(ValidationCode.NOT_NULL)]
[MaxLength(100)]
[ENI2Validation]
[Validation(ValidationCode.NOT_NULL)]
public string AgentLastName { get; set; }
[ShowReport]
@ -80,6 +82,7 @@ namespace bsmd.database
[LookupName("AGNT.AgentPhone")]
[MaxLength(100)]
[ENI2Validation]
[Validation(ValidationCode.NOT_NULL)]
public string AgentPhone { get; set; }
[ShowReport]

View File

@ -8,16 +8,16 @@
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace bsmd.database
{
public class BPOL : DatabaseEntity, ISublistContainer
{
private List<DatabaseEntity> poi = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> poi = new ObservableCollection<DatabaseEntity>();
public BPOL()
{
@ -36,7 +36,7 @@ namespace bsmd.database
[ENI2Validation]
public bool? CruiseShip { get; set; }
public List<DatabaseEntity> PortOfItineraries { get { return this.poi; } }
public ObservableCollection<DatabaseEntity> PortOfItineraries { get { return this.poi; } }
#endregion

View File

@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Text.RegularExpressions;
using log4net;
@ -38,6 +39,11 @@ namespace bsmd.database
return (items == null) || (items.Count == 0);
}
public static bool IsNullOrEmpty<T>(this ObservableCollection<T> items)
{
return (items == null) || (items.Count == 0);
}
public static bool IsNullOrEmpty<T>(this Dictionary<T, T> items)
{
return (items == null) || (items.Count == 0);

View File

@ -8,6 +8,7 @@
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.SqlClient;
using System.Reflection;
@ -16,11 +17,11 @@ namespace bsmd.database
public class HAZ : DatabaseEntity, ISublistContainer
{
private List<DatabaseEntity> imdgPositions = new List<DatabaseEntity>();
private List<DatabaseEntity> ibcPositions = new List<DatabaseEntity>();
private List<DatabaseEntity> igcPositions = new List<DatabaseEntity>();
private List<DatabaseEntity> imsbcPositions = new List<DatabaseEntity>();
private List<DatabaseEntity> marpolPositions = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> imdgPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> ibcPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> igcPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> imsbcPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> marpolPositions = new ObservableCollection<DatabaseEntity>();
private bool _isDeparture;
public HAZ()
@ -69,15 +70,15 @@ namespace bsmd.database
[MaxLength(64)]
public string DPGContactPhone { get; set; }
public List<DatabaseEntity> IMDGPositions { get { return this.imdgPositions; } }
public ObservableCollection<DatabaseEntity> IMDGPositions { get { return this.imdgPositions; } }
public List<DatabaseEntity> IBCPositions { get { return this.ibcPositions; } }
public ObservableCollection<DatabaseEntity> IBCPositions { get { return this.ibcPositions; } }
public List<DatabaseEntity> IGCPositions { get { return this.igcPositions; } }
public ObservableCollection<DatabaseEntity> IGCPositions { get { return this.igcPositions; } }
public List<DatabaseEntity> IMSBCPositions { get { return this.imsbcPositions; } }
public ObservableCollection<DatabaseEntity> IMSBCPositions { get { return this.imsbcPositions; } }
public List<DatabaseEntity> MARPOLPositions { get { return this.marpolPositions; } }
public ObservableCollection<DatabaseEntity> MARPOLPositions { get { return this.marpolPositions; } }
// selektor HAZA / HAZD
[ENI2Validation]

View File

@ -94,12 +94,12 @@ namespace bsmd.database
public double? CargoGrossQuantity_TNE { get; set; }
[MaxLength(5)]
[Validation(ValidationCode.LOCODE)]
//[Validation(ValidationCode.LOCODE)]
[ENI2Validation]
public string PortOfLoading { get; set; }
[MaxLength(5)]
[Validation(ValidationCode.LOCODE)]
//[Validation(ValidationCode.LOCODE)]
[ENI2Validation]
public string PortOfDischarge { get; set; }

View File

@ -8,9 +8,9 @@
// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved.
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace bsmd.database
@ -18,13 +18,13 @@ namespace bsmd.database
public class MDH : DatabaseEntity, ISublistContainer
{
private List<DatabaseEntity> portOfCallLast30Days = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> portOfCallLast30Days = new ObservableCollection<DatabaseEntity>();
private List<DatabaseEntity> sanitaryMeasuresDetails = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> sanitaryMeasuresDetails = new ObservableCollection<DatabaseEntity>();
private List<DatabaseEntity> stowawaysJoiningLocations = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> stowawaysJoiningLocations = new ObservableCollection<DatabaseEntity>();
private List<DatabaseEntity> infectedAreas = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> infectedAreas = new ObservableCollection<DatabaseEntity>();
public MDH()
{
@ -34,13 +34,13 @@ namespace bsmd.database
#region Properties
public List<DatabaseEntity> PortOfCallLast30Days { get { return this.portOfCallLast30Days; } }
public ObservableCollection<DatabaseEntity> PortOfCallLast30Days { get { return this.portOfCallLast30Days; } }
public List<DatabaseEntity> SanitaryMeasuresDetails { get { return this.sanitaryMeasuresDetails; } }
public ObservableCollection<DatabaseEntity> SanitaryMeasuresDetails { get { return this.sanitaryMeasuresDetails; } }
public List<DatabaseEntity> StowawaysJoiningLocations { get { return this.stowawaysJoiningLocations; } }
public ObservableCollection<DatabaseEntity> StowawaysJoiningLocations { get { return this.stowawaysJoiningLocations; } }
public List<DatabaseEntity> InfectedAreas { get { return this.infectedAreas; } }
public ObservableCollection<DatabaseEntity> InfectedAreas { get { return this.infectedAreas; } }
[ShowReport]
[Validation1(ValidationCode.NOT_NULL)]
@ -243,7 +243,8 @@ namespace bsmd.database
DBManager.Instance.Delete(remainingLocation);
this.StowawaysJoiningLocations.Clear();
// add existing and new crew
this.StowawaysJoiningLocations.AddRange(foundList);
foreach (StowawaysJoiningLocation sjl in foundList)
this.StowawaysJoiningLocations.Add(sjl);
}
}
}
@ -533,10 +534,7 @@ namespace bsmd.database
if ((this.NumberOfIllPersonsHigherThanExpected ?? false) && ((this.NumberOfIllPersons ?? 0) == 0))
violations.Add(RuleEngine.CreateViolation(ValidationCode.V762, "Number of ill persons missing", null, this.Title, null, this.Tablename));
if ((this.SanitaryMeasuresApplied ?? false) && (
this.SanitaryMeasuresType.IsNullOrEmpty() ||
!this.SanitaryMeasuresDate.HasValue ||
this.SanitaryMeasuresLocation.IsNullOrEmpty()))
if ((this.SanitaryMeasuresApplied ?? false) && this.SanitaryMeasuresDetails.IsNullOrEmpty())
violations.Add(RuleEngine.CreateViolation(ValidationCode.V763, "Sanitary measure details missing", null, this.Title, null, this.Tablename));
if ((this.StowawaysDetected ?? false) && this.StowawaysJoiningLocation.IsNullOrEmpty())
@ -546,8 +544,7 @@ namespace bsmd.database
(this.PlaceOfIssue.IsNullOrEmpty() || !this.DateOfIssue.HasValue))
violations.Add(RuleEngine.CreateViolation(ValidationCode.V765, "Cert. Place or Date of issue missing", null, this.Title, null, this.Tablename));
if ((this.InfectedAreaVisited ?? false) &&
(!this.InfectedAreaDate.HasValue || this.InfectedAreaPort.IsNullOrEmpty()))
if ((this.InfectedAreaVisited ?? false) && this.InfectedAreas.IsNullOrEmpty())
violations.Add(RuleEngine.CreateViolation(ValidationCode.V766, "Infected area date or port missing", null, this.Title, null, this.Tablename));
if (this.portOfCallLast30Days.Count == 0)

View File

@ -23,7 +23,7 @@ namespace bsmd.database
private List<MessageError> errorList = new List<MessageError>();
private List<MessageViolation> violationList = new List<MessageViolation>();
private List<SystemError> systemErrorList = new List<SystemError>();
private List<DatabaseEntity> elements = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> elements = new ObservableCollection<DatabaseEntity>();
#endregion
@ -229,7 +229,7 @@ namespace bsmd.database
/// BRKA, BRKD, LADG, CREW, PAS, SERV, TOWA, TOWD, STO, CREWD, PASD
/// sonst hat die Liste immer ein Element
/// </summary>
public List<DatabaseEntity> Elements { get { return this.elements; } }
public ObservableCollection<DatabaseEntity> Elements { get { return this.elements; } }
/// <summary>
/// Der Meldende

View File

@ -11,13 +11,14 @@ using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace bsmd.database
{
public class NOA_NOD : DatabaseEntity, ISublistContainer
{
List<DatabaseEntity> callPurposes = new List<DatabaseEntity>();
ObservableCollection<DatabaseEntity> callPurposes = new ObservableCollection<DatabaseEntity>();
public NOA_NOD()
{
@ -36,8 +37,8 @@ namespace bsmd.database
[ENI2Validation]
public DateTime? ETDFromPortOfCall { get; set; }
[Validation1(ValidationCode.NOT_NULL)]
public List<DatabaseEntity> CallPurposes { get { return this.callPurposes; } }
[Validation1(ValidationCode.LIST_EMPTY)]
public ObservableCollection<DatabaseEntity> CallPurposes { get { return this.callPurposes; } }
[ShowReport]
[Validation2(ValidationCode.NOT_NULL)]

View File

@ -37,7 +37,7 @@ namespace bsmd.database
[ENI2Validation]
public DateTime? PortOfItineraryETA { get; set; }
[Validation(ValidationCode.LOCODE)]
//[Validation(ValidationCode.LOCODE)]
[ENI2Validation]
public string PortOfItineraryLocode { get; set; }

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.8.7")]
[assembly: AssemblyInformationalVersion("3.8.8")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
[assembly: AssemblyTrademark("")]

View File

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

View File

@ -11,15 +11,16 @@ using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace bsmd.database
{
public class SEC : DatabaseEntity, ISublistContainer
{
private List<DatabaseEntity> ltpfc = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> ltpfc = new ObservableCollection<DatabaseEntity>();
private List<DatabaseEntity> lsts = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> lsts = new ObservableCollection<DatabaseEntity>();
public SEC()
{
@ -152,9 +153,10 @@ namespace bsmd.database
[ENI2Validation]
public DateTime? KielCanalPassagePlannedOutgoing { get; set; }
public List<DatabaseEntity> LastTenPortFacilitesCalled { get { return this.ltpfc; } }
[Validation2(ValidationCode.LIST_EMPTY)]
public ObservableCollection<DatabaseEntity> LastTenPortFacilitesCalled { get { return this.ltpfc; } }
public List<DatabaseEntity> ShipToShipActivitiesDuringLastTenPortFacilitiesCalled { get { return this.lsts; } }
public ObservableCollection<DatabaseEntity> ShipToShipActivitiesDuringLastTenPortFacilitiesCalled { get { return this.lsts; } }
#endregion
@ -343,7 +345,7 @@ namespace bsmd.database
}
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
{
if (this.GetValidationBlock() == ValidationBlock.BLOCK1)
{

View File

@ -115,7 +115,7 @@ namespace bsmd.database
public string ISMCompanyName { get; set; }
[ShowReport]
[Validation(ValidationCode.STRING_EXACT_LEN, 7)]
//[Validation(ValidationCode.STRING_EXACT_LEN, 7)]
[MaxLength(10)]
[ENI2Validation]
public string ISMCompanyId { get; set; }
@ -301,8 +301,8 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty())
violations.Add(RuleEngine.CreateViolation(ValidationCode.V821, "ISMCompanyName", null, this.Title, null, this.Tablename));
if ((this.GrossTonnage.HasValue && (this.GrossTonnage.Value >= 500)) && (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty()))
violations.Add(RuleEngine.CreateViolation(ValidationCode.V821, "ISMCompanyId/Name must be provided", null, this.Title, null, this.Tablename));
}
#endregion

View File

@ -11,15 +11,16 @@ using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace bsmd.database
{
public class WAS : DatabaseEntity, ISublistContainer
{
private List<WasteDisposalServiceProvider> wdsp = new List<WasteDisposalServiceProvider>();
private ObservableCollection<WasteDisposalServiceProvider> wdsp = new ObservableCollection<WasteDisposalServiceProvider>();
private List<DatabaseEntity> waste = new List<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> waste = new ObservableCollection<DatabaseEntity>();
private static readonly int[] dkWasteCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2300, 2309, 3000, 5100, 5200, 5300, 2300 };
private static readonly string[] dkWasteTypes = { "Waste oils - Sludge", "Waste oils - Bilge water", "Waste oils - Other", "Garbage - Food waste", "Garbage - Plastic", "Garbage - Other", "Garbage - Other - Cooking oil", "Garbage - Other - Incinerator ashes and clinkers", "Operational wastes", "Garbage - Other", "Garbage - Other - Animal carcasses", "Sewage", "Cargo residues - Marpol Annex I - Other", "Cargo residues - Marpol Annex II - Other", "Cargo residues - Marpol Annex V - Other", "Garbage - Other" };
@ -68,9 +69,9 @@ namespace bsmd.database
[ENI2Validation]
public bool? ConfirmationOfSufficiency { get; set; }
public List<DatabaseEntity> Waste { get { return this.waste; } }
public ObservableCollection<DatabaseEntity> Waste { get { return this.waste; } }
public List<WasteDisposalServiceProvider> WasteDisposalServiceProvider { get { return this.wdsp; } }
public ObservableCollection<WasteDisposalServiceProvider> WasteDisposalServiceProvider { get { return this.wdsp; } }
/// <summary>
/// Hilfsproperty, um eine kommaseparierte Liste von WasteDisposalServiceProvider (analog ANSW) im ENI-2 anzuzeigen,
@ -136,7 +137,8 @@ namespace bsmd.database
DBManager.Instance.Delete(remainingProvider);
this.WasteDisposalServiceProvider.Clear();
// add existing and new providers
this.WasteDisposalServiceProvider.AddRange(foundList);
foreach(WasteDisposalServiceProvider wdsp in foundList)
this.WasteDisposalServiceProvider.Add(wdsp);
}
}
}

View File

@ -86,8 +86,7 @@ namespace bsmd.database
[ENI2Validation]
public int? WasteType { get; set; }
[ShowReport]
[Validation(ValidationCode.NOT_NULL)]
[ShowReport]
[MaxLength(100)]
[ENI2Validation]
public string WasteDescription { get; set; }
@ -113,9 +112,9 @@ namespace bsmd.database
[ShowReport]
[ENI2Validation]
public double? WasteAmountGeneratedTillNextPort_MTQ { get; set; }
// "dänisches" Zusatzfeld
[ENI2Validation]
[Validation(ValidationCode.NOT_NULL)]
public double? WasteDisposedAtLastPort_MTQ { get; set; }
public string Identifier { get; set; }

View File

@ -33,6 +33,7 @@ namespace bsmd.database
[ShowReport]
[ENI2Validation]
[Validation(ValidationCode.NOT_NULL)]
public byte? WasteDisposalDelivery { get; set; }
public string Identifier { get; set; }