From 99fe567e78f5b5ddc1afa862d15dce6fd49c6977 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 27 Jul 2026 09:13:34 -0400 Subject: [PATCH 1/2] Development --- .../Volian.Controls.Library/DisplaySearch.cs | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index 6f569b4e..ef100b56 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -2078,7 +2078,7 @@ namespace Volian.Controls.Library if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) { - string ROSearchList2 = checkPercentChar(ROSearchList); // match exact string + string ROSearchList2 = exactsearch(ROSearchList); // match exact string // B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results. SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty); cmbResultsStyleIndex = 3; // display step text in results @@ -2191,32 +2191,20 @@ namespace Volian.Controls.Library OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks))); } - private string checkPercentChar(string SearchString) + private string exactsearch(string SearchString) // B2026-053 { string ss = ""; - string pattern = "%"; // Pattern to match the percentage sign - Match match = Regex.Match(SearchString, pattern); - if (match.Success) // Special case for percents. + int sl = SearchString.Length; + int LstIdxSp = SearchString.LastIndexOf(' '); + if (sl == LstIdxSp + 1) // B2026-053 if ' ' the last char. { - int sl = SearchString.Length; - int precentIdx = SearchString.IndexOf('%'); - int startIndex = 0; - if (sl == precentIdx + 1) // % the last char. - { - ss = SearchString.Substring(startIndex, sl - 1); - var isNumeric = int.TryParse(ss, out int n); - if (isNumeric == true) // other that a % are the rest of the characters numbers. - { - ss = ' ' + SearchString; //add a space prefix to make the search exact. If search is 5% this makes it excult 25% 55% etc.; - } - } + ss = ' ' + SearchString; //add a space prefix to make the search exact if the end of the search string is a space. } else { - ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string. - + ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string. } - return ss; + return ss; } private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click) From 58a6cb9a246f0e91fb30ef6dcec91ed7fbf9a5f6 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 27 Jul 2026 11:19:47 -0400 Subject: [PATCH 2/2] Development --- PROMS/Volian.Controls.Library/DisplaySearch.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index ef100b56..b22a7cb5 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -2079,7 +2079,7 @@ namespace Volian.Controls.Library if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) { string ROSearchList2 = exactsearch(ROSearchList); // match exact string - // B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results. + // B2022-031 - added a exactsearch to filter out procedure and section titles from global search results. SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty); cmbResultsStyleIndex = 3; // display step text in results } @@ -2193,18 +2193,22 @@ namespace Volian.Controls.Library private string exactsearch(string SearchString) // B2026-053 { - string ss = ""; + //string ss = ""; + StringBuilder ss = new StringBuilder(); int sl = SearchString.Length; int LstIdxSp = SearchString.LastIndexOf(' '); if (sl == LstIdxSp + 1) // B2026-053 if ' ' the last char. { - ss = ' ' + SearchString; //add a space prefix to make the search exact if the end of the search string is a space. + ss.Append(' '); + ss.Append(SearchString); // B2026-053 add a space prefix to make the search exact if the end of the searchString is a space. } else { - ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string. + ss.Append(' '); + ss.Append(SearchString); // B2026-053 Exact match add spaces before and after searchString. + ss.Append(' '); } - return ss; + return ss.ToString(); } private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)