ENI-2 kleines Update (PSC72, DBManager neue Connection pro Aufruf)

This commit is contained in:
Daniel Schick 2017-07-04 18:29:04 +00:00
parent c3be61d219
commit a09d4ae34d
19 changed files with 443 additions and 74 deletions

View File

@ -26,12 +26,12 @@
<value>1000</value>
</setting>
<setting name="LockingServerAddress" serializeAs="String">
<value>http://192.168.2.4/LockingService/LockingService.svc</value>
<!--value>http://heupferd/bsmd.LockingService/LockingService.svc</value-->
<!--value>http://192.168.2.4/LockingService/LockingService.svc</value-->
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
</setting>
<setting name="ConnectionString" serializeAs="String">
<value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
<!--value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
<!--value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
<value>Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
</setting>
</ENI2.Properties.Settings>
</applicationSettings>

View File

@ -20,6 +20,7 @@ namespace ENI2
protected bool _initialized = false;
private DependencyPropertyDescriptor _dpTextBox;
private DependencyPropertyDescriptor _dpDateTimePicker;
private DependencyPropertyDescriptor _dpDatePicker;
private DependencyPropertyDescriptor _dpLocode;
private DependencyPropertyDescriptor _dpCheckbox;
@ -93,13 +94,15 @@ namespace ENI2
public virtual void Initialize() {
_dpTextBox = DependencyPropertyDescriptor.FromProperty(TextBox.TextProperty, typeof(TextBox));
_dpDatePicker = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.DateTimePicker.ValueProperty, typeof(Xceed.Wpf.Toolkit.DateTimePicker));
_dpDateTimePicker = DependencyPropertyDescriptor.FromProperty(Xceed.Wpf.Toolkit.DateTimePicker.ValueProperty, typeof(Xceed.Wpf.Toolkit.DateTimePicker));
_dpDatePicker = DependencyPropertyDescriptor.FromProperty(DatePicker.SelectedDateProperty, typeof(DatePicker));
_dpLocode = DependencyPropertyDescriptor.FromProperty(Controls.LocodeControl.LocodeValueProperty, typeof(Controls.LocodeControl));
_dpCheckbox = DependencyPropertyDescriptor.FromProperty(CheckBox.IsCheckedProperty, typeof(CheckBox));
_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)
{
@ -132,10 +135,16 @@ namespace ENI2
protected void RegisterDateTimePickerChange(Xceed.Wpf.Toolkit.DateTimePicker dateTimePicker, Message.NotificationClass notificationClass)
{
this._dpDatePicker.AddValueChanged(dateTimePicker, this.controlContentChanged);
this._dpDateTimePicker.AddValueChanged(dateTimePicker, this.controlContentChanged);
this._controlClassDict[dateTimePicker] = notificationClass;
}
protected void RegisterDatePickerChange(DatePicker datePicker, Message.NotificationClass notificationClass)
{
this._dpDatePicker.AddValueChanged(datePicker, this.controlContentChanged);
this._controlClassDict[datePicker] = notificationClass;
}
protected void RegisterLocodeChange(Controls.LocodeControl locodeControl, Message.NotificationClass notificationClass)
{
this._dpLocode.AddValueChanged(locodeControl, this.controlContentChanged);

View File

@ -75,10 +75,9 @@ namespace ENI2
// 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);
}
_messages = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessagesForCore(_core, DBManager.MessageLoad.ALL);
BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock);
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0));
}
@ -164,7 +163,7 @@ namespace ENI2
{
if (message.IsDirty)
{
DBManager.Instance.Save(message);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
}
@ -185,7 +184,7 @@ namespace ENI2
{
if (message.IsDirty)
{
DBManager.Instance.Save(message);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(message);
message.SaveElements();
message.IsDirty = false;
this.buttonSaveAll.Visibility = Visibility.Hidden;
@ -242,11 +241,9 @@ namespace ENI2
{
/// core und messages neu laden
///
lock (DBManager.Instance)
{
this._core = DBManager.Instance.GetMessageCoreById(this.Core.Id.Value);
this._messages = DBManager.Instance.GetMessagesForCore(this._core, DBManager.MessageLoad.ALL);
}
this._core = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreById(this.Core.Id.Value);
this._messages = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessagesForCore(this._core, DBManager.MessageLoad.ALL);
// clear existing controls
this.detailView.Children.Clear();

View File

@ -146,6 +146,14 @@ namespace ENI2.DetailViewControls
ebd.BRKA = brka;
ebd.IsDeparture = false;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this._bkraMessage.Elements.Add(ebd.BRKA);
this.dataGridBKRA.Items.Refresh();
ebd.BRKA = new BRKA();
};
if (ebd.ShowDialog() ?? false)
{
brka.MessageHeader = _bkraMessage;
@ -174,6 +182,15 @@ namespace ENI2.DetailViewControls
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = false;
eld.BRKA = brka;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
_bkraMessage.Elements.Add(eld.BRKA);
this.dataGridBKRA.Items.Refresh();
eld.BRKA = new BRKA();
};
if (eld.ShowDialog() ?? false)
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);

View File

@ -371,7 +371,7 @@ namespace ENI2.DetailViewControls
this.Core.QueryNSWStatus = true;
this.Core.StatusCheckErrorCode = string.Empty;
this.Core.StatusCheckErrorMessage = string.Empty;
DBManager.Instance.Save(this.Core);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
this.busyIndicator.IsBusy = true;
@ -391,7 +391,7 @@ namespace ENI2.DetailViewControls
private void _checkStatusTimer_Elapsed(object sender, ElapsedEventArgs e)
{
bool? statusFlag = DBManager.Instance.GetMessageCoreQueryStatusFlag(this.Core.Id.Value);
bool? statusFlag = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreQueryStatusFlag(this.Core.Id.Value);
if (statusFlag ?? true)
{
double elapsedSec = (DateTime.Now - _startStatusCheck).TotalSeconds;

View File

@ -3,11 +3,50 @@
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="groupBoxPre72H" Header="{x:Static p:Resources.textPre72hGroupBox}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="102" />
<RowDefinition Height="28" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static p:Resources.textTanker}" Grid.Column="0" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<CheckBox Name="checkBoxTanker" IsChecked="{Binding Tanker}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<Label Content="{x:Static p:Resources.textTankerHullConfig}" Grid.Column="0" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxTankerHullConfig" Margin="2" SelectedIndex="{Binding TankerHullConfiguration}"/>
<Label Content="{x:Static p:Resources.textTankerCondition}" Grid.Column="0" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<ComboBox Grid.Row="2" Grid.Column="1" Name="comboBoxConditionCargoBallastTanks" Margin="2" SelectedIndex="{Binding ConditionCargoBallastTanks}"/>
<Label Content="{x:Static p:Resources.textTankerNatureOfCargo}" Grid.Column="0" Grid.Row="3" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<TextBox Text="{Binding NatureOfCargo, Mode=TwoWay}" Name="textBoxNatureOfCargo" Grid.Column="1" Grid.Row="3" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textTankerVolumeOfCargo}" Grid.Column="0" Grid.Row="4" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownVolumeOfCargo" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" Value="{Binding VolumeOfCargo, Mode=TwoWay}"/>
<Label Content="{x:Static p:Resources.textPlannedOperations}" Grid.Column="0" Grid.Row="5" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<TextBox Text="{Binding PlannedOperations, Mode=TwoWay}" Name="textBoxPlannedOperations" Grid.Column="1" Grid.Row="5" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textPlannedInspection}" Grid.Column="0" Grid.Row="6" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<TextBox Text="{Binding PlannedWorks, Mode=TwoWay}" Name="textBoxPlannedWorks" Grid.Column="1" Grid.Row="6" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textLastExpandedInspection }" Grid.Column="0" Grid.Row="7" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<DatePicker Grid.Column="1" Grid.Row="7" Name="datePickerLastExpandedInspection" VerticalAlignment="Center" SelectedDate="{Binding DateOfLastExpandedInspection, Mode=TwoWay}" Margin="2,2,2,2" />
<Label Content="{x:Static p:Resources.textPlannedPeriodOfStay}" Grid.Column="0" Grid.Row="8" HorizontalContentAlignment="Right" Margin="0,0,10,0"/>
<xctk:IntegerUpDown Grid.Row="8" Grid.Column="1" Name="integerUpDownPlannedPeriodOfStay" Value="{Binding PlannedPeriodOfStay_HUR, Mode=TwoWay}" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" />
</Grid>
</GroupBox>
</src:DetailBaseControl>

View File

@ -1,21 +1,11 @@
// Copyright (c) 2017 schick Informatik
// Description:
// Description: Detailansicht für PRE72H
//
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,79 @@ namespace ENI2.DetailViewControls
/// </summary>
public partial class PSC72hDetailControl : DetailBaseControl
{
private Message _pre72hMessage;
private static string[] hullConfiguration = {
Properties.Resources.textSingleHull,
Properties.Resources.textSingleHullBallast,
Properties.Resources.textDoubleHull
};
private static string[] conditionCargoTanks =
{
Properties.Resources.textFull,
Properties.Resources.textEmpty,
Properties.Resources.textInert
};
public PSC72hDetailControl()
{
InitializeComponent();
this.Loaded += PSC72hDetailControl_Loaded;
}
private void PSC72hDetailControl_Loaded(object sender, RoutedEventArgs e)
{
this.RegisterCheckboxChange(this.checkBoxTanker, Message.NotificationClass.PRE72H);
this.RegisterComboboxIndexChange(this.comboBoxTankerHullConfig, Message.NotificationClass.PRE72H);
this.RegisterComboboxIndexChange(this.comboBoxConditionCargoBallastTanks, Message.NotificationClass.PRE72H);
this.RegisterTextboxChange(this.textBoxNatureOfCargo, Message.NotificationClass.PRE72H);
this.RegisterDoubleUpDownChange(this.doubleUpDownVolumeOfCargo, Message.NotificationClass.PRE72H);
this.RegisterTextboxChange(this.textBoxPlannedOperations, Message.NotificationClass.PRE72H);
this.RegisterTextboxChange(this.textBoxPlannedWorks, Message.NotificationClass.PRE72H);
this.RegisterDatePickerChange(this.datePickerLastExpandedInspection, Message.NotificationClass.PRE72H);
this.RegisterIntegerUpDownChange(this.integerUpDownPlannedPeriodOfStay, Message.NotificationClass.PRE72H);
}
public override void Initialize()
{
base.Initialize();
foreach (Message aMessage in this.Messages)
{
if (aMessage.MessageNotificationClass == Message.NotificationClass.PRE72H) { this._pre72hMessage = aMessage; this.ControlMessages.Add(aMessage); }
}
#region PRE72H
if (this._pre72hMessage == null)
{
this._pre72hMessage = this.Core.CreateMessage(Message.NotificationClass.PRE72H);
this.Messages.Add(this._pre72hMessage);
}
PRE72H pre72h = null;
if (this._pre72hMessage.Elements.Count > 0)
pre72h = this._pre72hMessage.Elements[0] as PRE72H;
if (pre72h == null)
{
pre72h = new PRE72H();
pre72h.MessageCore = this.Core;
pre72h.MessageHeader = this._pre72hMessage;
_pre72hMessage.Elements.Add(pre72h);
}
this.comboBoxTankerHullConfig.ItemsSource = hullConfiguration;
this.comboBoxConditionCargoBallastTanks.ItemsSource = conditionCargoTanks;
this.groupBoxPre72H.DataContext = pre72h;
#endregion
}
}
}

View File

@ -109,7 +109,7 @@ namespace ENI2.DetailViewControls
{
// are you sure dialog is in base class
_noa_nod.CallPurposes.Remove(cp);
// DBManager.Instance.Delete(cp); // not yet
// DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(cp); // not yet
this.dataGridCallPurposes.Items.Refresh();
}
}

View File

@ -172,7 +172,7 @@ namespace ENI2.DetailViewControls
{
// are you sure dialog is in base class
this._ladgMessage.Elements.Remove(ladg);
// DBManager.Instance.Delete(ladg); // not yet
// DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(ladg); // not yet
this.dataGridLADG.Items.Refresh();
}
}

View File

@ -35,7 +35,7 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>3.6.7.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -17,7 +17,8 @@ namespace ENI2.EditControls
public EditBKRDialog()
{
InitializeComponent();
Loaded += EditBKRDialog_Loaded; ;
Loaded += EditBKRDialog_Loaded;
AddClicked += () => { this.textBoxBunkerType.Focus(); };
}
#region Properties
@ -42,9 +43,10 @@ namespace ENI2.EditControls
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;
}
this.AddVisible = true;
}
private void EditBKRDialog_OKClicked()
public void CopyValuesToEntity()
{
// copy back
if (this.IsDeparture)
@ -59,6 +61,11 @@ namespace ENI2.EditControls
}
}
private void EditBKRDialog_OKClicked()
{
this.CopyValuesToEntity();
}
#endregion
}

View File

@ -250,7 +250,7 @@ namespace ENI2
closedDialog.Core.InitialHIS = Message.NSWProvider.DUDR_TEST;
}
closedDialog.Core.DefaultReportingPartyId = this.userEntity.Id;
DBManager.Instance.Save(closedDialog.Core);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(closedDialog.Core);
// Meldeklassen für neuen Anlauf erzeugen:
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core);

View File

@ -950,6 +950,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Double hull.
/// </summary>
public static string textDoubleHull {
get {
return ResourceManager.GetString("textDoubleHull", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Draught in decimetre.
/// </summary>
@ -995,6 +1004,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Empty.
/// </summary>
public static string textEmpty {
get {
return ResourceManager.GetString("textEmpty", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ENI number.
/// </summary>
@ -1103,6 +1121,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Full.
/// </summary>
public static string textFull {
get {
return ResourceManager.GetString("textFull", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fumigated bulk cargo.
/// </summary>
@ -1130,6 +1157,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Inert.
/// </summary>
public static string textInert {
get {
return ResourceManager.GetString("textInert", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Info.
/// </summary>
@ -1157,6 +1193,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Date of last expanded inspection.
/// </summary>
public static string textLastExpandedInspection {
get {
return ResourceManager.GetString("textLastExpandedInspection", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last name.
/// </summary>
@ -1364,6 +1409,33 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Planned inspection / works.
/// </summary>
public static string textPlannedInspection {
get {
return ResourceManager.GetString("textPlannedInspection", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Planned operations at port of call.
/// </summary>
public static string textPlannedOperations {
get {
return ResourceManager.GetString("textPlannedOperations", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Planned period of stay (hours).
/// </summary>
public static string textPlannedPeriodOfStay {
get {
return ResourceManager.GetString("textPlannedPeriodOfStay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Port area.
/// </summary>
@ -1409,6 +1481,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to PRE72H - 72 hour preannouncement.
/// </summary>
public static string textPre72hGroupBox {
get {
return ResourceManager.GetString("textPre72hGroupBox", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Print.
/// </summary>
@ -1527,7 +1608,7 @@ 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..
/// 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 limit the results..
/// </summary>
public static string textSearchExceededMessage {
get {
@ -1652,6 +1733,24 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Single hull.
/// </summary>
public static string textSingleHull {
get {
return ResourceManager.GetString("textSingleHull", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Single hull with separate ballast tanks.
/// </summary>
public static string textSingleHullBallast {
get {
return ResourceManager.GetString("textSingleHullBallast", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Special requirements.
/// </summary>
@ -1706,6 +1805,51 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Tanker.
/// </summary>
public static string textTanker {
get {
return ResourceManager.GetString("textTanker", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Condition of cargo and ballast tanks.
/// </summary>
public static string textTankerCondition {
get {
return ResourceManager.GetString("textTankerCondition", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tanker hull configuration.
/// </summary>
public static string textTankerHullConfig {
get {
return ResourceManager.GetString("textTankerHullConfig", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Nature of cargo.
/// </summary>
public static string textTankerNatureOfCargo {
get {
return ResourceManager.GetString("textTankerNatureOfCargo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Volume of cargo (t).
/// </summary>
public static string textTankerVolumeOfCargo {
get {
return ResourceManager.GetString("textTankerVolumeOfCargo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ticket No.
/// </summary>

View File

@ -641,10 +641,7 @@
<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>
<value>More than {0} ({1}) search matches found. The first {0} are shown. Please modify your search criteria to limit the results.</value>
</data>
<data name="textDraughtOnArrival" xml:space="preserve">
<value>Draught on arrival</value>
@ -709,6 +706,52 @@
<data name="textCompanyNameOperator" xml:space="preserve">
<value>Company name of the operator</value>
</data>
<data name="textPre72hGroupBox" xml:space="preserve">
<value>PRE72H - 72 hour preannouncement</value>
</data>
<data name="textTanker" xml:space="preserve">
<value>Tanker</value>
</data>
<data name="textTankerHullConfig" xml:space="preserve">
<value>Tanker hull configuration</value>
</data>
<data name="textTankerCondition" xml:space="preserve">
<value>Condition of cargo and ballast tanks</value>
</data>
<data name="textTankerNatureOfCargo" xml:space="preserve">
<value>Nature of cargo</value>
</data>
<data name="textTankerVolumeOfCargo" xml:space="preserve">
<value>Volume of cargo (t)</value>
</data>
<data name="textPlannedOperations" xml:space="preserve">
<value>Planned operations at port of call</value>
</data>
<data name="textPlannedInspection" xml:space="preserve">
<value>Planned inspection / works</value>
</data>
<data name="textLastExpandedInspection" xml:space="preserve">
<value>Date of last expanded inspection</value>
</data>
<data name="textPlannedPeriodOfStay" xml:space="preserve">
<value>Planned period of stay (hours)</value>
</data>
<data name="textSingleHull" xml:space="preserve">
<value>Single hull</value>
</data>
<data name="textSingleHullBallast" xml:space="preserve">
<value>Single hull with separate ballast tanks</value>
</data>
<data name="textDoubleHull" xml:space="preserve">
<value>Double hull</value>
</data>
<data name="textFull" xml:space="preserve">
<value>Full</value>
</data>
<data name="textEmpty" xml:space="preserve">
<value>Empty</value>
</data>
<data name="textInert" xml:space="preserve">
<value>Inert</value>
</data>
</root>

View File

@ -82,15 +82,13 @@ namespace ENI2
// menge suchen
int? resultLimit = null;
int? expectedResultNum = DBManager.Instance.GetNumCoresWithFilters(filterDict);
int? expectedResultNum = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetNumCoresWithFilters(filterDict);
if ((expectedResultNum ?? 0) > 100)
resultLimit = 100;
// suche auslösen
lock (DBManager.Instance)
{
this.anmeldungen = DBManager.Instance.GetMessageCoresWithFilters(filterDict, resultLimit);
}
this.anmeldungen = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict, resultLimit);
BindingOperations.EnableCollectionSynchronization(this.anmeldungen, this.searchLock); // prevent sync lock exceptions (trat bei Sandra auf)

View File

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

Binary file not shown.

View File

@ -27,6 +27,7 @@ namespace bsmd.database
private static Dictionary<Guid, ReportingParty> allReportingParties;
private static Dictionary<string, PortArea> allPortAreas;
private object _lock = new object();
private bool _closeConnectionAfterUse = false;
#endregion
@ -54,6 +55,17 @@ namespace bsmd.database
}
}
public static DBManager GetSingleCon(string dbConnectionString)
{
DBManager aDBManager = new DBManager();
if (aDBManager.Connect(dbConnectionString))
{
aDBManager._closeConnectionAfterUse = true;
return aDBManager;
}
return null;
}
public string ConnectionString { get; set; }
#endregion
@ -105,6 +117,9 @@ namespace bsmd.database
this.LoadCustomer(core);
result.Add(core);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -122,6 +137,9 @@ namespace bsmd.database
this.LoadCustomer(core);
result.Add(core);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -139,6 +157,9 @@ namespace bsmd.database
this.LoadCustomer(core);
result.Add(core);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -151,6 +172,9 @@ namespace bsmd.database
List<ImportHeader> result = new List<ImportHeader>();
foreach (ImportHeader existingHeader in ih.LoadList(reader))
result.Add(existingHeader);
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -163,6 +187,9 @@ namespace bsmd.database
List<ImportValue> result = new List<ImportValue>();
foreach (ImportValue existingValue in iv.LoadList(reader))
result.Add(existingValue);
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -180,6 +207,9 @@ namespace bsmd.database
this.LoadCustomer(core);
result.Add(core);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -190,6 +220,9 @@ namespace bsmd.database
aMessageCore.PrepareCountCmd(cmd, Message.LoadFilter.SEARCH_CORE_FILTERS, filters);
int? result = this.PerformReadIntQuery(cmd);
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -211,6 +244,10 @@ namespace bsmd.database
this.LoadSTATShipName(core);
result.Add(core);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -235,6 +272,9 @@ namespace bsmd.database
result = (MessageCore)cores[0];
this.LoadCustomer(result);
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -263,6 +303,9 @@ namespace bsmd.database
messageList.Add(message);
}
this.LoadMessageDependencies(messageList);
if (this._closeConnectionAfterUse) this.Disconnect();
return messageList;
}
@ -366,6 +409,9 @@ namespace bsmd.database
result.Customer = customers[0] as Customer;
}
}
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
@ -479,7 +525,9 @@ namespace bsmd.database
SqlCommand cmd = new SqlCommand();
entity.PrepareSave(cmd);
int queryResult = this.PerformNonQuery(cmd);
this.LogNonQueryResult(cmd.CommandText, queryResult);
this.LogNonQueryResult(cmd.CommandText, queryResult);
if (this._closeConnectionAfterUse) this.Disconnect();
}
public void Delete(DatabaseEntity entity)
@ -487,7 +535,9 @@ namespace bsmd.database
SqlCommand cmd = new SqlCommand();
entity.PrepareDelete(cmd);
int queryResult = this.PerformNonQuery(cmd);
this.LogNonQueryResult(cmd.CommandText, queryResult);
this.LogNonQueryResult(cmd.CommandText, queryResult);
if (this._closeConnectionAfterUse) this.Disconnect();
}
public void DeleteMessageErrors(Message message)
@ -519,14 +569,20 @@ namespace bsmd.database
SqlCommand cmd = new SqlCommand();
core.PrepareSave(cmd);
int queryResult = this.PerformNonQuery(cmd);
this.LogNonQueryResult(cmd.CommandText, queryResult);
this.LogNonQueryResult(cmd.CommandText, queryResult);
if (this._closeConnectionAfterUse) this.Disconnect();
}
public bool? GetMessageCoreQueryStatusFlag(Guid messageCoreId)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = string.Format("SELECT QueryNSWStatus FROM MessageCore WHERE Id = '{0}'", messageCoreId);
return this.PerformReadFlagQuery(cmd);
bool? result = this.PerformReadFlagQuery(cmd);
if (this._closeConnectionAfterUse) this.Disconnect();
return result;
}
#endregion

View File

@ -61,7 +61,7 @@ namespace bsmd.hisnord
}
_nsw.conveyance.owner_sender.name_short = @"BSMD";
_nsw.conveyance.owner_sender.name_long = rp.Name; // messages[0].MessageCore.Customer.Name;
_nsw.conveyance.owner_sender.name_long = @"BSMD";// rp.Name; // messages[0].MessageCore.Customer.Name;
_nsw.conveyance.owner_sender.address = new addresstype();
@ -71,9 +71,9 @@ namespace bsmd.hisnord
// das hier ist der e-mail(!) Empfänger für Error/Violation Meldungen
_nsw.conveyance.owner_sender.contact = new contacts();
_nsw.conveyance.owner_sender.contact.name = rp.LastName;
_nsw.conveyance.owner_sender.contact.name = @"BSMD"; // rp.LastName;
_nsw.conveyance.owner_sender.contact.email = rp.EMail;
_nsw.conveyance.owner_sender.contact.firstname = rp.FirstName;
_nsw.conveyance.owner_sender.contact.firstname = string.Format("{0} {1}", rp.FirstName, rp.LastName);
_nsw.conveyance.owner_sender.contact.phone = rp.Phone;
_nsw.conveyance.owner_sender.contact.fax = rp.Fax;