From 5fb0136cbb43cf8414c352db7f98296277efc636 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 7 Nov 2018 13:08:03 +0000 Subject: [PATCH] =?UTF-8?q?B2018-141=20Remove=20duplicate=20section=20numb?= =?UTF-8?q?er=20from=20background=20step=20tab.=20=20B2018-142=20=E2=80=93?= =?UTF-8?q?=20added=20Null=20checks=20so=20that=20an=20un-linked=20backgro?= =?UTF-8?q?und=20document=20can=20be=20deleted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 3f40942c..9b839067 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2263,6 +2263,7 @@ namespace VEPROMS.CSLA.Library if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0) { SectionInfo siSource = SectionInfo.Get(sc.MyEnhancedDocuments[0].ItemID); + if (siSource == null) return true; //B2018-142 null check to allow deletion of unlinked background procedure SectionConfig scs = siSource.MyConfig as SectionConfig; if (scs.Section_LnkEnh == "T") return true; } @@ -3886,6 +3887,8 @@ 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}")) + 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()); tbformat = tbformat.TrimStart(" ".ToCharArray()); @@ -7039,6 +7042,7 @@ namespace VEPROMS.CSLA.Library // now get its enhtype from the source: int enhtype = -1; ItemInfo sourceProc = ItemInfo.Get(eds[0].ItemID); + if (sourceProc == null) return null; //B2018-142 to allow an un-linked background procedure to be deleted EnhancedDocuments sourceProcEds = sourceProc.GetMyEnhancedDocuments(); foreach (EnhancedDocument spe in sourceProcEds) {