From eca7ff8c0ed60a7da5364f0f893c084c6bba770b Mon Sep 17 00:00:00 2001 From: John Date: Thu, 6 Jul 2017 14:36:11 +0000 Subject: [PATCH] B2017-134 Creating a new enhanced section from EOP was using incorrect document type --- .../Extension/ItemInsertExt.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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();