diff --git a/eDosLocal/Updates.sql b/eDosLocal/Updates.sql index 8063b89..8e14f81 100644 --- a/eDosLocal/Updates.sql +++ b/eDosLocal/Updates.sql @@ -22,7 +22,9 @@ ALTER PROCEDURE [dbo].[GetPersonInfo] @CSN CHAR(14) = NULL, @PersID INT = NULL, @AllowMultipleEPD BIT = 0 AS BEGIN - --DECLARE @PersID INT = null, @CSN CHAR(14) = 'TP10'; + --DECLARE @PersID INT = 12103, @CSN CHAR(14) = null,@AllowMultipleEPD BIT = 0; + SET NOCOUNT ON; + DECLARE @lid_station INT, @lid_visit INT; @@ -33,6 +35,8 @@ AS BEGIN FROM [dbo].[PersonInfoSnapshot] WHERE [CSN] = @CSN COLLATE SQL_Latin1_General_CP850_BIN; + SET NOCOUNT OFF; + SELECT TOP(1) @lid_station = [ID_Station], @lid_visit = [ID_Visit] @@ -48,8 +52,8 @@ AS BEGIN [a].[FirstName], [a].[LastName], [a].[NickName], - [AccessAllow] = CASE WHEN @AllowMultipleEPD = 1 - AND [a].[hasEPD] = 1 THEN 0 ELSE [a].[AccessAllow] END, + [AccessAllow] = CONVERT(BIT, CASE WHEN @AllowMultipleEPD = 1 + AND [a].[hasEPD] = 1 THEN 0 ELSE [a].[AccessAllow] END), [a].[Language], [a].[MarginHP10_M], [a].[MarginHP10_Y], @@ -58,8 +62,10 @@ AS BEGIN [a].[ID_CommentToPerson], [a].[Comment], [a].[Deleted], - [ReasonNoAccess] = CASE WHEN @AllowMultipleEPD = 1 - AND [a].[hasEPD] = 1 THEN 'EPD not returned' ELSE [a].[ReasonNoAccess] END, + [ReasonNoAccess] = CASE + WHEN @AllowMultipleEPD = 1 AND [a].[hasEPD] = 1 THEN 'EPD not returned' + WHEN [VisitIDLocked] IS NOT NULL THEN 'Locked because of alarm' + ELSE [a].[ReasonNoAccess] END, [a].[Dose_52W_microSv], [a].[hasEPD], [activeStation] = @lid_station, @@ -87,6 +93,7 @@ AS BEGIN WHERE [p].[PersID] = @PersID) [a]; END; + go ---- Luc 2022-03-25 diff --git a/eDosStation/EntryBadge.xaml.cs b/eDosStation/EntryBadge.xaml.cs index 984e80c..149bfaf 100644 --- a/eDosStation/EntryBadge.xaml.cs +++ b/eDosStation/EntryBadge.xaml.cs @@ -419,7 +419,7 @@ namespace eDosStation Username.Text = _User.FullUserName(); string msg = string.Empty; - if (!_User.HasMessage() && string.IsNullOrEmpty(ReasonNoAccess)) + if (!_User.HasMessage() && string.IsNullOrEmpty(ReasonNoAccess) && _User.AllowShowTask()) { msg = $"ShowUserInfo to AskTask {DateTime.Now.ToString("HH:mm:ss.fff")}"; dataInterface.stationLog?.WriteLine(msg); @@ -631,7 +631,7 @@ namespace eDosStation { dispatcherTimer.Stop(); dispatcherTimer.Tick -= SwitchToTask; - if (_User.AllOk == true && !_User.hasEPD) AskTask(); + if (_User.AllOk == true && !_User.hasEPD && _User.AllowShowTask()) AskTask(); else endPage(); } private void TaskCancel_Click(object sender, RoutedEventArgs e) @@ -643,7 +643,7 @@ namespace eDosStation Button b = sender as Button; string id = b.Tag.ToString().ToUpper(); if (id[0]=='P') - _User = dataInterface.GetUser(null, id.Substring(1),true); + _User = dataInterface.GetUser(null, id.Substring(1),true); else _User = dataInterface.GetUser("TP" + b.Tag.ToString().ToUpper(), string.Empty,true); Dispatcher.InvokeAsync(() => { ShowUserInfo(); }); @@ -691,10 +691,10 @@ namespace eDosStation b.Click += BTestPerson_Click; if (i > 1) id = i.ToString(); - else id = "P12959"; + else id = "P12103"; b.Tag = id; - b.Content = $"* TP {id} *"; - b.Height = 20; b.Width = 30; + b.Content = $"{id}"; + b.Height = 40; b.Width = 50; b.Margin = m; sp.Children.Add(b); } diff --git a/eDosStation/Properties/AssemblyInfo.cs b/eDosStation/Properties/AssemblyInfo.cs index 21e19ec..f90aa0b 100644 --- a/eDosStation/Properties/AssemblyInfo.cs +++ b/eDosStation/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.6.1.4")] -[assembly: AssemblyFileVersion("2.6.1.4")] +[assembly: AssemblyVersion("2.6.2.0")] +[assembly: AssemblyFileVersion("2.6.2.0")] diff --git a/eDosStation/User.cs b/eDosStation/User.cs index 167d512..84f0331 100644 --- a/eDosStation/User.cs +++ b/eDosStation/User.cs @@ -34,13 +34,13 @@ namespace eDosStation } public bool HasMessage () { - return (AccessAllow != true || !string.IsNullOrEmpty(UserComment) || !string.IsNullOrEmpty(ReasonNoAccess)); + return AccessAllow != true || !string.IsNullOrEmpty(UserComment) || !string.IsNullOrEmpty(ReasonNoAccess); } public bool AllowShowTask() { - return (AllOk == true && !hasEPD && VisitIDLocked == null); + return AllOk == true && !hasEPD && VisitIDLocked == null; } public User() diff --git a/syncEdosLocal/Program.cs b/syncEdosLocal/Program.cs index c7e714f..f433674 100644 --- a/syncEdosLocal/Program.cs +++ b/syncEdosLocal/Program.cs @@ -383,7 +383,9 @@ namespace syncEdosLocal } Result.Write(); } - eDosLocalCon.Close(); + + if (eDosLocalCon != null) UpdateRemoteReturns(eDosLocalCon); + } } catch (System.Exception ex) @@ -394,8 +396,7 @@ namespace syncEdosLocal } if (error) goto final; - //Update remote returns - + final: diff --git a/syncEdosLocal/Properties/AssemblyInfo.cs b/syncEdosLocal/Properties/AssemblyInfo.cs index 5e38afc..1ac88d8 100644 --- a/syncEdosLocal/Properties/AssemblyInfo.cs +++ b/syncEdosLocal/Properties/AssemblyInfo.cs @@ -6,9 +6,9 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("syncEdosLocal")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("v2022-04-20")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("SCK CEN")] [assembly: AssemblyProduct("syncEdosLocal")] [assembly: AssemblyCopyright("Copyright © Luc Vandenbroucke 2020-2022")] [assembly: AssemblyTrademark("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.1.0")] -[assembly: AssemblyFileVersion("1.6.1.0")] +[assembly: AssemblyVersion("1.6.2.0")] +[assembly: AssemblyFileVersion("1.6.2.0")]