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
This commit is contained in:
Rich 2012-10-25 00:39:22 +00:00
parent c5e45bbe3f
commit 7f752dfbd3

View File

@ -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