diff --git a/PROMS/DataLoader/DocVersions.cs b/PROMS/DataLoader/DocVersions.cs index 36737338..38616fb3 100644 --- a/PROMS/DataLoader/DocVersions.cs +++ b/PROMS/DataLoader/DocVersions.cs @@ -31,6 +31,9 @@ namespace DataLoader } private OutsideTransition _OutTran; + public int MultiUnitCount = 0; + public Dictionary Old2NewApple; + public Dictionary New2OldApple; public TimeSpan MigrateDocVersion(DocVersion docver, bool convertProcedures) { @@ -38,6 +41,19 @@ namespace DataLoader string pth = docver.Title; // if the Title is empty, return because this docversion has already been migrated. if (pth == null || pth == "") return TimeSpan.FromTicks(lTime); + MultiUnitCount = docver.DocVersionConfig.Unit_Count; + if (MultiUnitCount > 0) + { + Old2NewApple = new Dictionary(); + New2OldApple = new Dictionary(); + for (int i = 1; i <= MultiUnitCount; i++) + { + docver.DocVersionConfig.SelectedSlave = i; + int oldindex = int.Parse(docver.DocVersionConfig.Old_Index); + Old2NewApple.Add(oldindex, i); + New2OldApple.Add(i, oldindex); + } + } if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return new TimeSpan(); // Open connection OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False"); if (convertProcedures) @@ -46,10 +62,10 @@ namespace DataLoader // The INF files contain a path to a corresponding NDX file - had data with bat NDX path DeleteINFFiles(pth); _OutTran = new OutsideTransition(cn); - frmMain.AddInfo("Before MigrateROFST {0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll); + frmMain.AddInfo("Before MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll); MigrateROFST(pth, docver); GC.Collect(); - frmMain.AddInfo("After MigrateROFST {0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll); + frmMain.AddInfo("After MigrateROFST{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll); // Migrate library documents MigrateLibDocs(cn, pth); // Initialize Dictionaries