diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 871c40a6..28b24f4c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -1134,6 +1134,7 @@ namespace VEPROMS.CSLA.Library public string SearchAnnotationText { get { return _SearchAnnotationText; } + set { _SearchAnnotationText = value; } } internal string _SearchAnnotationType; public string SearchAnnotationType diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index f3191331..83f859a0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -624,23 +624,20 @@ namespace VEPROMS.CSLA.Library } private static bool AddOptionalTranGetSectionHdr(bool textAdded, TransitionBuilder tb, string token, string nonToken) { - // If section is not a procedure step section, add it. - // If Procedure going to has only 1 step section, do not add it. - // If procedure going to has more than 1 step section and is NOT same procedure - // and going to default section, do not add it. - // If procedure going to has more than 1 step section and going to non-default section, add it. - // first handle 'to' non-step section. Always add it. if (tb._ToItem.IsSection && !tb._ToItem.IsStepSection)return AddTranGetSectionHdr(textAdded, tb, token, nonToken); - - // Now, handle case where 'to' procedure only has one step section OR going 'to' the default section of a - // different procedure. It is NOT added. + int cntsect = 0; ItemInfo sect = TranGetSectionItem(tb._ToItem); foreach (ItemInfo ii in tb._ToItem.MyProcedure.Sections) if (ii.IsStepSection) cntsect++; - if (cntsect == 1 || (sect != null && sect.IsDefaultSection && tb._ToItem.IsStep) - || (tb._ToItem.MyProcedure != tb._FromItem.MyProcedure && sect != null && sect.IsDefaultSection && tb._ToItem.IsSection) - || tb._ToItem.IsProcedure) return textAdded ? true : false; + // If Procedure going to has only 1 step section, do not add it. + if (cntsect == 1) return textAdded ? true : false; + + // If procedure going to has more than 1 step section and is NOT same procedure + // and going to default section, do not add it. + if (tb._ToItem.MyProcedure.ItemID != tb._FromItem.MyProcedure.ItemID && sect != null && + sect.IsDefaultSection) return textAdded ? true : false; + return AddTranGetSectionHdr(textAdded, tb, token, nonToken); } private static bool AddTranGetSectionHdr(bool textAdded, TransitionBuilder tb, string token, string nonToken)