Compare commits

..

1 Commits

2 changed files with 33 additions and 71 deletions
+3 -4
View File
@@ -643,10 +643,9 @@ namespace Volian.Controls.Library
if (_docVersionInfo != null && fstid != -1 && fstid != MyROFSTLookup.RofstID)
{
string message = string.Empty;
if (_progressBar?.Text != "Cannot check-out Working Draft" && !MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
if (_progressBar?.Text != "RO Check Paused - Other Users In Set" && !MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
{
FlexibleMessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
FinalProgressBarMessage = "Cannot check-out Working Draft";
FinalProgressBarMessage = "RO Check Paused - Other Users In Set";
}
else if (!MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
{
@@ -719,7 +718,7 @@ namespace Volian.Controls.Library
if (tmpROID != null) ExpandNode(ROFSTLookup.FormatRoidKey(tmpROID, true));
//doc version would have updated (if needed) so reset flag
if (_progressBar?.Text != "Cannot check-out Working Draft")
if (_progressBar?.Text != "RO Check Paused - Other Users In Set")
{
changedDocVersion = false;
}
+30 -67
View File
@@ -2017,19 +2017,35 @@ namespace Volian.Controls.Library
ReportTitle = string.Format("Search for '{0}'", TextSearchString);
// C2020-009: Search - Allow search 'By Word'.
//if (cbxByWord.Checked)
//{
// // Generate a prefix & suffix to be used in the sql query around the search string.
// // If the search string starts (prefix)/ends(suffix) with a number, then use an expression that
// // does not allow the preceding/following text to have a number, '.', letter or other rtf
// // commands. If the search string starts/ends with a letter, then use an expression that does not
// // find the preceding/following text that is text, i.e. a letter.
string byWordPrefix = string.Empty;
string byWordSuffix = string.Empty;
if (cbxByWord.Checked)
{
// Generate a prefix & suffix to be used in the sql query around the search string.
// If the search string starts (prefix)/ends(suffix) with a number, then use an expression that
// does not allow the preceding/following text to have a number, '.', letter or other rtf
// commands. If the search string starts/ends with a letter, then use an expression that does not
// find the preceding/following text that is text, i.e. a letter.
if (Regex.IsMatch(TextSearchString, @"^[\d\.]")) // starts with a number or '.' decimal pt
{
byWordPrefix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(TextSearchString, @"^[a-zA-Z]")) // starts with a letter
{
byWordPrefix = @"[^a-zA-Z]";
}
if (Regex.IsMatch(TextSearchString, @"[\d\.]$")) // ends with a number or decimal
{
byWordSuffix = @"[^0-9a-zA-Z.vbpi:\\-]";
}
else if (Regex.IsMatch(TextSearchString, @"[a-zA-Z]$")) // ends with a letter
{
byWordSuffix = @"[^a-zA-Z]";
}
}
SearchString = TextSearchString;
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, GetByWordSettings(TextSearchString, true), GetByWordSettings(TextSearchString, false));
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString /*.Replace(@"\",@"\u9586?")*/, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, byWordPrefix, byWordSuffix);
cmbResultsStyleIndex = 3; // display step text in results
//}
@@ -2062,8 +2078,8 @@ namespace Volian.Controls.Library
if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked)
{
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, GetByWordSettings(ROSearchList, true), GetByWordSettings(ROSearchList, false));
// B2022-031 - added a cbxProcSectSrch to filter out procedure and section titles from global search results.
SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, 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
}
else
@@ -2173,60 +2189,7 @@ namespace Volian.Controls.Library
}
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
}
private string GetByWordSettings(string ss, bool checkstart)
{
//if (Regex.IsMatch(ss, @"^[\d\.]")) // starts with a number or '.' decimal pt
//{
// settings.Add("byWordPrefix", @"[^0-9a-zA-Z.vbpi:\\-]");
//}
//else if (Regex.IsMatch(ss, @"^[a-zA-Z]")) // starts with a letter
//{
// settings.Add("byWordPrefix", @"[^a-zA-Z]");
//}
//if (Regex.IsMatch(ss, @"^[\d\.]")) // ends with a number or decimal
//{
// settings.Add("byWordSuffix", @"[^0-9a-zA-Z.vbpi:\\-]");
//}
//else if (Regex.IsMatch(ss, @"[a-zA-Z]$")) // ends with a letter
//{
// settings.Add("byWordSuffix", @"[^a-zA-Z]");
//}
//return settings;
if (ss.Length > 0)
{
//checking start
if (checkstart)
{
// starts with a number or '.' decimal pt
if (char.IsNumber(ss, 0) || ss[0] == '.')
{
return @"[^0-9a-zA-Z.vbpi:\\-]";
}
// starts with a letter
else if (char.IsLetter(ss, 0))
{
return @"[^a-zA-Z]";
}
}
//checking end
else
{
// ends with a number or '.' decimal pt
if (char.IsNumber(ss, ss.Length - 1) || ss[ss.Length - 1] == '.')
{
return @"[^0-9a-zA-Z.vbpi:\\-]";
}
// ends with a letter
else if (char.IsLetter(ss, ss.Length - 1))
{
return @"[^a-zA-Z]";
}
}
}
//default
return string.Empty;
}
private void ClearResults() // B2021-103 if no results when RNO only, clear results list. (moved from btnSearch_Click)
{
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4])