B2017-272: For enhanced, use correct section type when creating a new section when previous sections in source are not linked.

B2017-272:  added a null check
This commit is contained in:
Kathy Ruffing 2017-12-12 16:02:30 +00:00
parent 3e4c4782bd
commit 8b177644f7
2 changed files with 7 additions and 4 deletions

View File

@ -726,9 +726,9 @@ namespace VEPROMS.CSLA.Library
}
else
{
if (GetType() == typeof(ProcedureInfo))
if (GetType() == typeof(ProcedureInfo) || MyContent.Type < 10000)
tmp = DataPortal.Fetch<ProcedureInfo>(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<SectionInfo>(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID));
else
tmp = DataPortal.Fetch<StepInfo>(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);

View File

@ -540,6 +540,7 @@ namespace VEPROMS.CSLA.Library
}
public List<StepDataRetval> StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo)
{
if (topType == null) return null;
List<StepDataRetval> sds = new List<StepDataRetval>();
int retval = -1;
int cntitm = 0;