From 02b20df6529a3dd54121c8deb5078fb817633a80 Mon Sep 17 00:00:00 2001 From: mschill Date: Fri, 15 Nov 2024 09:23:27 -0500 Subject: [PATCH] =?UTF-8?q?C2024-028=20Add=20an=20enhancement=20to=20Admin?= =?UTF-8?q?=20Tools=20->=20Refresh=20Transitions.=20Transitions=20with=20b?= =?UTF-8?q?ad=20links=20that=20cannot=20be=20auto-fixed,=20will=20now=20ad?= =?UTF-8?q?d=20an=20annotation=20of=20=E2=80=9CBad=20Transition=20Link?= =?UTF-8?q?=E2=80=9D=20(which=20can=20then=20be=20searched=20for=20and=20m?= =?UTF-8?q?anually=20resolved.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEPROMS User Interface/frmBatchRefresh.cs | 20 +++++++++++-------- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 11 ++++++++++ .../Volian.Controls.Library/StepTabRibbon.cs | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 5fea1635..848f00a2 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -481,12 +481,14 @@ namespace VEPROMS // B2018-002 - Invalid Transitions - Define Transition Refresh Statistics private int numTransProcessed = 0; private int numTransFixed = 0; + private int numTransCantFix = 0; private int numTransConverted = 0; // B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics private void ResetTransNumbers() { numTransProcessed = 0; numTransFixed = 0; + numTransCantFix = 0; numTransConverted = 0; } private void RefreshTransitions() @@ -535,11 +537,12 @@ namespace VEPROMS numTransConverted += ProcedureInfo.TranConvertCount; numTransProcessed += ProcedureInfo.TranCheckCount; numTransFixed += ProcedureInfo.TranFixCount; + numTransCantFix += ProcedureInfo.TranCantFixCount; //Bad Transition Link pbProcess.PerformStep(); Application.DoEvents(); } } - if (numTransFixed == 0 && numTransConverted == 0) + if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0) { txtResults.AppendText("No Transitions Needed Updated."); txtResults.AppendText(Environment.NewLine); @@ -551,16 +554,18 @@ namespace VEPROMS txtProcess.AppendText(string.Format("Transitions Checked: {0}", numTransProcessed)); txtProcess.AppendText(Environment.NewLine); // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics - txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed))); + txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed + numTransCantFix))); txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed)); txtProcess.AppendText(Environment.NewLine); txtProcess.AppendText(string.Format("Transitions Converted to text: {0}", numTransConverted)); + txtProcess.AppendText(Environment.NewLine); + txtProcess.AppendText(string.Format("Transitions Unable to be Automatically Fixed (Annotation: Bad Transition Link): {0}", numTransCantFix)); Application.DoEvents(); if (pil.Count > 0) { StringBuilder sb = new StringBuilder(); - sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); + sb.AppendLine("The batch refresh process was not successful for all procedures selected."); sb.AppendLine("The following procedures were not able to be refreshed..."); sb.AppendLine(); sb.AppendLine(sbProcs.ToString()); @@ -579,11 +584,11 @@ namespace VEPROMS } } this.Cursor = Cursors.Default; - // B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic - if (numTransFixed == 0 && numTransConverted == 0) + // B2018-002 - Invalid Transitions - Display Transition Refresh Statistic + if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0) MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed"); else - MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted), numTransFixed, numTransConverted), "Refresh Transitions Completed"); + MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.\n\n {4} Transitions unable to be automatically fixed (Annotation: Bad Transition Link).", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted + numTransCantFix), numTransFixed, numTransConverted, numTransCantFix), "Refresh Transitions Completed"); } // C2017-030 - new Admin Tools user interface @@ -1103,8 +1108,7 @@ namespace VEPROMS ProcedureInfo.RefreshTransitions(pq);//, transitionsToDisconnected, transitionsToNonEditable); TimeSpan ts = DateTime.Now - start; // B2018-002 - Invalid Transitions - Display Transition Refresh Statistics - txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Converted to Text {4} Transitions{0}Elapsed Seconds:{5}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds)); - //Console.WriteLine("\"{0}\"\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ts.TotalSeconds, numTransProcessed, numTransFixed, numTransConverted); + txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Converted to Text {4} Transitions{0}Cant Fix (Annotation: Bad Transition Link) {5} Transitions{0}Elapsed Seconds:{6}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ProcedureInfo.TranConvertCount, ProcedureInfo.TranCantFixCount, ts.TotalSeconds)); if (myFixes.Length > 0) { txtResults.AppendText(myFixes.ToString()); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 3283357c..9ac26d14 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -713,12 +713,14 @@ namespace VEPROMS.CSLA.Library { TranCheckCount = 0; TranFixCount = 0; + TranCantFixCount = 0; TranConvertCount = 0;// B2018-002 - Invalid Transitions - Initialize Transition Conversion Count } public static int TranCheckCount = 0; public static int TranFixCount = 0; public static int TranConvertCount = 0;// B2018-002 - Invalid Transitions - Declare Transition Conversion Count + public static int TranCantFixCount = 0; internal static TransitionInfoList TransitionsToDisconnected; internal static TransitionInfoList TransitionsToNonEditable; @@ -825,6 +827,15 @@ namespace VEPROMS.CSLA.Library content.Save(); } } + else if (newText.Contains("