diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index b45d9c4b..4cbddcc4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -1590,10 +1590,13 @@ namespace VEPROMS.CSLA.Library if (edSource.Type == enhtype) // found one to use: { 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) + enhType = (int)exEnh.MyContent.Type; if (exEnh.IsStep) - newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, MyContent.Type, edSource.Type, this.ItemID); + newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype,enhType, edSource.Type, this.ItemID); else - newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, MyContent.Type, edSource.Type, this.ItemID); + newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, edSource.Type, this.ItemID); } } iiCur = iiCur.MyPrevious; @@ -1609,10 +1612,13 @@ namespace VEPROMS.CSLA.Library if (edSource.Type == enhtype) // found one to use: { 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 (byron data) + enhType = (int)exEnh.MyContent.Type; if (exEnh.IsStep) - newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, MyContent.Type, edSource.Type, this.ItemID); + newEnh = exEnh.InsertEnhancedSteps(MyContent.Text, null, addtype, enhType, edSource.Type, this.ItemID); else - newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, MyContent.Type, edSource.Type, this.ItemID); + newEnh = exEnh.InsertEnhancedItems(MyContent.Text, MyContent.Number, addtype, enhType, edSource.Type, this.ItemID); } } iiNxt = iiNxt.GetNextItem();