added to to handle situation where data loader was trying to add a part to a content where a part already existed with the same fromType.

This commit is contained in:
Rich 2013-12-19 17:43:34 +00:00
parent 63166ed728
commit 3fb5792a43

View File

@ -612,7 +612,21 @@ namespace DataLoader
if (cont != null)
{
// ContentsParts.Add can use 'fromtype', item - fromtype here = 2, section
cont.ContentParts.Add(2, secitem);
if (cont.ContentParts.Contains(2))
{
foreach (ContentPart part in cont.ContentParts)
{
if (part.FromType == 2)
{
Item ii = Item.Get(part.ItemID);
ii.MyContent.ContentParts.Add(2, secitem);
ii.Save();
break;
}
}
}
else
cont.ContentParts.Add(2, secitem);
if (cont.MyZContent.OldStepSequence == null || cont.MyZContent.OldStepSequence == "") cont.MyZContent.OldStepSequence = ProcNumber;
if (!cont.IsSavable) ErrorRpt.ErrorReport(cont);
cont.Save();