From 7f752dfbd3a95e5ba040a77fa1b928e78084a126 Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 25 Oct 2012 00:39:22 +0000 Subject: [PATCH] Fixed logic to use latest DocVersion data when a new Procedure is added as the first procedure. B2012-277 Fixed logic in GetStepLevel to keep from failing on a null value --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 60cec2ae..d42eee8b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -268,12 +268,12 @@ namespace VEPROMS.CSLA.Library { using (DocVersion parentItemDV = parentInfoDV.Get()) { - ItemInfo firstinfo = parentInfoDV.FirstChild(); + int? oldItemID = parentItemDV.ItemID; parentItemDV.MyItem = itm;// First update the parent to point to the new first child parentItemDV.Save(); - if (firstinfo != null) + if (oldItemID != null) { - using (Item firstchild = firstinfo.Get()) + using (Item firstchild = Item.Get((int)oldItemID)) { firstchild.MyPrevious = itm;// Aim the old first child to point to the new first child. firstchild.Save(); @@ -2328,7 +2328,7 @@ namespace VEPROMS.CSLA.Library par = par.MyParent; } bias = 0; - if (par.FormatStepData.TabData.IdentPrint.Contains("{ALPHA}")) + if (par.FormatStepData != null && par.FormatStepData.TabData.IdentPrint.Contains("{ALPHA}")) level--; // ImperfectStructure is used so that the sequential numbering for substeps under an RNO is not same