diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index f260dd99..66389e26 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3744,6 +3744,21 @@ namespace VEPROMS.CSLA.Library return null; } } + // B2019-126 Check the HLS of the source document (ex. EOP step) to see if it includes the section number prefix in its tab + public bool LinkedTabHasSectionPrefix + { + get + { + EnhancedDocuments eds = GetMyEnhancedDocuments(); + if (eds != null && eds.Count == 1 && eds[0].Type == 0) + { + ItemInfo srcItem = ItemInfo.Get(eds[0].ItemID); + if (srcItem != null) // B2018-097 handle a null reference + return ((srcItem.ActiveParent as ItemInfo).FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") && FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}")); + } + return false; + } + } public int? LinkedOrdinal { get @@ -3888,7 +3903,7 @@ namespace VEPROMS.CSLA.Library { string tb = (LinkedOrdinal==null)? "NA" : LinkedOrdinal.ToString(); tbformat = tbformat.Replace("{LNK C/N Num}", tb); - if ((ActiveParent as ItemInfo).FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}")) + if ((ActiveParent as ItemInfo).FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") && LinkedTabHasSectionPrefix) // B2019-126 Check the HLS of the source document (ex. EOP step) to see if it includes the section number prefix in its tab tbformat = tbformat.Replace("{Section Prefix}",""); // B2018-141 remove duplicate section number if ((ActiveParent as ItemInfo).LinkedTab != null) tbformat = tbformat.Replace("{LNK Step Num}", (ActiveParent as ItemInfo).LinkedTab.Trim(" .".ToCharArray())); //(ActiveParent as ItemInfo).Ordinal.ToString());