Added Command Line Parameters:
Auto - Used to run from a batch file. Automatically starts the processing PurgeData - Yes - Create a new database. No - Append to an existing database DBName - Database name ProcedureSetPath - 16 bit source data path Skip - How many procedures to skip HowMany - How many procedures to process Support the ability to append to an existing procedure set Use new command line parameters
This commit is contained in:
@@ -29,7 +29,7 @@ namespace DataLoader
|
||||
public partial class Loader
|
||||
{
|
||||
|
||||
private void MigrateLibDocs(OleDbConnection cn, string pth)
|
||||
private void MigrateLibDocs(OleDbConnection cn, string pth, bool appending)
|
||||
{
|
||||
// MessageBox.Show("Before LibDocs");
|
||||
frmMain.AddInfo("Before MigrateLibDocs{0}\r\n{1}", GC.GetTotalMemory(true), VEPROMS.CSLA.Library.CSLACache.UsageAll);
|
||||
@@ -38,7 +38,8 @@ namespace DataLoader
|
||||
// file. During processing for procedures/sections occurs, the used library documents
|
||||
// will be migrated. After that, any remaining library documents will be added to
|
||||
// the section table without a reference from the structuretbl.
|
||||
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
||||
Dictionary<string, int> dicLibDocSect = new Dictionary<string, int>();
|
||||
VEPROMS.CSLA.Library.DocumentInfoList docList = VEPROMS.CSLA.Library.DocumentInfoList.Get();
|
||||
frmMain.UpdateLabelsLibDocs(0, 0);
|
||||
if (Directory.Exists(pth + "\\rtffiles"))
|
||||
{
|
||||
@@ -47,8 +48,18 @@ namespace DataLoader
|
||||
frmMain.UpdateLabelsSetProc(fis.Length);
|
||||
foreach (FileInfo fi in fis)
|
||||
{
|
||||
string fName = fi.Name.Substring(0, 8).ToUpper();
|
||||
frmMain.UpdateLabelsLibDocs(1, 0);
|
||||
dicLibDocSect[fi.Name.Substring(0, 8).ToUpper()] = MigrateLibDoc(fi);
|
||||
if (appending)
|
||||
{
|
||||
foreach (VEPROMS.CSLA.Library.DocumentInfo docInfo in docList)
|
||||
{
|
||||
if(docInfo.Config.Contains(string.Format("\"{0}.LIB\"", fName)))
|
||||
dicLibDocSect[fName] = docInfo.DocID;
|
||||
}
|
||||
}
|
||||
else
|
||||
dicLibDocSect[fName] = MigrateLibDoc(fi);
|
||||
}
|
||||
}
|
||||
dicLibDocRef = new Dictionary<string, int>();
|
||||
@@ -59,7 +70,7 @@ namespace DataLoader
|
||||
foreach (DataRow dr_doc in ds_doc.Tables[0].Rows)
|
||||
{
|
||||
frmMain.UpdateLabelsLibDocs(0, 1);
|
||||
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + dr_doc["FROMSEQUEN"].ToString().PadRight(10);
|
||||
string key = dr_doc["FROMNUMBER"].ToString().PadRight(20) + TextConvert.ConvertSeq(dr_doc["FROMSEQUEN"].ToString()).PadRight(10);
|
||||
if (!dicLibDocSect.ContainsKey(dr_doc["TONUMBER"].ToString().ToUpper()))
|
||||
log.ErrorFormat("Error setting library document references: {0}", dr_doc["TONUMBER"].ToString().ToUpper());
|
||||
else
|
||||
|
Reference in New Issue
Block a user