Variables for locations of fmtall and genmacall

This commit is contained in:
John Jenko 2010-04-23 17:59:21 +00:00
parent a01acbef71
commit 94d75fa99b

View File

@ -26,6 +26,8 @@ namespace DataLoader
{
public partial class Loader
{
private string _FmtAllPath;
private string _GenmacAllPath;
private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
{
@ -33,7 +35,8 @@ namespace DataLoader
string genmacdata = null;
XmlDocument xd = null;
string path = "c:\\development\\fmtall\\" + format + "all.xml";
//string path = "c:\\development\\fmtall\\" + format + "all.xml";
string path = _FmtAllPath + "\\" + format + "all.xml";
if (File.Exists(path))
{
try
@ -52,7 +55,8 @@ namespace DataLoader
// Do we need genmac - only if non-subformat
if (!issub)
{
path = "c:\\development\\genmacall\\" + format + ".svg";
//path = "c:\\development\\genmacall\\" + format + ".svg";
path = _GenmacAllPath + "\\" + format + ".svg";
if (File.Exists(path))
{
try
@ -93,12 +97,13 @@ namespace DataLoader
Format basefmt = null;
Format parent = null;
// Load base format.
basefmt = AddFormatToDB(null, "base", false, DateTime.Now, "Migration");
if (basefmt == null) return;
// now loop through all files... If there is an _ in the name, it's a subformat
// (for example, AEP_00.xml) skip it in main loop, it's handled for each format.
DirectoryInfo di = new DirectoryInfo(@"c:\development\fmtall");
DirectoryInfo di = new DirectoryInfo(_FmtAllPath); //(@"c:\development\fmtall");
FileInfo[] fis = di.GetFiles("*.xml");
foreach (FileInfo fi in fis)
@ -115,7 +120,7 @@ namespace DataLoader
{
// now see if there are any subformats associated with this, if so
// add them here...
DirectoryInfo sdi = new DirectoryInfo("c:\\development\\fmtall");
DirectoryInfo sdi = new DirectoryInfo(_FmtAllPath); //("c:\\development\\fmtall");
FileInfo[] sfis = di.GetFiles(fmtname + "_*.xml");
foreach (FileInfo sfi in sfis)
{