diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index 0f065fd9..cfa9c8e4 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -169,6 +169,25 @@ namespace DataLoader } else itm = Item.MakeItem(FromItem, cont, Dts, Userid); + + // Check this section type versus the docstyleindex, i.e. that the docstyle was not of + // the same type of section as the data. For example, rgesmped.in has only 1 doc style + // and it WAS both step & doc when the section was added as a word doc, but the current + // rgesmped.in only supports step sections. The result was that there is Word content but + // a step docstyle. + // + // Identify this problem by putting out an error message & adding an annotation. The data + // will have to be fixed manually, i.e. go into sql server & change the format and Type to + // use a word section type. + if (needEntry && format.PlantFormat.DocStyles.DocStyleList[docstyleindx].IsStepSection) + { + frmMain.AddError("Conflicting section type (Word Section: {0}) & Document Style (Step Section type: {1})", + ProcNumber + ":" + Number + ":" + Title, format.PlantFormat.DocStyles.DocStyleList[docstyleindx].Name); + ItemAnnotation ia = itm.ItemAnnotations.Add(MigrationErrorType); + ia.SearchText = "Conflicting Section Type and Document Style"; + ia.UserID = "Migration"; + itm.Save(); + } if (missingDocFile) { ItemAnnotation ia = itm.ItemAnnotations.Add(MigrationErrorType); @@ -251,11 +270,6 @@ namespace DataLoader } private int GetDocStyleIndx(string dstyleindx, FormatInfo format, Item procitem, /* DocVersion docver,*/ string Number, string Title) { - // get the format, if format is set, use it, otherwise walk - //if (format == null) - //{ - //format = GetFormat(procitem, docver); - //} int docstyle = LookupOldToNew(dstyleindx); foreach (DocStyle ds in format.PlantFormat.DocStyles.DocStyleList) {