diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index af6d4f70..0400e8c1 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -365,6 +365,10 @@ namespace DataLoader // if this section has the original edit section flag (sequence[2]) save the id. // set pagination, continuous, separate. If blank, don't create attribute - uses format default. + if (sequence.Substring(2, 1) != " ") + { + ci.AddItem("Section", "OriginalSteps", "Y"); + } if (sequence.Substring(4, 1) == "T") { ci.AddItem("Section", "Pagination", "C"); @@ -483,7 +487,7 @@ namespace DataLoader frmMain.pbStepValue = 0; foreach (DataRowView drv in dv) { - FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver); + FrItem = MigrateStep(cn, dt, drv, FrItem, conv_caret, pth, docver,secitem.MyItemInfo.ActiveFormat); if (secitem.MyContent.ContentParts.Count == 0) { // type 6 is step @@ -518,30 +522,33 @@ namespace DataLoader catch (Exception ex) { - FileInfo fi; - switch (ex.Message) - { - case "Index file not found.":// then delete inf file - fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf"); - fi.Delete(); - LoadSection(ds, da, FileName);// Try Again - break; - case "External table is not in the expected format.": // then pad dbt file with 128 zeros. - fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt"); - FileStream fs = fi.OpenWrite(); - fs.Position = fs.Length; - byte[] buf = new byte[128]; - for (int i = 0; i < 128; i++) buf[i] = 0; - fs.Write(buf, 0, 128); - fs.Close(); - LoadSection(ds, da, FileName);// Try Again - break; - default: // Unrecognized error - frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName); - Console.WriteLine("Unrecognized error: error = {0}", ex.Message); - log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException); - break; - } + //FileInfo fi; + //switch (ex.Message) + //{ + // case "Index file not found.":// then delete inf file + // fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf"); + // fi.Delete(); + // LoadSection(ds, da, FileName);// Try Again + // break; + // case "External table is not in the expected format.": // then pad dbt file with 128 zeros. + // fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt"); + // FileStream fs = fi.OpenWrite(); + // fs.Position = fs.Length; + // byte[] buf = new byte[128]; + // for (int i = 0; i < 128; i++) buf[i] = 0; + // fs.Write(buf, 0, 128); + // fs.Close(); + // LoadSection(ds, da, FileName);// Try Again + // break; + // default: // Unrecognized error + // frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName); + // Console.WriteLine("Unrecognized error: error = {0}", ex.Message); + // log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException); + // break; + //} + frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName); + Console.WriteLine("Unrecognized error: error = {0}", ex.Message); + log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException); } } }