Corrected code to delete INF files. These contain invalid Index paths

Added TextBox and Property to Skip Procedures and speed-up debugging
Added TextBox and Property to Skip Processing Procedures and speed-up debugging
Removed duplicate entry
Added Code to Skip Processing Procedures and speed-up debugging
Changed code to use entire (16 Character) ROID to get the Multiple Return Values
This commit is contained in:
Rich 2011-01-12 21:28:33 +00:00
parent 37ffd45792
commit 54a306f114
6 changed files with 98 additions and 52 deletions

View File

@ -43,8 +43,7 @@ namespace DataLoader
{
// JSJ 02/10/2010 - Remove all the .INF files before proceeding to convert.
// The INF files contain a path to a corresponding NDX file - had data with bat NDX path
if (File.Exists(pth + @"\*.inf"))
File.Delete(pth + @"\*.inf");
DeleteINFFiles(pth);
_OutTran = new OutsideTransition(cn);
MigrateROFST(pth, docver);
// Migrate library documents
@ -90,6 +89,13 @@ namespace DataLoader
}
return TimeSpan.FromTicks(lTime);
}
private void DeleteINFFiles(string pth)
{
DirectoryInfo di = new DirectoryInfo(pth);
FileInfo [] myFiles = di.GetFiles("*.INF");
foreach (FileInfo myFile in myFiles)
myFile.Delete();
}
private VEPROMS.CSLA.Library.VersionTypeEnum DocVersionType(string s)
{
if (s.EndsWith("approved")) return VEPROMS.CSLA.Library.VersionTypeEnum.Approved;

View File

@ -348,13 +348,16 @@ namespace DataLoader
frmMain.pbProcMaximum = ds.Tables[0].Rows.Count;
frmMain.UpdateLabels(0, 0, 0);
dicSetfileEntries = new Dictionary<string, string>(); // used to check for duplicate SET file info - jsj 2/11/10
int i = 0;
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (OKtoProcessDBF(dr)) // look for duplicate SET file info - jsj 2/11/10
if (++i > frmMain.SkipProcedures)
{
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver, convertProcedures, activeFormat);
if (FirstItm == null) FirstItm = FrItm;
if (OKtoProcessDBF(dr)) // look for duplicate SET file info - jsj 2/11/10
{
FrItm = MigrateProcedure(cn, dr, FrItm, pth, docver, convertProcedures, activeFormat);
if (FirstItm == null) FirstItm = FrItm;
}
}
}
da.Dispose();

View File

@ -72,13 +72,13 @@ namespace DataLoader
RoUsage ro = RoUsage.MakeRoUsage(content, ROID, null, DateTime.Now, "Migration", rodb);
try
{
string rov = rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper());
string rov = rofstinfo.ROFSTLookup.GetRoValue(ROID.ToUpper());
//jsj string rov = TextConvert.ConvertText(rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()));
//string results = string.Format(@"{0}{1}\v #Link:ReferencedObject:{2} {3} {4}\v0",
// '\x15', rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID, rodb.RODbID);
// TODO: NEED TO PASS IN ConvertCaret FORMAT FLAG
string roval = TextConvert.ConvertDOSSuperAndSubScripts(rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()));
string roval = TextConvert.ConvertDOSSuperAndSubScripts(rofstinfo.ROFSTLookup.GetRoValue(ROID.ToUpper()));
roval = TextConvert.ReplaceUnicode(roval, conv_caret);
if (textm[tok] == '\x3a6' && roval.IndexOf('\n')>-1) // figure - just get image name
{

View File

@ -31,6 +31,9 @@ namespace DataLoader
{
this.components = new System.ComponentModel.Container();
this.sc = new System.Windows.Forms.SplitContainer();
this.tbSkip = new System.Windows.Forms.TextBox();
this.lblSkip = new System.Windows.Forms.Label();
this.cbCheckRTF = new System.Windows.Forms.CheckBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.tbxBackupFileName = new System.Windows.Forms.TextBox();
this.lblBackupName = new System.Windows.Forms.Label();
@ -74,7 +77,6 @@ namespace DataLoader
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsslError = new System.Windows.Forms.ToolStripStatusLabel();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbCheckRTF = new System.Windows.Forms.CheckBox();
this.sc.Panel1.SuspendLayout();
this.sc.Panel2.SuspendLayout();
this.sc.SuspendLayout();
@ -85,12 +87,14 @@ namespace DataLoader
//
this.sc.Dock = System.Windows.Forms.DockStyle.Fill;
this.sc.Location = new System.Drawing.Point(0, 0);
this.sc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.sc.Margin = new System.Windows.Forms.Padding(2);
this.sc.Name = "sc";
this.sc.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// sc.Panel1
//
this.sc.Panel1.Controls.Add(this.tbSkip);
this.sc.Panel1.Controls.Add(this.lblSkip);
this.sc.Panel1.Controls.Add(this.cbCheckRTF);
this.sc.Panel1.Controls.Add(this.checkBox1);
this.sc.Panel1.Controls.Add(this.tbxBackupFileName);
@ -140,13 +144,46 @@ namespace DataLoader
this.sc.SplitterWidth = 3;
this.sc.TabIndex = 46;
//
// tbSkip
//
this.tbSkip.Location = new System.Drawing.Point(578, 250);
this.tbSkip.Name = "tbSkip";
this.tbSkip.Size = new System.Drawing.Size(44, 20);
this.tbSkip.TabIndex = 88;
this.tbSkip.Text = "0";
this.tbSkip.Visible = false;
//
// lblSkip
//
this.lblSkip.AutoSize = true;
this.lblSkip.Location = new System.Drawing.Point(539, 253);
this.lblSkip.Name = "lblSkip";
this.lblSkip.Size = new System.Drawing.Size(28, 13);
this.lblSkip.TabIndex = 87;
this.lblSkip.Text = "Skip";
this.lblSkip.Visible = false;
//
// cbCheckRTF
//
this.cbCheckRTF.AutoSize = true;
this.cbCheckRTF.Location = new System.Drawing.Point(6, 231);
this.cbCheckRTF.Margin = new System.Windows.Forms.Padding(2);
this.cbCheckRTF.Name = "cbCheckRTF";
this.cbCheckRTF.Size = new System.Drawing.Size(81, 17);
this.cbCheckRTF.TabIndex = 86;
this.cbCheckRTF.Text = "Check RTF";
this.toolTip1.SetToolTip(this.cbCheckRTF, "This will run through StepRTF.SaveText and will put change bars on all the steps." +
" Should only be run to validate the code that fixes the Transitions.");
this.cbCheckRTF.UseVisualStyleBackColor = true;
this.cbCheckRTF.Visible = false;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox1.Location = new System.Drawing.Point(537, 77);
this.checkBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.checkBox1.Margin = new System.Windows.Forms.Padding(2);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(70, 17);
this.checkBox1.TabIndex = 85;
@ -158,7 +195,7 @@ namespace DataLoader
//
this.tbxBackupFileName.BackColor = System.Drawing.SystemColors.Info;
this.tbxBackupFileName.Location = new System.Drawing.Point(103, 75);
this.tbxBackupFileName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tbxBackupFileName.Margin = new System.Windows.Forms.Padding(2);
this.tbxBackupFileName.Name = "tbxBackupFileName";
this.tbxBackupFileName.Size = new System.Drawing.Size(202, 20);
this.tbxBackupFileName.TabIndex = 84;
@ -193,7 +230,7 @@ namespace DataLoader
this.cbxOnlyThisSet.AutoSize = true;
this.cbxOnlyThisSet.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.cbxOnlyThisSet.Location = new System.Drawing.Point(23, 121);
this.cbxOnlyThisSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbxOnlyThisSet.Margin = new System.Windows.Forms.Padding(2);
this.cbxOnlyThisSet.Name = "cbxOnlyThisSet";
this.cbxOnlyThisSet.Size = new System.Drawing.Size(92, 17);
this.cbxOnlyThisSet.TabIndex = 81;
@ -205,7 +242,7 @@ namespace DataLoader
//
this.btnLogLoc.BackColor = System.Drawing.SystemColors.Info;
this.btnLogLoc.Location = new System.Drawing.Point(537, 50);
this.btnLogLoc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnLogLoc.Margin = new System.Windows.Forms.Padding(2);
this.btnLogLoc.Name = "btnLogLoc";
this.btnLogLoc.Size = new System.Drawing.Size(118, 20);
this.btnLogLoc.TabIndex = 79;
@ -217,7 +254,7 @@ namespace DataLoader
//
this.txbLogFileLoc.BackColor = System.Drawing.SystemColors.Info;
this.txbLogFileLoc.Location = new System.Drawing.Point(98, 51);
this.txbLogFileLoc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txbLogFileLoc.Margin = new System.Windows.Forms.Padding(2);
this.txbLogFileLoc.Name = "txbLogFileLoc";
this.txbLogFileLoc.Size = new System.Drawing.Size(434, 20);
this.txbLogFileLoc.TabIndex = 78;
@ -242,7 +279,7 @@ namespace DataLoader
//
this.btnFixTransitions.BackColor = System.Drawing.SystemColors.Info;
this.btnFixTransitions.Location = new System.Drawing.Point(6, 188);
this.btnFixTransitions.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnFixTransitions.Margin = new System.Windows.Forms.Padding(2);
this.btnFixTransitions.Name = "btnFixTransitions";
this.btnFixTransitions.Size = new System.Drawing.Size(64, 36);
this.btnFixTransitions.TabIndex = 76;
@ -279,7 +316,7 @@ namespace DataLoader
//
this.cbFormatsOnly.AutoSize = true;
this.cbFormatsOnly.Location = new System.Drawing.Point(536, 231);
this.cbFormatsOnly.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbFormatsOnly.Margin = new System.Windows.Forms.Padding(2);
this.cbFormatsOnly.Name = "cbFormatsOnly";
this.cbFormatsOnly.Size = new System.Drawing.Size(87, 17);
this.cbFormatsOnly.TabIndex = 73;
@ -291,7 +328,7 @@ namespace DataLoader
//
this.btnBrowseVeProms.BackColor = System.Drawing.SystemColors.Control;
this.btnBrowseVeProms.Location = new System.Drawing.Point(536, 28);
this.btnBrowseVeProms.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnBrowseVeProms.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseVeProms.Name = "btnBrowseVeProms";
this.btnBrowseVeProms.Size = new System.Drawing.Size(119, 20);
this.btnBrowseVeProms.TabIndex = 72;
@ -304,7 +341,7 @@ namespace DataLoader
//
this.tbVePromsPath.BackColor = System.Drawing.SystemColors.Window;
this.tbVePromsPath.Location = new System.Drawing.Point(114, 29);
this.tbVePromsPath.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tbVePromsPath.Margin = new System.Windows.Forms.Padding(2);
this.tbVePromsPath.Name = "tbVePromsPath";
this.tbVePromsPath.Size = new System.Drawing.Size(419, 20);
this.tbVePromsPath.TabIndex = 71;
@ -349,7 +386,7 @@ namespace DataLoader
// btnBrowseVesam
//
this.btnBrowseVesam.Location = new System.Drawing.Point(537, 98);
this.btnBrowseVesam.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnBrowseVesam.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseVesam.Name = "btnBrowseVesam";
this.btnBrowseVesam.Size = new System.Drawing.Size(119, 20);
this.btnBrowseVesam.TabIndex = 67;
@ -395,7 +432,7 @@ namespace DataLoader
this.cbLazy.Checked = true;
this.cbLazy.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbLazy.Location = new System.Drawing.Point(536, 210);
this.cbLazy.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbLazy.Margin = new System.Windows.Forms.Padding(2);
this.cbLazy.Name = "cbLazy";
this.cbLazy.Size = new System.Drawing.Size(75, 17);
this.cbLazy.TabIndex = 63;
@ -406,7 +443,7 @@ namespace DataLoader
// btnConvertSelected
//
this.btnConvertSelected.Location = new System.Drawing.Point(170, 209);
this.btnConvertSelected.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnConvertSelected.Margin = new System.Windows.Forms.Padding(2);
this.btnConvertSelected.Name = "btnConvertSelected";
this.btnConvertSelected.Size = new System.Drawing.Size(151, 19);
this.btnConvertSelected.TabIndex = 62;
@ -418,7 +455,7 @@ namespace DataLoader
// btnLoadTreeDB
//
this.btnLoadTreeDB.Location = new System.Drawing.Point(4, 4);
this.btnLoadTreeDB.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnLoadTreeDB.Margin = new System.Windows.Forms.Padding(2);
this.btnLoadTreeDB.Name = "btnLoadTreeDB";
this.btnLoadTreeDB.Size = new System.Drawing.Size(118, 19);
this.btnLoadTreeDB.TabIndex = 60;
@ -433,7 +470,7 @@ namespace DataLoader
this.cbPurgeData.Checked = true;
this.cbPurgeData.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbPurgeData.Location = new System.Drawing.Point(536, 188);
this.cbPurgeData.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbPurgeData.Margin = new System.Windows.Forms.Padding(2);
this.cbPurgeData.Name = "cbPurgeData";
this.cbPurgeData.Size = new System.Drawing.Size(119, 17);
this.cbPurgeData.TabIndex = 59;
@ -453,7 +490,7 @@ namespace DataLoader
// pbStep
//
this.pbStep.Location = new System.Drawing.Point(170, 185);
this.pbStep.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pbStep.Margin = new System.Windows.Forms.Padding(2);
this.pbStep.Name = "pbStep";
this.pbStep.Size = new System.Drawing.Size(362, 15);
this.pbStep.TabIndex = 57;
@ -461,7 +498,7 @@ namespace DataLoader
// pbSect
//
this.pbSect.Location = new System.Drawing.Point(170, 167);
this.pbSect.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pbSect.Margin = new System.Windows.Forms.Padding(2);
this.pbSect.Name = "pbSect";
this.pbSect.Size = new System.Drawing.Size(362, 15);
this.pbSect.TabIndex = 56;
@ -469,7 +506,7 @@ namespace DataLoader
// pbProc
//
this.pbProc.Location = new System.Drawing.Point(170, 148);
this.pbProc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.pbProc.Margin = new System.Windows.Forms.Padding(2);
this.pbProc.Name = "pbProc";
this.pbProc.Size = new System.Drawing.Size(362, 15);
this.pbProc.TabIndex = 55;
@ -480,7 +517,7 @@ namespace DataLoader
this.cbSaveDoc.Checked = true;
this.cbSaveDoc.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbSaveDoc.Location = new System.Drawing.Point(537, 148);
this.cbSaveDoc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbSaveDoc.Margin = new System.Windows.Forms.Padding(2);
this.cbSaveDoc.Name = "cbSaveDoc";
this.cbSaveDoc.Size = new System.Drawing.Size(77, 17);
this.cbSaveDoc.TabIndex = 54;
@ -493,7 +530,7 @@ namespace DataLoader
//
this.cbSaveRTF.AutoSize = true;
this.cbSaveRTF.Location = new System.Drawing.Point(537, 168);
this.cbSaveRTF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbSaveRTF.Margin = new System.Windows.Forms.Padding(2);
this.cbSaveRTF.Name = "cbSaveRTF";
this.cbSaveRTF.Size = new System.Drawing.Size(75, 17);
this.cbSaveRTF.TabIndex = 53;
@ -506,7 +543,7 @@ namespace DataLoader
//
this.btnBrowse.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.btnBrowse.Location = new System.Drawing.Point(537, 120);
this.btnBrowse.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnBrowse.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(118, 19);
this.btnBrowse.TabIndex = 52;
@ -519,7 +556,7 @@ namespace DataLoader
//
this.tbSource.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.tbSource.Location = new System.Drawing.Point(114, 120);
this.tbSource.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tbSource.Margin = new System.Windows.Forms.Padding(2);
this.tbSource.Name = "tbSource";
this.tbSource.Size = new System.Drawing.Size(419, 20);
this.tbSource.TabIndex = 51;
@ -557,7 +594,7 @@ namespace DataLoader
//
this.btnConvert.BackColor = System.Drawing.SystemColors.Info;
this.btnConvert.Location = new System.Drawing.Point(6, 145);
this.btnConvert.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnConvert.Margin = new System.Windows.Forms.Padding(2);
this.btnConvert.Name = "btnConvert";
this.btnConvert.Size = new System.Drawing.Size(64, 40);
this.btnConvert.TabIndex = 46;
@ -572,7 +609,7 @@ namespace DataLoader
this.tv.CheckBoxes = true;
this.tv.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tv.Location = new System.Drawing.Point(0, 20);
this.tv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tv.Margin = new System.Windows.Forms.Padding(2);
this.tv.Name = "tv";
this.tv.Size = new System.Drawing.Size(664, 184);
this.tv.TabIndex = 24;
@ -607,20 +644,6 @@ namespace DataLoader
this.tsslError.Text = "No Errors";
this.tsslError.TextAlign = System.Drawing.ContentAlignment.TopLeft;
//
// cbCheckRTF
//
this.cbCheckRTF.AutoSize = true;
this.cbCheckRTF.Location = new System.Drawing.Point(6, 231);
this.cbCheckRTF.Margin = new System.Windows.Forms.Padding(2);
this.cbCheckRTF.Name = "cbCheckRTF";
this.cbCheckRTF.Size = new System.Drawing.Size(81, 17);
this.cbCheckRTF.TabIndex = 86;
this.cbCheckRTF.Text = "Check RTF";
this.toolTip1.SetToolTip(this.cbCheckRTF, "This will run through StepRTF.SaveText and will put change bars on all the steps." +
" Should only be run to validate the code that fixes the Transitions.");
this.cbCheckRTF.UseVisualStyleBackColor = true;
this.cbCheckRTF.Visible = false;
//
// frmLoader
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -628,7 +651,7 @@ namespace DataLoader
this.ClientSize = new System.Drawing.Size(664, 486);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.sc);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "frmLoader";
this.Text = "PROMS-2010 Data Loader";
this.Load += new System.EventHandler(this.frmLoader_Load);
@ -691,5 +714,7 @@ namespace DataLoader
private System.Windows.Forms.Label lblBackupName;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox cbCheckRTF;
private System.Windows.Forms.TextBox tbSkip;
private System.Windows.Forms.Label lblSkip;
}
}

View File

@ -57,7 +57,20 @@ namespace DataLoader
public int pbStepMaximum { get { return pbStep.Maximum; } set { pbStep.Maximum = value; } }
public int pbStepValue { get { return pbStep.Value; } set { pbStep.Value = value; } }
public int pbProcValue { get { return pbProc.Value; } set { pbProc.Value = value; } }
public int SkipProcedures
{
get
{
try
{
return int.Parse(tbSkip.Text);
}
catch (Exception ex)
{
}
return 0;
}
}
public string Status
{
get { return toolStripStatusLabel1.Text; }
@ -572,6 +585,8 @@ namespace DataLoader
btnConvertSelected.Visible = _DeveloperMode;
cbxOnlyThisSet.Visible = _DeveloperMode;
cbCheckRTF.Visible = _DeveloperMode;
tbSkip.Visible = _DeveloperMode;
lblSkip.Visible = _DeveloperMode;
}
}

View File

@ -120,9 +120,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>217, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>217, 17</value>
</metadata>
<metadata name="fbd.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>