diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 88b03a24..34bc6a6f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -726,9 +726,9 @@ namespace VEPROMS.CSLA.Library } else { - if (GetType() == typeof(ProcedureInfo)) + if (GetType() == typeof(ProcedureInfo) || MyContent.Type < 10000) tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - else if (GetType() == typeof(SectionInfo)) + else if (GetType() == typeof(SectionInfo) || (MyContent.Type < 20000)) tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); else tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); @@ -1625,7 +1625,8 @@ namespace VEPROMS.CSLA.Library { ItemInfo exEnh = ItemInfo.Get(edSource.ItemID); int enhType = (int)MyContent.Type; - if (iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (bryon data) + // B2017-272 did not need the if-check to set the enhanced type (commented it out) + //if (iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (bryon data) enhType = (int)exEnh.MyContent.Type; if (exEnh.IsStep) newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype,enhType, edSource.Type, this.ItemID); @@ -1647,7 +1648,8 @@ namespace VEPROMS.CSLA.Library { ItemInfo exEnh = ItemInfo.Get(edSource.ItemID); int enhType = (int)MyContent.Type; - if (iiCur != null && iiCur.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (byron data) (B2017-174: added null check) + // B2017-272 did not need the if-check to set the enhanced type (commented it out) + //if (iiNxt != null && iiNxt.MyContent.Type == MyContent.Type) // B2017-134 the enhanced section was being created with the wrong document type creating new enhanced section from EOP (byron data) (B2017-174: added null check) enhType = (int)exEnh.MyContent.Type; if (exEnh.IsStep) newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID); diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index ddf94377..cd81f425 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -540,6 +540,7 @@ namespace VEPROMS.CSLA.Library } public List StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) { + if (topType == null) return null; List sds = new List(); int retval = -1; int cntitm = 0;