From df163e6727891ecdad6db4b5e7a01fb391d7d93a Mon Sep 17 00:00:00 2001 From: Luc Vandenbroucke Date: Mon, 10 Feb 2020 11:39:26 +0100 Subject: [PATCH] Comments & layout --- eDosStation/EntryBadge.xaml | 17 ++++-- eDosStation/EntryBadge.xaml.cs | 86 +++++++++++++++++++-------- eDosStation/Station.cs | 7 +-- eDosStation/User.cs | 16 ++++- eDosStation/eDosStation.csproj | 41 ++++++------- eDos_Report.htm | 103 --------------------------------- 6 files changed, 113 insertions(+), 157 deletions(-) delete mode 100644 eDos_Report.htm diff --git a/eDosStation/EntryBadge.xaml b/eDosStation/EntryBadge.xaml index acb2f60..bd539f7 100644 --- a/eDosStation/EntryBadge.xaml +++ b/eDosStation/EntryBadge.xaml @@ -56,6 +56,7 @@ + diff --git a/eDosStation/EntryBadge.xaml.cs b/eDosStation/EntryBadge.xaml.cs index 478a47c..581de26 100644 --- a/eDosStation/EntryBadge.xaml.cs +++ b/eDosStation/EntryBadge.xaml.cs @@ -248,6 +248,19 @@ namespace eDosStation getTaskListViewSource.View.MoveCurrentToFirst(); } + public string getCommentUnknown() + { + StringBuilder res = new StringBuilder(); + DataSet1.CommentOnEventRow r = dtCOE.FindByID_CommnentOnEvent(3); + res.AppendLine(r.Comment_NL).Replace("\\n", "\n"); + res.AppendLine("---"); + res.AppendLine(r.Comment_FR).Replace("\\n", "\n"); + res.AppendLine("---"); + res.AppendLine(r.Comment_EN).Replace("\\n", "\n"); + res.AppendLine("---"); + return res.ToString(); + } + public string getCommentOnEvent(string prefix, int id) { string res=string.Empty; @@ -270,38 +283,48 @@ namespace eDosStation UserSeconds = 10; //UserScreen string ReasonNoAccess = string.Empty; - tbUser.IsSelected = true; - if (_User == null || _User.VisitIDLocked == true || _User.AccessAllow == false) - { - //tbNotAllowed.IsSelected = true; - if (_User.VisitIDLocked == true || _User.AccessAllow == false) - ReasonNoAccess = _User.ReasonNoAccess; - else ReasonNoAccess = getCommentOnEvent(string.Empty, 3); - } - if (!string.IsNullOrEmpty(_User.UserComment)) + if (_User.PersID == 0) { - UserComment.Text = _User.UserComment; - boxComment.Visibility = Visibility.Visible; + tReasonNoAccess.Text = getCommentUnknown(); + tbNotAllowed.IsSelected = true; + doCancel = true; } else - boxComment.Visibility = Visibility.Hidden; + { + tbUser.IsSelected = true; + if (_User == null || _User.VisitIDLocked == true || _User.AccessAllow == false) + { + //tbNotAllowed.IsSelected = true; + if (_User.VisitIDLocked == true || _User.AccessAllow == false) + ReasonNoAccess = _User.ReasonNoAccess; + else ReasonNoAccess = getCommentOnEvent(string.Empty, 3); + } - if (!string.IsNullOrWhiteSpace(ReasonNoAccess)) UserAccess.Text = ReasonNoAccess; - else UserAccess.Text = "Welcome to eDOS"; - Username.Text = string.Concat(_User.FirstName, " ", _User.LastName); - pUserSeconds.Maximum = UserSeconds; pUserSeconds.Value = UserSeconds; - tReasonNoAccess.Text = ReasonNoAccess; - dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal); - dispatcherTimer.Interval = TimeSpan.FromSeconds(1); - dispatcherTimer.Tick += SwitchToTask; - dispatcherTimer.Start(); + if (!string.IsNullOrEmpty(_User.UserComment)) + { + UserComment.Text = _User.UserComment; + boxComment.Visibility = Visibility.Visible; + } + else + boxComment.Visibility = Visibility.Hidden; + + if (!string.IsNullOrWhiteSpace(ReasonNoAccess)) UserAccess.Text = ReasonNoAccess; + else UserAccess.Text = "Welcome to eDOS"; + Username.Text = string.Concat(_User.FirstName, " ", _User.LastName); + pUserSeconds.Maximum = UserSeconds; pUserSeconds.Value = UserSeconds; + tReasonNoAccess.Text = ReasonNoAccess; + dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal); + dispatcherTimer.Interval = TimeSpan.FromSeconds(1); + dispatcherTimer.Tick += SwitchToTask; + dispatcherTimer.Start(); + } return doCancel; } private void SwitchToTask(object sender, EventArgs e) { - if (--UserSeconds > 0) + if (--UserSeconds > 0 && (_User.AccessAllow!=true || !string.IsNullOrEmpty(_User.UserComment) || !string.IsNullOrEmpty(_User.ReasonNoAccess))) { tUserSeconds.Text = UserSeconds.ToString(); pUserSeconds.Value = UserSeconds; @@ -310,12 +333,15 @@ namespace eDosStation { dispatcherTimer.Stop(); dispatcherTimer.Tick -= SwitchToTask; - AskTask(); + if (_User.AccessAllow == true) + AskTask(); + else Close(); } } void AskTask() { + Naam.Text = _User.FirstName + " " + _User.LastName; eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1"))); using (var dataSet1GetTaskInfoTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskInfoTableAdapter()) { @@ -490,6 +516,20 @@ namespace eDosStation } } + private void BUserRead_Click(object sender, RoutedEventArgs e) + { + dispatcherTimer.Stop(); + dispatcherTimer.Tick -= SwitchToTask; + if (_User.AccessAllow == true) + AskTask(); + else Close(); + } + + private void TaskCancel_Click(object sender, RoutedEventArgs e) + { + Close(); + } + private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { t = null; diff --git a/eDosStation/Station.cs b/eDosStation/Station.cs index b63010a..d6f12b2 100644 --- a/eDosStation/Station.cs +++ b/eDosStation/Station.cs @@ -33,7 +33,7 @@ namespace eDosStation TestCSN = "0428790A0B4E80"; insComments = new StringBuilder(); tbComments = new TextBlock(); - tbComments.FontSize = 15; + tbComments.FontSize = 20; tbComments.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; tbComments.TextAlignment = System.Windows.TextAlignment.Center; @@ -92,14 +92,11 @@ namespace eDosStation if (curins.CompareTo(thisins) !=0) { if (curins != string.Empty) tbComments.Inlines.Add(new LineBreak()); - tbComments.Inlines.Add(new Bold(new Run($"Installation {thisins}:\n") { FontSize=20 })); + tbComments.Inlines.Add(new Bold(new Run($"Installation {thisins}:\n") { FontSize=25 })); insComments.AppendLine($"Installation {thisins}"); curins = thisins; } tbComments.Inlines.Add( new Run(thiscomment) ); - - - } rs.Close(); } diff --git a/eDosStation/User.cs b/eDosStation/User.cs index ec82995..4566b8d 100644 --- a/eDosStation/User.cs +++ b/eDosStation/User.cs @@ -52,9 +52,23 @@ namespace eDosStation AccessAllow = Values[rs.GetOrdinal("AccessAllow")] as bool?; Margin = Values[rs.GetOrdinal("AccessAllow")] as double?; VisitIDLocked = Values[rs.GetOrdinal("VisitIDLocked")] as bool?; - ReasonNoAccess = Values[rs.GetOrdinal("ReasonNoAccess")].ToString(); + ReasonNoAccess = Values[rs.GetOrdinal("ReasonNoAccess")].ToString().Replace("\\n","\n"); UserComment = Values[rs.GetOrdinal("Comment")].ToString(); AllOk = (AccessAllow == true & VisitIDLocked == true); + } else + { + // Not found + PersID = 0; + LastName = "Not Found"; + FirstName = "Not Found"; + conCode = "A1"; + Language = "N"; + AccessAllow = false; + Margin = 0; + VisitIDLocked = false; + ReasonNoAccess = "Not found"; + UserComment = ""; + AllOk = (AccessAllow == true & VisitIDLocked == true); } rs.Close(); } diff --git a/eDosStation/eDosStation.csproj b/eDosStation/eDosStation.csproj index 61c16e1..c6dcc63 100644 --- a/eDosStation/eDosStation.csproj +++ b/eDosStation/eDosStation.csproj @@ -14,21 +14,22 @@ 4 true true - false publish\ true - Unc - true + Disk + false Foreground 7 Days false false - true + false + false 5 - 1.0.0.%2a - true - true + 1.0.0.5 + false + false + false x86 @@ -61,7 +62,7 @@ false - false + true @@ -237,18 +238,6 @@ OkReadBadge - - - False - Microsoft .NET Framework 4.7.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - @@ -262,5 +251,17 @@ + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/eDos_Report.htm b/eDos_Report.htm deleted file mode 100644 index 5bdca70..0000000 --- a/eDos_Report.htm +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - Telerik UI for WPF Upgrade Wizard Log - - - - -
- - - - - - - - - - - - - - - -
- -
- Processed: 0 - Succeeded: 0 - Info: 0 - Warnings: 0 - Failed: 0 -
-
 ProjectTitleDetailsResult
-
- -