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 @@ + - - + + + +