3.6.7 ENI. Jetzt mit ArrivalNotification und weiteren Fehlerkorrekturen

This commit is contained in:
Daniel Schick 2017-07-02 16:46:01 +00:00
parent 4ec9ed8be6
commit c3be61d219
24 changed files with 718 additions and 54 deletions

View File

@ -26,10 +26,12 @@
<value>1000</value>
</setting>
<setting name="LockingServerAddress" serializeAs="String">
<value>http://192.168.2.4/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=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>

View File

@ -22,6 +22,24 @@
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="ComboBox">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#101010" />
<Setter Property="Foreground" Value="DarkGray" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="xctk:WatermarkComboBox">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#101010" />
<Setter Property="Foreground" Value="DarkGray" />
</Trigger>
</Style.Triggers>
</Style>
</Application.Resources>
</Application>

View File

@ -99,7 +99,7 @@ namespace ENI2.Controls
this.textBlock = new TextBlock { Text = headerText };
this.textBlock.Foreground = new SolidColorBrush(Colors.Black);
this.textBlock.Background = lockedTab ? Brushes.LightGreen : Brushes.Orange;
// this.textBlock.Background = lockedTab ? Brushes.LightGreen : Brushes.Orange; // sie wollen die bunten Panels doch nicht
this.textBlock.Margin = new Thickness(1);
this.textBlock.VerticalAlignment = VerticalAlignment.Center;

View File

@ -26,6 +26,7 @@ namespace ENI2
private DependencyPropertyDescriptor _dpComboboxIndex;
private DependencyPropertyDescriptor _dpComboboxValue;
private DependencyPropertyDescriptor _dpNumericUpdown;
private DependencyPropertyDescriptor _dpIntUpdown;
private Dictionary<Object, Message.NotificationClass> _controlClassDict = new Dictionary<object, Message.NotificationClass>();
private Dictionary<Message.NotificationClass, Message> _typeMessageDict = new Dictionary<Message.NotificationClass, Message>();
private List<Message> _controlMessages = new List<Message>();
@ -98,6 +99,7 @@ namespace ENI2
_dpComboboxIndex = DependencyPropertyDescriptor.FromProperty(ComboBox.SelectedIndexProperty, typeof(ComboBox));
_dpComboboxValue = DependencyPropertyDescriptor.FromProperty(ComboBox.SelectedValueProperty, typeof(ComboBox));
_dpNumericUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.DoubleUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.DoubleUpDown));
_dpIntUpdown = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty, typeof(Xceed.Wpf.Toolkit.IntegerUpDown));
foreach(Message message in this.Messages)
{
@ -164,6 +166,12 @@ namespace ENI2
this._controlClassDict[doubleUpDown] = notificationClass;
}
protected void RegisterIntegerUpDownChange(Xceed.Wpf.Toolkit.IntegerUpDown intUpDown, Message.NotificationClass notificationClass)
{
this._dpIntUpdown.AddValueChanged(intUpDown, this.controlContentChanged);
this._controlClassDict[intUpDown] = notificationClass;
}
protected void SublistElementChanged(Message.NotificationClass notificationClass)
{
if (_typeMessageDict.ContainsKey(notificationClass))

View File

@ -73,7 +73,12 @@ namespace ENI2
this.listBoxMessages.ItemsSource = this._listBoxList;
_messages = DBManager.Instance.GetMessagesForCore(_core, DBManager.MessageLoad.ALL);
// Locking ergänzt. Ich habe den Eindruck, dass die DataReader Fehler beim BSMD daran liegen, dass das hier länger dauert als
// man eine neue Anmeldung anklickt -> paralleles Laden -> Autsch
lock (DBManager.Instance)
{
_messages = DBManager.Instance.GetMessagesForCore(_core, DBManager.MessageLoad.ALL);
}
BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock);
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0));
}
@ -236,9 +241,12 @@ namespace ENI2
private void DetailControl_RequestReload()
{
/// core und messages neu laden
///
this._core = DBManager.Instance.GetMessageCoreById(this.Core.Id.Value);
this._messages = DBManager.Instance.GetMessagesForCore(this._core, DBManager.MessageLoad.ALL);
///
lock (DBManager.Instance)
{
this._core = DBManager.Instance.GetMessageCoreById(this.Core.Id.Value);
this._messages = DBManager.Instance.GetMessagesForCore(this._core, DBManager.MessageLoad.ALL);
}
// clear existing controls
this.detailView.Children.Clear();

View File

@ -3,11 +3,76 @@
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ENI2.DetailViewControls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
d:DesignHeight="800" d:DesignWidth="1024">
<GroupBox Name="arrivalNotificationGroupBox" Header="{x:Static p:Resources.textPortNotification}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="80" />
<RowDefinition Height="250" />
</Grid.RowDefinitions>
<GroupBox Name="ataGroupBox" Header="ATA" Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<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}" Name="dateTimePickerATA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" Margin="2" AllowTextInput="False" ContextMenu="{DynamicResource ClearContextMenu}"/>
</Grid>
</GroupBox>
<GroupBox Name="tiefaGroupBox" Header="{x:Static p:Resources.textDraughtOnArrival}" Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static p:Resources.textDraughtOnArrivalLabel}" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:DoubleUpDown Grid.Row="0" Grid.Column="1" Name="doubleUpDownDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding DraughtUponArrival_DMT, Mode=TwoWay}"/>
</Grid>
</GroupBox>
<GroupBox Name="pobaGroupBox" Header="{x:Static p:Resources.textPersonOnBoardArrival}" Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Label Content="{x:Static p:Resources.textCrewMemberOnBoard}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:IntegerUpDown Value="{Binding TotalCrewMembersOnBoardUponArrival, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" Name="integerUpDownCrewMemberOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textPassengersOnBoard}" Grid.Column="2" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:IntegerUpDown Value="{Binding TotalPassengersOnBoardUponArrival, Mode=TwoWay}" Grid.Row="0" Grid.Column="3" Name="integerUpDownPassengersOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textStowawaysOnBoard}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:IntegerUpDown Value="{Binding TotalStowawaysOnBoardUponArrival, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" Name="integerUpDownStowawaysOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textPersonsOnBoard}" Grid.Column="2" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:IntegerUpDown Value="{Binding TotalPersonsOnBoardUponArrival, Mode=TwoWay}" Grid.Row="1" Grid.Column="3" Name="integerUpDownPersonsOnBoard" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" />
</Grid>
</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">
<DataGrid.Columns>
<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>
</enictrl:ENIDataGrid>
</GroupBox>
</Grid>
</GroupBox>
</src:DetailBaseControl>

View File

@ -1,21 +1,11 @@
// Copyright (c) 2017 schick Informatik
// Description:
// Description: Detailansicht für ATA, TIEFA, POBA, BKRA
//
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 ENI2.EditControls;
namespace ENI2.DetailViewControls
{
@ -24,9 +14,178 @@ namespace ENI2.DetailViewControls
/// </summary>
public partial class ArrivalNotificationDetailControl : DetailBaseControl
{
private Message _ataMessage;
private Message _tiefaMessage;
private Message _pobaMessage;
private Message _bkraMessage;
public ArrivalNotificationDetailControl()
{
InitializeComponent();
this.Loaded += ArrivalNotificationDetailControl_Loaded;
}
private void ArrivalNotificationDetailControl_Loaded(object sender, RoutedEventArgs e)
{
this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA);
this.RegisterDoubleUpDownChange(this.doubleUpDownDraught, Message.NotificationClass.TIEFA);
this.RegisterIntegerUpDownChange(this.integerUpDownCrewMemberOnBoard, Message.NotificationClass.POBA);
this.RegisterIntegerUpDownChange(this.integerUpDownPassengersOnBoard, Message.NotificationClass.POBA);
this.RegisterIntegerUpDownChange(this.integerUpDownPersonsOnBoard, Message.NotificationClass.POBA);
this.RegisterIntegerUpDownChange(this.integerUpDownStowawaysOnBoard, Message.NotificationClass.POBA);
}
public override void Initialize()
{
base.Initialize();
foreach (Message aMessage in this.Messages)
{
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA) { this._ataMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.TIEFA) { this._tiefaMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.POBA) { this._pobaMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.BKRA) { this._bkraMessage = aMessage; this.ControlMessages.Add(aMessage); }
}
#region ATA
if (this._ataMessage == null)
{
this._ataMessage = this.Core.CreateMessage(Message.NotificationClass.ATA);
this.Messages.Add(this._ataMessage);
}
ATA ata = null;
if (this._ataMessage.Elements.Count > 0)
ata = this._ataMessage.Elements[0] as ATA;
if (ata == null)
{
ata = new ATA();
ata.MessageCore = this.Core;
ata.MessageHeader = this._ataMessage;
_ataMessage.Elements.Add(ata);
}
this.ataGroupBox.DataContext = ata;
#endregion
#region TIEFA
if (this._tiefaMessage == null)
{
this._tiefaMessage = this.Core.CreateMessage(Message.NotificationClass.TIEFA);
this.Messages.Add(this._tiefaMessage);
}
TIEFA tiefa = null;
if (this._tiefaMessage.Elements.Count > 0)
tiefa = this._tiefaMessage.Elements[0] as TIEFA;
if (tiefa == null)
{
tiefa = new TIEFA();
tiefa.MessageCore = this.Core;
tiefa.MessageHeader = this._tiefaMessage;
_tiefaMessage.Elements.Add(tiefa);
}
this.tiefaGroupBox.DataContext = tiefa;
#endregion
#region POBA
if (this._pobaMessage == null)
{
this._pobaMessage = this.Core.CreateMessage(Message.NotificationClass.POBA);
this.Messages.Add(this._pobaMessage);
}
POBA poba = null;
if (this._pobaMessage.Elements.Count > 0)
poba = this._pobaMessage.Elements[0] as POBA;
if (poba == null)
{
poba = new POBA();
poba.MessageCore = this.Core;
poba.MessageHeader = this._pobaMessage;
_pobaMessage.Elements.Add(poba);
}
this.pobaGroupBox.DataContext = poba;
#endregion
#region BKRA
if (this._bkraMessage == null)
{
this._bkraMessage = this.Core.CreateMessage(Message.NotificationClass.BKRA);
this.Messages.Add(this._bkraMessage);
}
this.dataGridBKRA.Initialize();
this.dataGridBKRA.ItemsSource = this._bkraMessage.Elements;
this.dataGridBKRA.AddingNewItem += DataGridBKRA_AddingNewItem;
this.dataGridBKRA.EditRequested += DataGridBKRA_EditRequested;
this.dataGridBKRA.DeleteRequested += DataGridBKRA_DeleteRequested;
this.dataGridBKRA.CreateRequested += DataGridBKRA_CreateRequested;
#endregion
}
#region BKRA grid events
private void DataGridBKRA_CreateRequested()
{
BRKA brka = new BRKA();
EditBKRDialog ebd = new EditBKRDialog();
ebd.BRKA = brka;
ebd.IsDeparture = false;
if (ebd.ShowDialog() ?? false)
{
brka.MessageHeader = _bkraMessage;
_bkraMessage.Elements.Add(brka);
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
}
private void DataGridBKRA_DeleteRequested(DatabaseEntity obj)
{
BRKA brka = obj as BRKA;
if (brka != null)
{
// are you sure dialog is in base class
this._bkraMessage.Elements.Remove(brka);
this.dataGridBKRA.Items.Refresh();
}
}
private void DataGridBKRA_EditRequested(DatabaseEntity obj)
{
BRKA brka = obj as BRKA;
if (brka != null)
{
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = false;
eld.BRKA = brka;
if (eld.ShowDialog() ?? false)
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
}
private void DataGridBKRA_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
{
this.DataGridBKRA_CreateRequested();
}
#endregion
}
}

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>3.6.4.%2a</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.6.7.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -212,6 +212,9 @@
<Compile Include="DetailViewControls\WasteDetailControl.xaml.cs">
<DependentUpon>WasteDetailControl.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditBKRDialog.xaml.cs">
<DependentUpon>EditBKRDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\EditCallPurposeDialog.xaml.cs">
<DependentUpon>EditCallPurposeDialog.xaml</DependentUpon>
</Compile>
@ -309,6 +312,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditBKRDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\EditCallPurposeDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -0,0 +1,26 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.EditBKRDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:enictrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Height="170" Width="400" WindowStyle="SingleBorderWindow" Background="AliceBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static p:Resources.textBunkerType}" Grid.Row="0" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxBunkerType" Margin="2" MinLines="2" MaxLength="100" />
<Label Content="{x:Static p:Resources.textBunkerQuantity}" Grid.Row="1" Grid.Column="0" />
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownBunkerQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1"/>
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,65 @@
// Copyright (c) 2017 schick Informatik
// Description: Dialog zum Bearbeiten von Bunker-Informationen
//
using System.Windows;
using bsmd.database;
using ENI2.Controls;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for EditBKRDialog.xaml
/// </summary>
public partial class EditBKRDialog : EditWindowBase
{
public EditBKRDialog()
{
InitializeComponent();
Loaded += EditBKRDialog_Loaded; ;
}
#region Properties
public bool IsDeparture { get; set; }
public BRKA BRKA { get; set; }
public BRKD BRKD { get; set; }
#endregion
#region event handler
private void EditBKRDialog_Loaded(object sender, RoutedEventArgs e)
{
this.OKClicked += EditBKRDialog_OKClicked; ;
this.Title = this.IsDeparture ? Properties.Resources.textBunkerOnDeparture : Properties.Resources.textBunkerOnArrival;
// copy into fields
this.textBoxBunkerType.Text = this.IsDeparture ? this.BRKD.BunkerFuelType : this.BRKA.BunkerFuelType;
this.doubleUpDownBunkerQuantity.Value = this.IsDeparture ? this.BRKD.BunkerFuelQuantity_TNE : this.BRKA.BunkerFuelQuantity_TNE;
this.OKClicked += EditBKRDialog_OKClicked;
}
private void EditBKRDialog_OKClicked()
{
// copy back
if (this.IsDeparture)
{
this.BRKD.BunkerFuelType = this.textBoxBunkerType.Text.Trim();
this.BRKD.BunkerFuelQuantity_TNE = this.doubleUpDownBunkerQuantity.Value;
}
else
{
this.BRKA.BunkerFuelType = this.textBoxBunkerType.Text.Trim();
this.BRKA.BunkerFuelQuantity_TNE = this.doubleUpDownBunkerQuantity.Value;
}
}
#endregion
}
}

View File

@ -2,19 +2,7 @@
// Description:
//
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.Shapes;
using bsmd.database;
using ENI2.Controls;

View File

@ -572,6 +572,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Beam overall in meter.
/// </summary>
public static string textBeamOverallInMeter {
get {
return ResourceManager.GetString("textBeamOverallInMeter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Border Police.
/// </summary>
@ -590,6 +599,42 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Bunker on arrival.
/// </summary>
public static string textBunkerOnArrival {
get {
return ResourceManager.GetString("textBunkerOnArrival", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bunker on departure.
/// </summary>
public static string textBunkerOnDeparture {
get {
return ResourceManager.GetString("textBunkerOnDeparture", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Quantity of bunker fuel (t).
/// </summary>
public static string textBunkerQuantity {
get {
return ResourceManager.GetString("textBunkerQuantity", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Type of bunker fuel.
/// </summary>
public static string textBunkerType {
get {
return ResourceManager.GetString("textBunkerType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Checking declaration status...
/// </summary>
@ -761,6 +806,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Company name of the operator.
/// </summary>
public static string textCompanyNameOperator {
get {
return ResourceManager.GetString("textCompanyNameOperator", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Confirmation.
/// </summary>
@ -806,6 +860,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Number of crew members on board.
/// </summary>
public static string textCrewMemberOnBoard {
get {
return ResourceManager.GetString("textCrewMemberOnBoard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Declarations.
/// </summary>
@ -887,6 +950,33 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Draught in decimetre.
/// </summary>
public static string textDraughtInDecimetre {
get {
return ResourceManager.GetString("textDraughtInDecimetre", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Draught on arrival.
/// </summary>
public static string textDraughtOnArrival {
get {
return ResourceManager.GetString("textDraughtOnArrival", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Draught on arrival in decimetre.
/// </summary>
public static string textDraughtOnArrivalLabel {
get {
return ResourceManager.GetString("textDraughtOnArrivalLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Edit.
/// </summary>
@ -1004,6 +1094,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Flag.
/// </summary>
public static string textFlag {
get {
return ResourceManager.GetString("textFlag", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fumigated bulk cargo.
/// </summary>
@ -1013,6 +1112,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Gross tonnage.
/// </summary>
public static string textGrossTonnage {
get {
return ResourceManager.GetString("textGrossTonnage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to IMO number.
/// </summary>
@ -1067,6 +1175,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Length overall in meter.
/// </summary>
public static string textLengthOverallInMeter {
get {
return ResourceManager.GetString("textLengthOverallInMeter", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading.
/// </summary>
@ -1130,6 +1247,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// </summary>
public static string textName {
get {
return ResourceManager.GetString("textName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name of master.
/// </summary>
@ -1193,6 +1319,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Number of passengers on board.
/// </summary>
public static string textPassengersOnBoard {
get {
return ResourceManager.GetString("textPassengersOnBoard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password.
/// </summary>
@ -1202,6 +1337,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Persons on board arrival.
/// </summary>
public static string textPersonOnBoardArrival {
get {
return ResourceManager.GetString("textPersonOnBoardArrival", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number of persons on board.
/// </summary>
public static string textPersonsOnBoard {
get {
return ResourceManager.GetString("textPersonsOnBoard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Phone.
/// </summary>
@ -1274,6 +1427,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Purpose of call.
/// </summary>
public static string textPurposeOfCall {
get {
return ResourceManager.GetString("textPurposeOfCall", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Check status.
/// </summary>
@ -1310,6 +1472,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Remarks.
/// </summary>
public static string textRemarks {
get {
return ResourceManager.GetString("textRemarks", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Requested position in port of call.
/// </summary>
@ -1355,6 +1526,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to More than {0} ({1}) search matches found. The first {0} are shown. Please modify your search criteria to see more results..
/// </summary>
public static string textSearchExceededMessage {
get {
return ResourceManager.GetString("textSearchExceededMessage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} seconds elapsed.
/// </summary>
@ -1508,6 +1688,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Number of stowaways on board.
/// </summary>
public static string textStowawaysOnBoard {
get {
return ResourceManager.GetString("textStowawaysOnBoard", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Street / number.
/// </summary>
@ -1535,6 +1724,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Towage on arrival.
/// </summary>
public static string textTowageOnArrival {
get {
return ResourceManager.GetString("textTowageOnArrival", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Transit.
/// </summary>

View File

@ -640,4 +640,75 @@
<data name="textSendToNSW" xml:space="preserve">
<value>Send to NSW</value>
</data>
<data name="textSearchExceededMessage" xml:space="preserve">
<value>More than {0} ({1}) search matches found. The first {0} are shown. Please modify your search criteria to see more results.</value>
</data>
<data name="textArrivalNotification" xml:space="preserve">
<value>Arrival notification</value>
</data>
<data name="textDraughtOnArrival" xml:space="preserve">
<value>Draught on arrival</value>
</data>
<data name="textDraughtOnArrivalLabel" xml:space="preserve">
<value>Draught on arrival in decimetre</value>
</data>
<data name="textPersonOnBoardArrival" xml:space="preserve">
<value>Persons on board arrival</value>
</data>
<data name="textCrewMemberOnBoard" xml:space="preserve">
<value>Number of crew members on board</value>
</data>
<data name="textPassengersOnBoard" xml:space="preserve">
<value>Number of passengers on board</value>
</data>
<data name="textStowawaysOnBoard" xml:space="preserve">
<value>Number of stowaways on board</value>
</data>
<data name="textPersonsOnBoard" xml:space="preserve">
<value>Number of persons on board</value>
</data>
<data name="textBunkerOnArrival" xml:space="preserve">
<value>Bunker on arrival</value>
</data>
<data name="textBunkerOnDeparture" xml:space="preserve">
<value>Bunker on departure</value>
</data>
<data name="textBunkerQuantity" xml:space="preserve">
<value>Quantity of bunker fuel (t)</value>
</data>
<data name="textBunkerType" xml:space="preserve">
<value>Type of bunker fuel</value>
</data>
<data name="textTowageOnArrival" xml:space="preserve">
<value>Towage on arrival</value>
</data>
<data name="textName" xml:space="preserve">
<value>Name</value>
</data>
<data name="textPurposeOfCall" xml:space="preserve">
<value>Purpose of call</value>
</data>
<data name="textFlag" xml:space="preserve">
<value>Flag</value>
</data>
<data name="textDraughtInDecimetre" xml:space="preserve">
<value>Draught in decimetre</value>
</data>
<data name="textGrossTonnage" xml:space="preserve">
<value>Gross tonnage</value>
</data>
<data name="textLengthOverallInMeter" xml:space="preserve">
<value>Length overall in meter</value>
</data>
<data name="textBeamOverallInMeter" xml:space="preserve">
<value>Beam overall in meter</value>
</data>
<data name="textRemarks" xml:space="preserve">
<value>Remarks</value>
</data>
<data name="textCompanyNameOperator" xml:space="preserve">
<value>Company name of the operator</value>
</data>
</root>

View File

@ -70,7 +70,7 @@
<DataGridTextColumn Header="Status" Binding="{Binding BSMDStatusInternal}" IsReadOnly="True" />
<DataGridTextColumn Header="{x:Static p:Resources.textTicketNo}" Binding="{Binding TicketNo}" IsReadOnly="True" />
<DataGridTextColumn Header="Edited by" Binding="{Binding EditedBy}" IsReadOnly="True" Width="*" />
<DataGridCheckBoxColumn Header="Locked" Binding="{Binding Locked}" IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
</Grid>

View File

@ -87,7 +87,11 @@ namespace ENI2
resultLimit = 100;
// suche auslösen
this.anmeldungen = DBManager.Instance.GetMessageCoresWithFilters(filterDict, resultLimit);
lock (DBManager.Instance)
{
this.anmeldungen = DBManager.Instance.GetMessageCoresWithFilters(filterDict, resultLimit);
}
BindingOperations.EnableCollectionSynchronization(this.anmeldungen, this.searchLock); // prevent sync lock exceptions (trat bei Sandra auf)
if (App.UserId.HasValue)
@ -114,6 +118,13 @@ namespace ENI2
this.dataGrid.ItemsSource = this.anmeldungen;
this.searchResultLabel.Content = ((expectedResultNum ?? 0) > 0) ? string.Format("{0} results found, {1} displayed.", (expectedResultNum ?? 0), this.anmeldungen.Count) : "no results";
if((expectedResultNum ?? 0) > 100)
{
// Messagebox damit es wirklich jeder merkt :\
string searchMessage = string.Format(Properties.Resources.textSearchExceededMessage, 100, expectedResultNum.Value);
MessageBox.Show(searchMessage, Properties.Resources.textInfo, MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
private void etaValueChanged(object sender, EventArgs args)

View File

@ -34,19 +34,21 @@ namespace ENI2.Util
lock (this._entityLock)
{
List<MessageCore> changedCores = new List<MessageCore>();
foreach (MessageCore watchedEntity in this._watchedEntities.Keys)
lock (DBManager.Instance)
{
MessageCore entity = DBManager.Instance.GetMessageCoreById(watchedEntity.Id ?? Guid.Empty);
if (entity != null)
foreach (MessageCore watchedEntity in this._watchedEntities.Keys)
{
if (entity.Changed.HasValue && (entity.Changed.Value > this._watchedEntities[watchedEntity]))
MessageCore entity = DBManager.Instance.GetMessageCoreById(watchedEntity.Id ?? Guid.Empty);
if (entity != null)
{
OnDatabaseEntityChanged(entity);
changedCores.Add(entity);
if (entity.Changed.HasValue && (entity.Changed.Value > this._watchedEntities[watchedEntity]))
{
OnDatabaseEntityChanged(entity);
changedCores.Add(entity);
}
}
}
}
foreach(MessageCore changedCore in changedCores)
this._watchedEntities[changedCore] = DateTime.Now; // nur einmal auslösen
}

Binary file not shown.

View File

@ -166,6 +166,7 @@ namespace bsmd.ExcelReadService
}
catch (Exception ex)
{
_log.Error(ex.ToString());
readMessage = string.Format("{0} Unerwartete Fehlersitutation:Bitte Info an Christin od. Daniel", ex.Message);
}

View File

@ -1736,11 +1736,22 @@ namespace bsmd.ExcelReadService
{
while (l10fc.PortFacilityGISISCode.Length < 4) l10fc.PortFacilityGISISCode = "0" + l10fc.PortFacilityGISISCode;
}
reader.Conf.ConfirmText(portGISISCode, l10fc.PortFacilityGISISCode, l10fc.PortFacilityGISISCode.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
if (l10fc.PortFacilityGISISCode.IsNullOrEmpty())
{
reader.Conf.ConfirmText(portGISISCode, l10fc.PortFacilityGISISCode, ExcelReader.ReadState.FAIL);
}
else
{
reader.Conf.ConfirmText(portGISISCode, l10fc.PortFacilityGISISCode, l10fc.PortFacilityGISISCode.IsDigitsOnly() ? ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
}
l10fc.PortFacilitySecurityMattersToReport = reader.ReadText(portSecMatters);
reader.Conf.ConfirmText(portSecMatters, l10fc.PortFacilitySecurityMattersToReport, l10fc.PortFacilitySecurityMattersToReport.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL :ExcelReader.ReadState.OK);
// keinen "leeren" Hafen anlegen, wenn der Eintrag leer war (trifft anscheinend bei Neubauten zu, siehe E-Mail Christin vom 20./22.6.17
if (l10fc.PortFacilityPortName.IsNullOrEmpty() && l10fc.PortFacilityPortLoCode.IsNullOrEmpty() && l10fc.PortFacilityPortCountry.IsNullOrEmpty())
sec.LastTenPortFacilitesCalled.Remove(l10fc);
}
// Ship2ShipActivities

View File

@ -21,6 +21,7 @@ namespace bsmd.database
{
protected Guid? id;
protected string tablename;
private Guid instance_id = Guid.NewGuid(); // Comparison id in case entity has not been saved
public enum ValidationBlock
{
@ -156,7 +157,10 @@ namespace bsmd.database
public bool Equals(DatabaseEntity other)
{
return null != other && Id == other.Id;
if (other == null) return false;
if (this.Id.HasValue && other.Id.HasValue && (this.Id.Value != Guid.Empty) && (other.Id.Value != Guid.Empty))
return this.Id == other.Id;
return this.GetHashCode() == other.GetHashCode();
}
public override bool Equals(object obj)
@ -166,6 +170,8 @@ namespace bsmd.database
public override int GetHashCode()
{
if (!this.Id.HasValue || this.Id.Value == Guid.Empty)
return this.instance_id.GetHashCode();
return this.Id.GetHashCode();
}

View File

@ -12,6 +12,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using log4net;
using System.Linq;
namespace bsmd.database
{
@ -50,6 +51,16 @@ namespace bsmd.database
return new Regex(pattern).IsMatch(str);
}
public static bool IsDigitsOnly(this String str)
{
foreach (char c in str)
{
if (c < '0' || c > '9')
return false;
}
return true;
}
public static bool IsBoolean(this String str)
{
if (str == null) return false;
@ -126,6 +137,6 @@ namespace bsmd.database
List<string> result = new List<string>(source.Split(splitDelimiter, StringSplitOptions.RemoveEmptyEntries));
return result;
}
}
}

View File

@ -684,6 +684,13 @@ namespace bsmd.database
return this.MessageNotificationClass.CompareTo(other.MessageNotificationClass);
}
/*
public override int GetHashCode()
{
return this.Id.GetHashCode() * 17 + this.messageCoreId.GetHashCode() * 17 + this.MessageNotificationClass.GetHashCode();
}
*/
#endregion
}

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.6.5")]
[assembly: AssemblyInformationalVersion("3.6.7")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")]

View File

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