Added public properties MultiUnitCount, Old2NewApple and New2OldApple to Loader class

Added relating slave index to specific unit
This commit is contained in:
Rich 2012-12-04 22:33:38 +00:00
parent 03d49ce2df
commit 81a2ad1267

View File

@ -31,6 +31,9 @@ namespace DataLoader
}
private OutsideTransition _OutTran;
public int MultiUnitCount = 0;
public Dictionary<int, int> Old2NewApple;
public Dictionary<int, int> 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<int, int>();
New2OldApple = new Dictionary<int, int>();
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