From 3fb5792a438e4cee5a9093dd129d04a8e54a4844 Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 19 Dec 2013 17:43:34 +0000 Subject: [PATCH] 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. --- PROMS/DataLoader/Sections.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index 9bfae069..c946007a 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -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();