From 6ae55e3780956007c47455b050a5bde7b7b67490 Mon Sep 17 00:00:00 2001 From: Rich Date: Wed, 27 Nov 2013 15:43:53 +0000 Subject: [PATCH] Fixed logic to properly find RO Tokens in text. Fixed logic when searching for annotations so that the results can be selected. --- PROMS/DataLoader/PROMSFixes.Sql | 9 ++++++--- PROMS/Volian.Controls.Library/AnnotationDetails.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PROMS/DataLoader/PROMSFixes.Sql b/PROMS/DataLoader/PROMSFixes.Sql index 0e99c614..39825749 100644 --- a/PROMS/DataLoader/PROMSFixes.Sql +++ b/PROMS/DataLoader/PROMSFixes.Sql @@ -7178,11 +7178,14 @@ WHILE (LEN(@text) > 0) IF @index = 0 BREAK DECLARE @index2 int - SET @index2 = CHARINDEX('>' , @text) + SET @index2 = @index + CHARINDEX('>' , substring(@text,@index,len(@text))) if @index2 = 0 BREAK - INSERT INTO @Tokens VALUES (substring(@text, @index,1+@index2-@index)) - SET @text = RIGHT(@text, (LEN(@text) - @index2)) + INSERT INTO @Tokens VALUES (substring(@text, @index,@index2-@index)) + if(len(@text) > @index2) + SET @text = RIGHT(@text, (LEN(@text) - @index2)) + else + SET @Text = '' END RETURN END diff --git a/PROMS/Volian.Controls.Library/AnnotationDetails.cs b/PROMS/Volian.Controls.Library/AnnotationDetails.cs index cad0f999..b4c795b7 100644 --- a/PROMS/Volian.Controls.Library/AnnotationDetails.cs +++ b/PROMS/Volian.Controls.Library/AnnotationDetails.cs @@ -211,7 +211,7 @@ namespace Volian.Controls.Library AnnotationDirty = false; if (!_LoadingGrid) rtxbComment.Focus(); // Set the focus to the comment text - if (MyUserInfo.IsReviewer(_CurrentItem.MyDocVersion) && CurrentAnnotation != null && CurrentAnnotation.UserID != MyUserInfo.UserID) + if (CurrentAnnotation != null && MyUserInfo.IsReviewer(CurrentAnnotation.MyItem.MyDocVersion ) && CurrentAnnotation.UserID != MyUserInfo.UserID) { btnRemoveAnnotation.Enabled = false; cbGridAnnoType.Enabled = false;