B2017-134 Creating a new enhanced section from EOP was using incorrect document type

This commit is contained in:
John Jenko 2017-07-06 14:36:11 +00:00
parent 111fe18565
commit eca7ff8c0e

View File

@ -1590,10 +1590,13 @@ namespace VEPROMS.CSLA.Library
if (edSource.Type == enhtype) // found one to use: if (edSource.Type == enhtype) // found one to use:
{ {
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID); 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) 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 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; iiCur = iiCur.MyPrevious;
@ -1609,10 +1612,13 @@ namespace VEPROMS.CSLA.Library
if (edSource.Type == enhtype) // found one to use: if (edSource.Type == enhtype) // found one to use:
{ {
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID); 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) 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 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(); iiNxt = iiNxt.GetNextItem();