diff --git a/ENI-2/ENI2/ENI2/App.config b/ENI-2/ENI2/ENI2/App.config
index 85221ef7..b54015b3 100644
--- a/ENI-2/ENI2/ENI2/App.config
+++ b/ENI-2/ENI2/ENI2/App.config
@@ -17,7 +17,7 @@ Sample license text.
- Data Source=(localdb)\Projects;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False
+ Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False
@@ -28,4 +28,16 @@ Sample license text.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/App.xaml.cs b/ENI-2/ENI2/ENI2/App.xaml.cs
index 325415f6..f4960bf5 100644
--- a/ENI-2/ENI2/ENI2/App.xaml.cs
+++ b/ENI-2/ENI2/ENI2/App.xaml.cs
@@ -9,6 +9,7 @@ using bsmd.database;
using System.Windows.Controls;
using System.Windows.Input;
using System;
+using ENI2.LockingServiceReference;
namespace ENI2
{
@@ -17,6 +18,7 @@ namespace ENI2
///
public partial class App : Application
{
+ private ServiceClient lockingServiceClient;
public App() : base()
{
@@ -39,6 +41,15 @@ namespace ENI2
LADG.CargoHandlingDict.Add(key, cargoHandlingDict[key]);
EventManager.RegisterClassHandler(typeof(DatePicker), DatePicker.PreviewKeyDownEvent, new KeyEventHandler(this.DatePicker_PreviewKeyDown));
+ try
+ {
+ // this.lockingServiceClient = new ServiceClient();
+ }
+ catch(Exception ex)
+ {
+ System.Diagnostics.Trace.WriteLine("Exception creating locking service client: {0}", ex.ToString());
+ }
+
}
private void Dispatcher_UnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
diff --git a/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs b/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs
index 17dab016..99c94d4d 100644
--- a/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs
+++ b/ENI-2/ENI2/ENI2/Controls/EditWindowBase.cs
@@ -12,13 +12,14 @@ namespace ENI2.Controls
///
/// Basisklasse aller Bearbeitungsdialoge. OK/Cancel Buttons und Window Placement
///
- [TemplatePart(Name = "buttonOK",Type = typeof(Button))]
+ [TemplatePart(Name = "buttonOK", Type = typeof(Button))]
[TemplatePart(Name = "buttonCancel", Type = typeof(Button))]
public class EditWindowBase : Window
{
public event Action OKClicked;
public event Action CancelClicked;
+ protected bool shouldCancel;
static EditWindowBase()
{
@@ -36,9 +37,9 @@ namespace ENI2.Controls
};
}
- private void Window_Closing(object sender, CancelEventArgs e)
+ private void Window_Closing(object sender, CancelEventArgs e)
{
- // ENI2.Properties.Settings.Default.M
+ if (this.shouldCancel) e.Cancel = true;
}
protected override void OnSourceInitialized(EventArgs e)
@@ -50,6 +51,7 @@ namespace ENI2.Controls
protected virtual void OnOkClicked()
{
this.DialogResult = true;
+ this.shouldCancel = false;
OKClicked?.Invoke();
}
diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
index 9f09799e..5aa15457 100644
--- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
@@ -36,9 +36,9 @@ namespace ENI2
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textSecurity, MessageGroupControlType = typeof(SecurityDetailControl), ImagePath = "Resources/shield_yellow.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textPSC72h, MessageGroupControlType = typeof(PSC72hDetailControl), ImagePath = "Resources/alarmclock.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textMDH, MessageGroupControlType = typeof(MaritimeHealthDeclarationDetailControl), ImagePath = "Resources/medical_bag.png" });
- this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" });
- this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDepartureNotification, MessageGroupControlType = typeof(DepartureNotificationDetailControl), ImagePath = "Resources/arrow_up_right_green.png" });
+ this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textShipData, MessageGroupControlType = typeof(ShipDataDetailControl), ImagePath = "Resources/containership.png" });
+ this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textBorderPolice, MessageGroupControlType = typeof(BorderPoliceDetailControl), ImagePath = "Resources/policeman_german.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGArrival, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textDGDeparture, MessageGroupControlType = typeof(DangerousGoodsDetailControl), ImagePath = "Resources/sign_warning_radiation.png" });
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" });
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
index d3e9fad7..d791a5ce 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml
@@ -18,16 +18,19 @@
+
-
-
+
+
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index be754703..5af3e489 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -17,7 +17,10 @@ namespace ENI2.DetailViewControls
///
public partial class OverViewDetailControl : DetailBaseControl
{
- private Message _message = null;
+ private Message _message = null;
+ private Message _ataMessage;
+ private Message _atdMessage;
+ private Message _noanodMessage;
public OverViewDetailControl()
{
@@ -35,9 +38,9 @@ namespace ENI2.DetailViewControls
this.textBoxENI.DataContext = this.Core;
this.textBoxIMO.DataContext = this.Core;
- this.locodePoC.DataContext = this.Core;
- this.dateTimePickerETA.DataContext = this.Core;
- //this.dateTimePickerETD.DataContext = ..
+ this.locodePoC.DataContext = this.Core;
+ this.textBoxTicketNo.DataContext = this.Core;
+
this.labelCreated.Content = this.Core.Created?.ToString();
Binding vtBinding = new Binding();
@@ -51,6 +54,13 @@ namespace ENI2.DetailViewControls
{
if (aMessage.MessageNotificationClass == notificationClass)
_message = aMessage;
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
+ this._ataMessage = aMessage;
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.ATD)
+ this._atdMessage = aMessage;
+ if (aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
+ this._noanodMessage = aMessage;
+
switch(aMessage.MessageNotificationClass)
{
case Message.NotificationClass.VISIT:
@@ -101,26 +111,27 @@ namespace ENI2.DetailViewControls
aMessage.ENINotificationDetailGroup = Properties.Resources.textMDH;
aMessage.ENINotificationDetailIndex = 7;
break;
- case Message.NotificationClass.STAT:
- aMessage.ENINotificationIconString = "../Resources/containership.png";
- aMessage.ENINotificationDetailGroup = Properties.Resources.textShipData;
- aMessage.ENINotificationDetailIndex = 8;
- break;
- case Message.NotificationClass.BPOL:
- case Message.NotificationClass.CREW:
- case Message.NotificationClass.PAS:
- aMessage.ENINotificationIconString = "../Resources/policeman_german.png";
- aMessage.ENINotificationDetailGroup = Properties.Resources.textBorderPolice;
- aMessage.ENINotificationDetailIndex = 9;
- break;
case Message.NotificationClass.ATD:
case Message.NotificationClass.TIEFD:
case Message.NotificationClass.BKRD:
case Message.NotificationClass.POBD:
aMessage.ENINotificationIconString = "../Resources/arrow_up_right_green.png";
aMessage.ENINotificationDetailGroup = Properties.Resources.textDepartureNotification;
+ aMessage.ENINotificationDetailIndex = 8;
+ break;
+ case Message.NotificationClass.STAT:
+ aMessage.ENINotificationIconString = "../Resources/containership.png";
+ aMessage.ENINotificationDetailGroup = Properties.Resources.textShipData;
+ aMessage.ENINotificationDetailIndex = 9;
+ break;
+ case Message.NotificationClass.BPOL:
+ case Message.NotificationClass.CREW:
+ case Message.NotificationClass.PAS:
+ aMessage.ENINotificationIconString = "../Resources/policeman_german.png";
+ aMessage.ENINotificationDetailGroup = Properties.Resources.textBorderPolice;
aMessage.ENINotificationDetailIndex = 10;
break;
+
case Message.NotificationClass.HAZA:
aMessage.ENINotificationIconString = "../Resources/sign_warning_radiation.png";
aMessage.ENINotificationDetailGroup = Properties.Resources.textDGArrival;
@@ -141,14 +152,105 @@ namespace ENI2.DetailViewControls
aMessage.ENINotificationDetailGroup = "unspecified";
break;
}
-
- }
+ }
+
+ // Meldeklassen nach ihrem Vorkommen in den Detailansichten sortieren (SH, 12.5.17)
+ this.Messages.Sort((a, b) =>
+ {
+ if (a.ENINotificationDetailIndex == b.ENINotificationDetailIndex)
+ return a.MessageNotificationClassDisplay.CompareTo(b.MessageNotificationClassDisplay);
+ return a.ENINotificationDetailIndex.CompareTo(b.ENINotificationDetailIndex);
+ });
if (_message != null)
{
-
+ // kann das eigentlich passieren??!
}
+
+ #region init ATA
+
+ // ganz hakelig ich weiß dafür kapiert das gleich jeder
+ if (this._ataMessage == null)
+ {
+ this._ataMessage = this.Core.CreateMessage(Message.NotificationClass.ATA);
+ this.Messages.Add(this._ataMessage);
+ this._ataMessage.ENINotificationIconString = "../Resources/arrow_down_right_red.png";
+ this._ataMessage.ENINotificationDetailGroup = Properties.Resources.textArrivalNotification;
+ this._ataMessage.ENINotificationDetailIndex = 4;
+ }
+
+ 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.dateTimePickerATA.DataContext = ata;
+
+ #endregion
+
+ #region init ATD
+
+ if (this._atdMessage == null)
+ {
+ this._atdMessage = this.Core.CreateMessage(Message.NotificationClass.ATD);
+ this.Messages.Add(this._atdMessage);
+ this._atdMessage.ENINotificationIconString = "../Resources/arrow_up_right_green.png";
+ this._atdMessage.ENINotificationDetailGroup = Properties.Resources.textDepartureNotification;
+ this._atdMessage.ENINotificationDetailIndex = 10;
+ }
+
+ ATD atd = null;
+ if (this._atdMessage.Elements.Count > 0)
+ atd = this._atdMessage.Elements[0] as ATD;
+
+ if (atd == null)
+ {
+ atd = new ATD();
+ atd.MessageCore = this.Core;
+ atd.MessageHeader = this._atdMessage;
+ _atdMessage.Elements.Add(atd);
+ }
+
+ this.dateTimePickerATD.DataContext = atd;
+
+ #endregion
+
+ #region init NOA_NOD
+
+ if (this._noanodMessage == null)
+ {
+ this._noanodMessage = this.Core.CreateMessage(Message.NotificationClass.NOA_NOD);
+ this.Messages.Add(this._noanodMessage);
+ _noanodMessage.ENINotificationIconString = "../Resources/eye_blue.png";
+ _noanodMessage.ENINotificationDetailGroup = Properties.Resources.textPortCall;
+ _noanodMessage.ENINotificationDetailIndex = 1;
+ }
+
+ NOA_NOD noa_nod = null;
+ if (this._noanodMessage.Elements.Count > 0)
+ noa_nod = this._noanodMessage.Elements[0] as NOA_NOD;
+
+ if (noa_nod == null)
+ {
+ noa_nod = new NOA_NOD();
+ noa_nod.MessageCore = this.Core;
+ noa_nod.MessageHeader = this._noanodMessage;
+ _noanodMessage.Elements.Add(noa_nod);
+ }
+
+ this.dateTimePickerETD.DataContext = noa_nod;
+ this.dateTimePickerETA.DataContext = noa_nod;
+
+ #endregion
+
this.dataGridMessages.ItemsSource = this.Messages;
this._initialized = true;
}
@@ -192,5 +294,29 @@ namespace ENI2.DetailViewControls
#endregion
+ #region Command button event handler
+
+ private void buttonStorno_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void buttonCopy_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void buttonSendPDF_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void buttonQueryHIS_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ #endregion
+
}
}
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 09141b91..711e8422 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -35,7 +35,7 @@
3.5.1.0
true
publish.html
- 7
+ 9
3.5.7.%2a
false
true
@@ -105,6 +105,8 @@
False
+
+
@@ -218,7 +220,15 @@
EditSERVDialog.xaml
+
+ VisitIdDialog.xaml
+
+
+ True
+ True
+ Reference.svcmap
+
SucheControl.xaml
@@ -302,6 +312,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -344,6 +358,13 @@
Settings.settings
True
+
+
+
+
+ WCF Proxy Generator
+ Reference.cs
+
Always
@@ -353,6 +374,16 @@
Designer
+
+
+ Designer
+
+
+ Designer
+
+
+ Designer
+
@@ -471,7 +502,12 @@
-
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml
new file mode 100644
index 00000000..e2211ce7
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml.cs
new file mode 100644
index 00000000..6eaa98fc
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/EditControls/VisitIdDialog.xaml.cs
@@ -0,0 +1,65 @@
+// Copyright (c) 2017 schick Informatik
+// Description: Mit diesem Dialog können neue Visit/Transit-Id's beantragt werden (DE only)
+//
+
+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 ENI2.Controls;
+
+using bsmd.database;
+
+namespace ENI2.EditControls
+{
+ ///
+ /// Interaction logic for VisitIdDialog.xaml
+ ///
+ public partial class VisitIdDialog : EditWindowBase
+ {
+ public VisitIdDialog()
+ {
+ InitializeComponent();
+ Loaded += VisitIdDialog_Loaded;
+ }
+
+ private void VisitIdDialog_Loaded(object sender, RoutedEventArgs e)
+ {
+ this.OKClicked += VisitIdDialog_OKClicked;
+ }
+
+ private void VisitIdDialog_OKClicked()
+ {
+ // Validate entries, write back to model etc pp
+
+ if(this.locodePoC.LocodeValue == "ZZNOK")
+ {
+ this.Core.IsTransit = true;
+ this.Core.ETAKielCanal = this.datePickerETA.SelectedDate;
+
+ }
+ else
+ {
+ this.Core.IsTransit = false;
+ this.Core.ETA = this.datePickerETA.SelectedDate;
+ }
+
+ this.Core.PoC = this.locodePoC.LocodeValue;
+
+
+
+ }
+
+ public MessageCore Core { get; set; }
+
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/LocalizedLookup.cs b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
index 08974cb4..a69c58db 100644
--- a/ENI-2/ENI2/ENI2/LocalizedLookup.cs
+++ b/ENI-2/ENI2/ENI2/LocalizedLookup.cs
@@ -41,7 +41,7 @@ namespace ENI2
public static Dictionary getPortAreasForLocode(string locode)
{
Dictionary result = new Dictionary();
- string query = string.Format("SELECT Code, PortArea FROM INFO_PortArea WHERE Locode = '{0}'", locode);
+ string query = string.Format("SELECT Code, PortArea FROM INFO_PortArea WHERE Locode = '{0}' ORDER BY PortArea", locode);
SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader();
while(reader.Read())
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml b/ENI-2/ENI2/ENI2/MainWindow.xaml
index 95a4bf5b..cc4ebe49 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml
@@ -16,7 +16,7 @@
CanExecute="CanExecuteClearCommand" />
-
+
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
index 436a34d7..16746c70 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
@@ -1,5 +1,5 @@
// Copyright (c) 2017 schick Informatik
-// Description:
+// Description: The main application window
//
using System;
@@ -7,11 +7,13 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
+using System.Windows.Media;
using System.Windows.Media.Imaging;
using bsmd.database;
using System.Windows.Controls;
using ENI2.Controls;
+using ENI2.EditControls;
namespace ENI2
{
@@ -20,25 +22,21 @@ namespace ENI2
///
public partial class MainWindow : Window
{
- private bool dbConnected;
- //private VorgaengeControl vorgaengeControl;
- //private AnmeldungenControl anmeldungenControl;
+ private bool dbConnected;
private SucheControl sucheControl;
private List anmeldungen = new List();
private bool efMode = false;
+ ScaleTransform _transform = new ScaleTransform(1.0, 1.0);
public MainWindow()
{
InitializeComponent();
- //this.vorgaengeControl = new VorgaengeControl();
- //this.anmeldungenControl = new AnmeldungenControl();
this.sucheControl = new SucheControl();
this.tabSearch.Content = this.sucheControl;
- this.sucheControl.buttonSuche.IsDefault = true;
- //this.anmeldungenControl.MessageCoreSelected += AnmeldungenControl_MessageCoreSelected;
+ this.sucheControl.buttonSuche.IsDefault = true;
this.sucheControl.MessageCoreSelected += AnmeldungenControl_MessageCoreSelected;
-
+ this.mainPanel.LayoutTransform = this._transform;
}
private void AnmeldungenControl_MessageCoreSelected(MessageCore aMessageCore)
@@ -54,47 +52,7 @@ namespace ENI2
}
}
- #region Window control click event handler
-
- private void buttonAnmeldungen_Click(object sender, RoutedEventArgs e)
- {
-
- if (dbConnected)
- {
- this.anmeldungen = DBManager.Instance.GetMessageCoresByStatus(MessageCore.BSMDStatus.PREPARE);
- /*
- this.generalProgressStatus.Value = 0;
- this.generalProgressStatus.Maximum = cores.Count;
- foreach (MessageCore core in cores)
- {
- this.generalProgressStatus.Dispatcher.Invoke(() => this.generalProgressStatus.Value++, System.Windows.Threading.DispatcherPriority.Background);
- MessageCoreModel mcm = new MessageCoreModel(core);
- this.anmeldungen.Add(mcm);
- }
- */
- }
- //anmeldungenControl.dataGrid.ItemsSource = this.anmeldungen;
-
- //mainFrame.Children.Add(this.anmeldungenControl);
-
- }
-
- /*
- private void buttonVorgaenge_Click(object sender, RoutedEventArgs e)
- {
- mainFrame.Children.Clear();
- mainFrame.Children.Add(this.vorgaengeControl);
- }
- */
-
- /*
- private void buttonSuche_Click(object sender, RoutedEventArgs e)
- {
- mainFrame.Children.Clear();
- mainFrame.Children.Add(this.sucheControl);
- this.sucheControl.buttonSuche.IsDefault = true;
- }
- */
+ #region Window control click event handler
private void logoImage_MouseUp(object sender, MouseButtonEventArgs e)
{
@@ -159,7 +117,15 @@ namespace ENI2
private void buttonNewTransitIdClick(object sender, RoutedEventArgs e)
{
- // TODO
+
+ MessageCore newCore = new MessageCore();
+ VisitIdDialog visitIdDialog = new VisitIdDialog();
+ visitIdDialog.Core = newCore;
+
+ if (visitIdDialog.ShowDialog() ?? false)
+ {
+
+ }
}
private void closeButton_Click(object sender, RoutedEventArgs e)
@@ -174,5 +140,31 @@ namespace ENI2
#endregion
+ #region mouse wheel / zooming events
+
+ protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
+ {
+ base.OnPreviewMouseWheel(e);
+ if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
+ {
+ this._transform.ScaleX += (e.Delta > 0) ? 0.05 : -0.05;
+ this._transform.ScaleY += (e.Delta > 0) ? 0.05 : -0.05;
+ }
+ }
+
+ protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
+ {
+ base.OnPreviewMouseDown(e);
+ if (e.ChangedButton == MouseButton.Middle)
+ {
+ if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
+ {
+ this._transform.ScaleX = 1.0;
+ this._transform.ScaleY = 1.0;
+ }
+ }
+ }
+ #endregion
+
}
}
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
index 5c120cca..beb6fe29 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.Designer.cs
@@ -429,6 +429,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Cancel declaration.
+ ///
+ public static string textCancelDeclaration {
+ get {
+ return ResourceManager.GetString("textCancelDeclaration", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Confirm deletion.
///
@@ -457,7 +466,7 @@ namespace ENI2.Properties {
}
///
- /// Looks up a localized string similar to Gross quantity.
+ /// Looks up a localized string similar to Gross quantity (t).
///
public static string textCargoGrossQuantity {
get {
@@ -573,6 +582,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Copy data.
+ ///
+ public static string textCopyData {
+ get {
+ return ResourceManager.GetString("textCopyData", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Created.
///
@@ -582,6 +600,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Create PDF.
+ ///
+ public static string textCreatePDF {
+ get {
+ return ResourceManager.GetString("textCreatePDF", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Declarations.
///
@@ -610,7 +637,7 @@ namespace ENI2.Properties {
}
///
- /// Looks up a localized string similar to Deplacement summer draught.
+ /// Looks up a localized string similar to Dead weight summer (t).
///
public static string textDeplacementSummerDraught {
get {
@@ -987,6 +1014,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Check status.
+ ///
+ public static string textQueryHIS {
+ get {
+ return ResourceManager.GetString("textQueryHIS", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Requested position in port of call.
///
@@ -1140,6 +1176,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Ticket No.
+ ///
+ public static string textTicketNo {
+ get {
+ return ResourceManager.GetString("textTicketNo", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Towage.
///
diff --git a/ENI-2/ENI2/ENI2/Properties/Resources.resx b/ENI-2/ENI2/ENI2/Properties/Resources.resx
index 12c0e7a2..3ce492d0 100644
--- a/ENI-2/ENI2/ENI2/Properties/Resources.resx
+++ b/ENI-2/ENI2/ENI2/Properties/Resources.resx
@@ -395,7 +395,7 @@
Fumigated bulk cargo
- Deplacement summer draught
+ Dead weight summer (t)
Port area
@@ -434,7 +434,7 @@
Number of items
- Gross quantity
+ Gross quantity (t)
Port of loading
@@ -490,4 +490,19 @@
Created
+
+ Cancel declaration
+
+
+ Copy data
+
+
+ Create PDF
+
+
+ Check status
+
+
+ Ticket No
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.disco b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.disco
new file mode 100644
index 00000000..fa1cdbcc
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.disco
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.wsdl b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.wsdl
new file mode 100644
index 00000000..4e2d4019
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.wsdl
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.xsd b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.xsd
new file mode 100644
index 00000000..088cf338
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService.xsd
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService1.xsd b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService1.xsd
new file mode 100644
index 00000000..f8a4c6c1
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService1.xsd
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService2.xsd b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService2.xsd
new file mode 100644
index 00000000..32e1c19a
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/LockingService2.xsd
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.cs b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.cs
new file mode 100644
index 00000000..8e155f75
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.cs
@@ -0,0 +1,102 @@
+//------------------------------------------------------------------------------
+//
+// 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.
+//
+//------------------------------------------------------------------------------
+
+namespace ENI2.LockingServiceReference {
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ [System.ServiceModel.ServiceContractAttribute(ConfigurationName="LockingServiceReference.IService")]
+ public interface IService {
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Lock", ReplyAction="http://tempuri.org/IService/LockResponse")]
+ bool Lock(System.Guid messageCoreId, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Lock", ReplyAction="http://tempuri.org/IService/LockResponse")]
+ System.Threading.Tasks.Task LockAsync(System.Guid messageCoreId, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Unlock", ReplyAction="http://tempuri.org/IService/UnlockResponse")]
+ void Unlock(System.Guid messageCoreId, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Unlock", ReplyAction="http://tempuri.org/IService/UnlockResponse")]
+ System.Threading.Tasks.Task UnlockAsync(System.Guid messageCoreId, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/LockRefresh", ReplyAction="http://tempuri.org/IService/LockRefreshResponse")]
+ void LockRefresh(System.Guid[] currentLocks, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/LockRefresh", ReplyAction="http://tempuri.org/IService/LockRefreshResponse")]
+ System.Threading.Tasks.Task LockRefreshAsync(System.Guid[] currentLocks, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Log", ReplyAction="http://tempuri.org/IService/LogResponse")]
+ void Log(string msg, string host, string userId);
+
+ [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService/Log", ReplyAction="http://tempuri.org/IService/LogResponse")]
+ System.Threading.Tasks.Task LogAsync(string msg, string host, string userId);
+ }
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ public interface IServiceChannel : ENI2.LockingServiceReference.IService, System.ServiceModel.IClientChannel {
+ }
+
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
+ public partial class ServiceClient : System.ServiceModel.ClientBase, ENI2.LockingServiceReference.IService {
+
+ public ServiceClient() {
+ }
+
+ public ServiceClient(string endpointConfigurationName) :
+ base(endpointConfigurationName) {
+ }
+
+ public ServiceClient(string endpointConfigurationName, string remoteAddress) :
+ base(endpointConfigurationName, remoteAddress) {
+ }
+
+ public ServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(endpointConfigurationName, remoteAddress) {
+ }
+
+ public ServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
+ base(binding, remoteAddress) {
+ }
+
+ public bool Lock(System.Guid messageCoreId, string userId) {
+ return base.Channel.Lock(messageCoreId, userId);
+ }
+
+ public System.Threading.Tasks.Task LockAsync(System.Guid messageCoreId, string userId) {
+ return base.Channel.LockAsync(messageCoreId, userId);
+ }
+
+ public void Unlock(System.Guid messageCoreId, string userId) {
+ base.Channel.Unlock(messageCoreId, userId);
+ }
+
+ public System.Threading.Tasks.Task UnlockAsync(System.Guid messageCoreId, string userId) {
+ return base.Channel.UnlockAsync(messageCoreId, userId);
+ }
+
+ public void LockRefresh(System.Guid[] currentLocks, string userId) {
+ base.Channel.LockRefresh(currentLocks, userId);
+ }
+
+ public System.Threading.Tasks.Task LockRefreshAsync(System.Guid[] currentLocks, string userId) {
+ return base.Channel.LockRefreshAsync(currentLocks, userId);
+ }
+
+ public void Log(string msg, string host, string userId) {
+ base.Channel.Log(msg, host, userId);
+ }
+
+ public System.Threading.Tasks.Task LogAsync(string msg, string host, string userId) {
+ return base.Channel.LogAsync(msg, host, userId);
+ }
+ }
+}
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.svcmap b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.svcmap
new file mode 100644
index 00000000..f732f037
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/Reference.svcmap
@@ -0,0 +1,35 @@
+
+
+
+ false
+ true
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Auto
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration.svcinfo b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration.svcinfo
new file mode 100644
index 00000000..1829218b
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration.svcinfo
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration91.svcinfo b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration91.svcinfo
new file mode 100644
index 00000000..7e39c436
--- /dev/null
+++ b/ENI-2/ENI2/ENI2/Service References/LockingServiceReference/configuration91.svcinfo
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+ BasicHttpBinding_IService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StrongWildcard
+
+
+
+
+
+ 65536
+
+
+
+
+
+
+
+
+ System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ System.Text.UTF8Encoding
+
+
+ Buffered
+
+
+
+
+
+ Text
+
+
+ System.ServiceModel.Configuration.BasicHttpSecurityElement
+
+
+ None
+
+
+ System.ServiceModel.Configuration.HttpTransportSecurityElement
+
+
+ None
+
+
+ None
+
+
+ System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement
+
+
+ Never
+
+
+ TransportSelected
+
+
+ (Collection)
+
+
+
+
+
+ System.ServiceModel.Configuration.BasicHttpMessageSecurityElement
+
+
+ UserName
+
+
+ Default
+
+
+
+
+
+
+
+
+ http://localhost/bsmd.LockingService/LockingService.svc
+
+
+
+
+
+ basicHttpBinding
+
+
+ BasicHttpBinding_IService
+
+
+ LockingServiceReference.IService
+
+
+ System.ServiceModel.Configuration.AddressHeaderCollectionElement
+
+
+ <Header />
+
+
+ System.ServiceModel.Configuration.IdentityElement
+
+
+ System.ServiceModel.Configuration.UserPrincipalNameElement
+
+
+
+
+
+ System.ServiceModel.Configuration.ServicePrincipalNameElement
+
+
+
+
+
+ System.ServiceModel.Configuration.DnsElement
+
+
+
+
+
+ System.ServiceModel.Configuration.RsaElement
+
+
+
+
+
+ System.ServiceModel.Configuration.CertificateElement
+
+
+
+
+
+ System.ServiceModel.Configuration.CertificateReferenceElement
+
+
+ My
+
+
+ LocalMachine
+
+
+ FindBySubjectDistinguishedName
+
+
+
+
+
+ False
+
+
+ BasicHttpBinding_IService
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml b/ENI-2/ENI2/ENI2/SucheControl.xaml
index a549684d..d95c7c82 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
+ xmlns:p="clr-namespace:ENI2.Properties"
xmlns:local="clr-namespace:ENI2"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
@@ -63,10 +64,11 @@
-
+
+
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index c03e2081..9bfc79d5 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/SQL/random_data.sql b/nsw/Source/SQL/random_data.sql
new file mode 100644
index 00000000..54e0da9f
--- /dev/null
+++ b/nsw/Source/SQL/random_data.sql
@@ -0,0 +1,5 @@
+update MessageCore set TicketNo=char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+ +char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+ +char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+ +char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
+ +char(rand()*26+65)+char(rand()*26+65)+char(rand()*26+65)
\ No newline at end of file
diff --git a/nsw/Source/bsmd.ExcelReadService/Confirmation.cs b/nsw/Source/bsmd.ExcelReadService/Confirmation.cs
index 537a6ab4..9b823664 100644
--- a/nsw/Source/bsmd.ExcelReadService/Confirmation.cs
+++ b/nsw/Source/bsmd.ExcelReadService/Confirmation.cs
@@ -153,7 +153,7 @@ namespace bsmd.ExcelReadService
// construct file path
string fileNameWithPath = Path.Combine(Path.GetDirectoryName(receivedFileName),
string.Format("{0}_{1}.xlsx", this.templateNames[i], Path.GetFileNameWithoutExtension(receivedFileName)));
- this.workbooks[i].Worksheets[1].Select(Type.Missing);
+ // this.workbooks[i].Worksheets[1].Select(Type.Missing);
this.workbooks[i].SaveAs(fileNameWithPath, XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
diff --git a/nsw/Source/bsmd.ExcelReadService/ExcelReadService.cs b/nsw/Source/bsmd.ExcelReadService/ExcelReadService.cs
index a1f588af..8078f6ad 100644
--- a/nsw/Source/bsmd.ExcelReadService/ExcelReadService.cs
+++ b/nsw/Source/bsmd.ExcelReadService/ExcelReadService.cs
@@ -124,12 +124,12 @@ namespace bsmd.ExcelReadService
{
// try to read/import attachment
using (ExcelReader reader = new ExcelReader(attachmentLocalPath))
- {
+ {
try
{
readResult = Util.ProcessSheet(reader, out readMessage, out messageCore);
}
- catch(Exception ex)
+ catch (Exception ex)
{
readMessage = string.Format("{0} Unerwartete Fehlersitutation:Bitte Info an Christin od. Daniel", ex.Message);
}
@@ -152,7 +152,7 @@ namespace bsmd.ExcelReadService
string shipname = DBManager.Instance.GetShipNameFromCore(messageCore);
if (shipname.IsNullOrEmpty()) shipname = messageCore.IMO;
- if(mailSubject.IsNullOrEmpty())
+ if (mailSubject.IsNullOrEmpty())
mailSubject = string.Format("{0}: {1}", Properties.Settings.Default.SendEMailSubject, shipname);
// send reply sheet back to sender
@@ -169,19 +169,20 @@ namespace bsmd.ExcelReadService
BSMDMail.SendSystemInfo(receiptSubject, receiptText, mailSender);
}
-
- // remove e-Mail
- _log.InfoFormat("deleting mail with messageId {0}", messageId);
- _log.InfoFormat("mail delete {0}", bsmdPopClient.DeleteMessageByMessageId(messageId) ? "successful" : "failed");
-
// remove attachment
_log.InfoFormat("removing local file {0}", attachmentLocalPath);
if (!Properties.Settings.Default.TestMode)
File.Delete(attachmentLocalPath);
- }
- attachmentLocalPath = null;
+
+ attachmentLocalPath = null;
+
+ }
+ // remove e-Mail
+ _log.InfoFormat("deleting mail with messageId {0}", messageId);
+ _log.InfoFormat("mail delete {0}", bsmdPopClient.DeleteMessageByMessageId(messageId) ? "successful" : "failed");
+
}
}
}
diff --git a/nsw/Source/bsmd.LockingService.sln b/nsw/Source/bsmd.LockingService.sln
new file mode 100644
index 00000000..27142839
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25123.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bsmd.LockingService", "bsmd.LockingService\bsmd.LockingService.csproj", "{7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bsmd.database", "bsmd.database\bsmd.database.csproj", "{19945AF2-379B-46A5-B27A-303B5EC1D557}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}.Release|Any CPU.Build.0 = Release|Any CPU
+ {19945AF2-379B-46A5-B27A-303B5EC1D557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {19945AF2-379B-46A5-B27A-303B5EC1D557}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {19945AF2-379B-46A5-B27A-303B5EC1D557}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {19945AF2-379B-46A5-B27A-303B5EC1D557}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/nsw/Source/bsmd.LockingService/IService.cs b/nsw/Source/bsmd.LockingService/IService.cs
new file mode 100644
index 00000000..d78587bc
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/IService.cs
@@ -0,0 +1,73 @@
+// Copyright (c) 2017 schick Informatik
+// Description:
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.ServiceModel;
+using System.ServiceModel.Web;
+
+namespace bsmd.LockingService
+{
+ // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
+ [ServiceContract]
+ public interface IService
+ {
+ ///
+ /// Request a lock for a particular core
+ ///
+ /// true if successful
+
+ [OperationContract]
+ [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
+ bool Lock(Guid messageCoreId, string userId);
+
+
+ ///
+ /// Relinquish lock for a particular core
+ ///
+ [OperationContract]
+ [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
+ void Unlock(Guid messageCoreId, string userId);
+
+
+ ///
+ /// To avoid Timeout, send keepalive message
+ ///
+ /// currently held locks
+ [OperationContract]
+ [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
+ void LockRefresh(List currentLocks, string userId);
+
+ ///
+ /// send a log message (convenience helper)
+ ///
+ [OperationContract]
+ [WebGet(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
+ void Log(string msg, string host, string userId);
+
+ }
+
+
+ // Use a data contract as illustrated in the sample below to add composite types to service operations.
+ [DataContract]
+ public class CompositeType
+ {
+ bool boolValue = true;
+ string stringValue = "Hello ";
+
+ [DataMember]
+ public bool BoolValue
+ {
+ get { return boolValue; }
+ set { boolValue = value; }
+ }
+
+ [DataMember]
+ public string StringValue
+ {
+ get { return stringValue; }
+ set { stringValue = value; }
+ }
+ }
+}
diff --git a/nsw/Source/bsmd.LockingService/LockingService.svc b/nsw/Source/bsmd.LockingService/LockingService.svc
new file mode 100644
index 00000000..bcf45de0
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/LockingService.svc
@@ -0,0 +1 @@
+<%@ ServiceHost Language="C#" Debug="true" Service="bsmd.LockingService.LockingService" CodeBehind="LockingService.svc.cs" %>
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/LockingService.svc.cs b/nsw/Source/bsmd.LockingService/LockingService.svc.cs
new file mode 100644
index 00000000..59120e49
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/LockingService.svc.cs
@@ -0,0 +1,107 @@
+// Copyright (c) 2017 schick Informatik
+
+
+using System;
+using System.Collections.Generic;
+using log4net;
+using bsmd.database;
+using System.ServiceModel.Activation;
+using System.Timers;
+
+namespace bsmd.LockingService
+{
+
+ [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
+ public class LockingService : IService
+ {
+ private static ILog _log = LogManager.GetLogger(typeof(LockingService));
+ private static Dictionary lockDict = new Dictionary();
+ private static Timer staleTimer = new Timer(5000); // alle 5 Sekunden prüfen
+ private const int staleTimeoutSeconds = 120; // wenn sie eine Anwendung 2 Minuten nicht meldet, werden die Locks freigegeben
+
+ static LockingService()
+ {
+ staleTimer.Elapsed += StaleTimer_Elapsed;
+ }
+
+ private static void StaleTimer_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ lock (lockDict)
+ {
+ List deleteList = new List();
+ foreach (Guid key in lockDict.Keys)
+ if ((DateTime.Now - lockDict[key].lockAquired).TotalSeconds > staleTimeoutSeconds)
+ deleteList.Add(key);
+ foreach (Guid key in deleteList)
+ {
+ _log.WarnFormat("Stale remove message core id {0}, User {1}", key, lockDict[key].userId);
+ lockDict.Remove(key);
+ }
+ }
+ }
+
+ private ILog log = LogManager.GetLogger(typeof(LockingService));
+
+ public bool Lock(Guid messageCoreId, string userId)
+ {
+ if (userId.IsNullOrEmpty()) return false;
+ bool result = false;
+
+ lock (lockDict)
+ {
+ if (!lockDict.ContainsKey(messageCoreId))
+ {
+ LockEntry le = new LockEntry();
+ le.lockAquired = DateTime.Now;
+ le.userId = userId;
+ lockDict.Add(messageCoreId, le);
+ result = true;
+ }
+ else
+ {
+ if (lockDict[messageCoreId].userId == userId)
+ {
+ lockDict[messageCoreId].lockAquired = DateTime.Now;
+ result = true;
+ }
+ }
+ }
+
+ return result;
+ }
+
+
+ public void Unlock(Guid messageCoreId, string userId)
+ {
+ if (userId.IsNullOrEmpty()) return;
+ lock(lockDict)
+ {
+ if(lockDict.ContainsKey(messageCoreId))
+ {
+ if (lockDict[messageCoreId].userId == userId)
+ lockDict.Remove(messageCoreId);
+ }
+ }
+ }
+
+ public void LockRefresh(List currentLocks, string userId)
+ {
+ foreach (Guid messageCoreId in currentLocks)
+ this.Lock(messageCoreId, userId);
+ }
+
+
+ public void Log(string msg, string host, string userId)
+ {
+ log.Info(string.Format("{0} {1}:{2}", host, userId, msg));
+ }
+
+
+ internal class LockEntry
+ {
+ public DateTime lockAquired = DateTime.Now;
+ public string userId = string.Empty;
+ }
+
+ }
+}
diff --git a/nsw/Source/bsmd.LockingService/Properties/AssemblyInfo.cs b/nsw/Source/bsmd.LockingService/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..2940051d
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/Properties/AssemblyInfo.cs
@@ -0,0 +1,18 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("bsmd.LockingService")]
+[assembly: AssemblyDescription("Locking Service for ENI-2 to avoid parallel changes")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7cd5e5bc-8f70-4dfb-baae-fbc91e6c3f33")]
+
diff --git a/nsw/Source/bsmd.LockingService/Web.Debug.config b/nsw/Source/bsmd.LockingService/Web.Debug.config
new file mode 100644
index 00000000..24f336cd
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/Web.Debug.config
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/Web.Release.config b/nsw/Source/bsmd.LockingService/Web.Release.config
new file mode 100644
index 00000000..a6579812
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/Web.Release.config
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/Web.config b/nsw/Source/bsmd.LockingService/Web.config
new file mode 100644
index 00000000..f49e1619
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/Web.config
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj
new file mode 100644
index 00000000..f41181cf
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj
@@ -0,0 +1,140 @@
+
+
+
+
+ Debug
+ AnyCPU
+
+
+ 2.0
+ {7CD5E5BC-8F70-4DFB-BAAE-FBC91E6C3F33}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ bsmd.LockingService
+ bsmd.LockingService
+ v4.5.2
+ True
+ true
+ false
+
+
+
+
+
+
+
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ true
+ false
+
+
+ pdbonly
+ true
+ bin\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
+ True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties\AssemblyProductInfo.cs
+
+
+ Properties\AssemblyProjectInfo.cs
+
+
+ Properties\AssemblyProjectKeyInfo.cs
+
+
+ LockingService.svc
+
+
+
+
+
+
+
+
+
+
+
+ Web.config
+
+
+ Web.config
+
+
+
+
+ {19945af2-379b-46a5-b27a-303b5ec1d557}
+ bsmd.database
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+
+ True
+ True
+ 11651
+ /
+ http://localhost/bsmd.LockingService
+ False
+ False
+
+
+ False
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user
new file mode 100644
index 00000000..cc9ce9ff
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj.user
@@ -0,0 +1,31 @@
+
+
+
+ false
+
+
+
+
+
+
+
+ CurrentPage
+ True
+ False
+ False
+ False
+
+
+
+
+
+
+
+
+ True
+ True
+
+
+
+
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/bsmd.LockingService.licenseheader b/nsw/Source/bsmd.LockingService/bsmd.LockingService.licenseheader
new file mode 100644
index 00000000..d7397703
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/bsmd.LockingService.licenseheader
@@ -0,0 +1,15 @@
+extensions: designer.cs generated.cs
+extensions: .cs .cpp .h
+// Copyright (c) 2017 schick Informatik
+// Description:
+
+extensions: .aspx .ascx
+<%--
+Copyright (c) 2017 schick Informatik
+--%>
+extensions: .vb
+'Sample license text.
+extensions: .xml .config .xsd
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.LockingService/packages.config b/nsw/Source/bsmd.LockingService/packages.config
new file mode 100644
index 00000000..2b3696ab
--- /dev/null
+++ b/nsw/Source/bsmd.LockingService/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs
index 4b080648..9b842fce 100644
--- a/nsw/Source/bsmd.database/MessageCore.cs
+++ b/nsw/Source/bsmd.database/MessageCore.cs
@@ -1,4 +1,7 @@
-using System;
+// Copyright (c) 2015-2017 schick Informatik
+// Description: Kopfdaten Schiffsanmeldungen
+
+using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
@@ -174,6 +177,12 @@ namespace bsmd.database
///
public bool CreateExcel { get; set; }
+ ///
+ /// Feld um die OTRS Ticketnummer zu speichern
+ ///
+ [MaxLength(50)]
+ public string TicketNo { get; set; }
+
#endregion
#region DatabaseEntity implementation
@@ -220,6 +229,7 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P25", this.DefaultReportingPartyId);
scmd.Parameters.AddWithValue("@P26", this.CreateExcel ? 1 : 0);
scmd.Parameters.AddWithNullableValue("@P27", this.EditedBy);
+ scmd.Parameters.AddWithNullableValue("@P28", this.TicketNo);
if (this.IsNew)
{
@@ -228,9 +238,10 @@ namespace bsmd.database
string query = string.Format("INSERT INTO {0} (Id, VisitId, TransitId, IMO, ENI, PoC, Portname, ETA, CustomerId, " +
"Previous, Next, IsTransit, Wetris_zz_56_datensatz_id, BSMDStatus, InitialHIS, HerbergFormGuid, " +
"HerbergFormTemplateGuid, HerbergReportType, HerbergEmailcontactReportingVessel, HerbergEmail24HrsContact, " +
- "ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion, Incoming, DefaultReportingPartyId, CreateExcel, EditedBy) VALUES " +
+ "ETAKielCanal, HerbergRevDate, ReportStatus, SietasSheetVersion, Incoming, DefaultReportingPartyId, CreateExcel, " +
+ "EditedBy, TicketNo) VALUES " +
"(@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, " +
- "@P18, @P19, @P20, @P21, @P22, @P23, @P24, @P25, @P26, @P27)",
+ "@P18, @P19, @P20, @P21, @P22, @P23, @P24, @P25, @P26, @P27, @P28)",
this.Tablename);
scmd.CommandText = query;
}
@@ -242,8 +253,8 @@ namespace bsmd.database
"Wetris_zz_56_datensatz_id = @P12, BSMDStatus = @P13, InitialHIS = @P14, HerbergFormGuid = @P15, " +
"HerbergFormTemplateGuid = @P16, HerbergReportType = @P17, HerbergEmailContactReportingVessel = @P18, " +
"HerbergEmail24HrsContact = @P19, ETAKielCanal = @P20, HerbergRevDate = @P21, ReportStatus = @P22, " +
- "SietasSheetVersion = @P23, Incoming = @P24, DefaultReportingPartyId = @P25, CreateExcel = @P26, EditedBy = @P27 " +
- "WHERE Id = @ID", this.Tablename);
+ "SietasSheetVersion = @P23, Incoming = @P24, DefaultReportingPartyId = @P25, CreateExcel = @P26, EditedBy = @P27, " +
+ "TicketNo = @P28 WHERE Id = @ID", this.Tablename);
scmd.CommandText = query;
}
}
@@ -255,7 +266,7 @@ namespace bsmd.database
"[{0}].[ETA], [{0}].[CustomerId], [{0}].[Previous], [{0}].[Next], [{0}].[IsTransit], [{0}].[Wetris_zz_56_datensatz_id], [{0}].[BSMDStatus], " +
"[{0}].[InitialHIS], [{0}].[HerbergFormGuid], [{0}].[HerbergFormTemplateGuid], [{0}].[HerbergReportType], [{0}].[HerbergEmailContactReportingVessel], " +
"[{0}].[HerbergEmail24HrsContact], [{0}].[ETAKielCanal], [{0}].[HerbergRevDate], [{0}].[ReportStatus], [{0}].[SietasSheetVersion], [{0}].[Incoming], " +
- "[{0}].[DefaultReportingPartyId], [{0}].[Created], [{0}].[Changed], [{0}].[CreateExcel], [{0}].[EditedBy] FROM {0} ",
+ "[{0}].[DefaultReportingPartyId], [{0}].[Created], [{0}].[Changed], [{0}].[CreateExcel], [{0}].[EditedBy], [{0}].[TicketNo] FROM {0} ",
this.Tablename));
switch (filter)
@@ -445,6 +456,7 @@ namespace bsmd.database
if (!reader.IsDBNull(27)) core.changed = reader.GetDateTime(27);
if (!reader.IsDBNull(28)) core.CreateExcel = reader.GetBoolean(28);
if (!reader.IsDBNull(29)) core.EditedBy = reader.GetString(29);
+ if (!reader.IsDBNull(30)) core.TicketNo = reader.GetString(30);
result.Add(core);
}
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
index faa485ff..abe3d643 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs
@@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")]
-[assembly: AssemblyInformationalVersion("3.5.8")]
+[assembly: AssemblyInformationalVersion("3.5.9")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")]
\ No newline at end of file
diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
index 1ee2daf5..5736bcf3 100644
--- a/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
+++ b/nsw/Source/bsmd.database/Properties/AssemblyProjectInfo.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.5.8.*")]
+[assembly: AssemblyVersion("3.5.9.*")]
diff --git a/nsw/Source/bsmd.database/bsmd.database.csproj b/nsw/Source/bsmd.database/bsmd.database.csproj
index 2cc17e46..8a63e6c1 100644
--- a/nsw/Source/bsmd.database/bsmd.database.csproj
+++ b/nsw/Source/bsmd.database/bsmd.database.csproj
@@ -125,6 +125,7 @@
+
Designer
diff --git a/nsw/Source/bsmd.database/bsmd.database.licenseheader b/nsw/Source/bsmd.database/bsmd.database.licenseheader
new file mode 100644
index 00000000..19cf4bb6
--- /dev/null
+++ b/nsw/Source/bsmd.database/bsmd.database.licenseheader
@@ -0,0 +1,15 @@
+extensions: designer.cs generated.cs
+extensions: .cs .cpp .h
+// Copyright (c) 2015-2017 schick Informatik
+// Description:
+
+extensions: .aspx .ascx
+<%--
+Copyright (c) 2015-2017 schick Informatik
+--%>
+extensions: .vb
+'Sample license text.
+extensions: .xml .config .xsd
+
\ No newline at end of file