B2020-019: Annotation text can be edited for checked out procedure when displayed via Search Annotations

This commit is contained in:
Kathy Ruffing 2020-02-18 15:27:48 +00:00
parent 35bc08e466
commit 22d691cdd5

View File

@ -1124,11 +1124,16 @@ namespace Volian.Controls.Library
_ItemInfo = lbSrchResults.SelectedValue as ItemInfo; _ItemInfo = lbSrchResults.SelectedValue as ItemInfo;
if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null)) if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null))
{ {
_AnnotationDetails.CurrentAnnotation = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID); // B2020-019: Don't set the CurrentAnnotation to an annotation in a procedure that cannot be opened.
if (_AnnotationDetails.CurrentAnnotation != null) AnnotationInfo tmpca = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID);
_TabControl.OpenItem(_AnnotationDetails.CurrentAnnotation.MyItem); // open the corresponding procedure text DisplayTabItem dti = null;
if (tmpca != null) dti = _TabControl.OpenItem(tmpca.MyItem); // open the corresponding procedure text
if (dti != null)
{
_AnnotationDetails.CurrentAnnotation = tmpca;
_AnnotationDetails.FindCurrentAnnotation(); // position to corresponding row in annotation grid _AnnotationDetails.FindCurrentAnnotation(); // position to corresponding row in annotation grid
} }
}
else else
{ {
if (_ItemInfo != null) if (_ItemInfo != null)