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;