diff --git a/ENI-2/ENI2/ENI2/App.config b/ENI-2/ENI2/ENI2/App.config index 6243d275..caaa686d 100644 --- a/ENI-2/ENI2/ENI2/App.config +++ b/ENI-2/ENI2/ENI2/App.config @@ -27,7 +27,8 @@ 60 - 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 + diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs index 2a24188f..01eec230 100644 --- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs @@ -9,7 +9,6 @@ using System.Windows.Controls; using bsmd.database; using ENI2.DetailViewControls; -using ENI2.LockingServiceReference; using System.Windows; using System.Windows.Data; @@ -38,6 +37,8 @@ namespace ENI2 public bool LockedByOtherUser { get; set; } + public ReportingParty LockedBy { get; set; } + #endregion #region Construction @@ -119,6 +120,9 @@ namespace ENI2 detailControl.Initialize(); detailControl.IsEnabled = !this.LockedByOtherUser; + if (!detailControl.IsEnabled && (detailControl is OverViewDetailControl)) + ((OverViewDetailControl)detailControl).ShowLockedBy(this.LockedBy); + controlCache.Add(mg.MessageGroupControlType, detailControl); this.buttonSave.Visibility = Visibility.Hidden; } diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index 93cbeba3..ea8d0c34 100644 --- a/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI-2/ENI2/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -292,6 +292,16 @@ namespace ENI2.DetailViewControls #endregion + #region public methods + + public void ShowLockedBy(ReportingParty reportingParty) + { + this.stackPanelLock.Visibility = Visibility.Visible; + this.textBlockLockUserName.Text = reportingParty.FirstName + " " + reportingParty.LastName; + } + + #endregion + #region private methods private void jumpToMessage(Message message) @@ -441,6 +451,5 @@ namespace ENI2.DetailViewControls #endregion - } } diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj index f444e9d0..4dc6a63f 100644 --- a/ENI-2/ENI2/ENI2/ENI2.csproj +++ b/ENI-2/ENI2/ENI2/ENI2.csproj @@ -35,8 +35,8 @@ 3.5.1.0 true publish.html - 2 - 3.6.3.%2a + 1 + 3.6.4.%2a false true true diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs index 246a3b88..c3d63696 100644 --- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs +++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs @@ -82,14 +82,17 @@ namespace ENI2 // TODO: wenn der Locking Service nicht erreichbar ist sollte das Ganze trotzdem noch irgendwie funktionieren _log.ErrorFormat("LockingService.Lock: {0}", ex.Message); } - bool iDidLockIt = (lockedUserId == Guid.Empty); + bool iDidLockIt = (lockedUserId == Guid.Empty); searchResultItem.TabClosing += SearchResultItem_TabClosing; DateTime? eta = aMessageCore.IsTransit ? aMessageCore.ETAKielCanal : aMessageCore.ETA; searchResultItem.SetHeaderText(string.Format("{0} [{1}-{2}]", aMessageCore.Shipname, aMessageCore.PoC, eta.HasValue ? eta.Value.ToShortDateString() : ""), iDidLockIt); + DetailRootControl drc = new DetailRootControl(aMessageCore); - drc.LockedByOtherUser = !iDidLockIt; + drc.LockedByOtherUser = !iDidLockIt; + drc.LockedBy = iDidLockIt ? this.userEntity : DBManager.Instance.GetReportingPartyDict()[lockedUserId]; + searchResultItem.Content = drc; this.mainFrame.Items.Add(searchResultItem); Dispatcher.BeginInvoke((Action)(() => this.mainFrame.SelectedIndex = (this.mainFrame.Items.Count - 1))); @@ -140,7 +143,7 @@ namespace ENI2 private void Window_Loaded(object sender, RoutedEventArgs e) { - if (Debugger.IsAttached) this.busyIndicator.IsBusy = false; // not for me :-P + // if (Debugger.IsAttached) this.busyIndicator.IsBusy = false; // not for me :-P this.dbConnected = DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString); labelGeneralStatus.Text = dbConnected ? "DB Connected" : "DB Connect failed"; diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx index 9227f55b..33b8a3b2 100644 Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ diff --git a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj index e965eeae..866a08e7 100644 --- a/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj +++ b/nsw/Source/bsmd.LockingService/bsmd.LockingService.csproj @@ -99,6 +99,7 @@ bsmdKey.snk + Web.config diff --git a/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs b/nsw/Source/bsmd.database/Properties/AssemblyProductInfo.cs index 9e610749..7f47bdd2 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.6.3")] +[assembly: AssemblyInformationalVersion("3.6.4")] [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 00bcc77b..4818bbde 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.6.3.*")] +[assembly: AssemblyVersion("3.6.4.*")]