From ab44a78d9e524f1b6f5d1c85a4057be3dcacbcea Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 17 May 2017 12:16:53 +0000 Subject: [PATCH] B2017-083: Missing procedures in enhanced after creating new enhanced procedure from source, if it first procedure in list --- .../Extension/ItemInsertExt.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 7b9a50b0..e015ae25 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -925,6 +925,21 @@ namespace VEPROMS.CSLA.Library scng = sc.ToString(); } tmp = NewItemInfoFetch(ItemID, addType, number, text, type, null, null, scng, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); + // B2017-083: first child - adjust the docversion itemid to point to this new one: + if (IsProcedure && tmp != null && tmp.MyPrevious == null) + { + if (this.MyDocVersion != null) + { + using (DocVersion parentItemDV = MyDocVersion.Get()) + { + using (Item tmpi = tmp.Get()) + { + parentItemDV.MyItem = tmpi; + parentItemDV.Save(); + } + } + } + } } if (tmp == null) return null; // if next exists, it is updated in SQL so we have to manually force the iteminfo updates