Fixed issue where Cautions and Notes where being inserted at the high level step level when using the template logic.

This commit is contained in:
John Jenko 2014-01-22 15:11:53 +00:00
parent 749b675438
commit 62a24592f9

View File

@ -298,7 +298,7 @@ namespace VEPROMS.CSLA.Library
((ItemInfo)ActiveParent).MyContent.RefreshContentParts();
return tmp;
}
private ItemInfo InsertSmartTemplateSubStep(string text, string number, ItemInfo tmp, EAddpingPart adPart, int type)
private ItemInfo InsertSmartTemplateSubStep(string text, string number, ItemInfo tmp, EAddpingPart adPart, int type, E_FromType fromTypeTop)
{
int newItemID = 0;
int topType = GetSmartTemplateTopLevelIndxOfThisType(type);
@ -315,7 +315,8 @@ namespace VEPROMS.CSLA.Library
{
if (firstSmart == null)
{
firstSmart = NewItemInfoFetch(ItemID, adPart, number, tmptext, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
firstSmart = NewItemInfoFetch(ItemID, adPart, number, tmptext, type, (int ?)fromTypeTop, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
//firstSmart = NewItemInfoFetch(ItemID, adPart, number, tmptext, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
siblingSmart = firstSmart;
newItemID = firstSmart.ItemID;
}
@ -630,7 +631,8 @@ namespace VEPROMS.CSLA.Library
public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number)
{
ItemInfo tmp = null;
tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.After, type);
tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.Child, type, fromType);
//tmp = InsertSmartTemplateSubStep(text, number, tmp, EAddpingPart.After, type);
if (tmp == null)
tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
// if next exists, it is updated in SQL so we have to manually force the iteminfo updates