This commit is contained in:
Kathy Ruffing 2011-05-19 13:21:02 +00:00
parent f74ce841a5
commit 2a300b24eb
2 changed files with 28 additions and 8 deletions

View File

@ -26,8 +26,8 @@ namespace DataLoader
{ {
public partial class Loader public partial class Loader
{ {
private string _FmtAllPath; public string _FmtAllPath;
private string _GenmacAllPath; public string _GenmacAllPath;
private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid) private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid)
{ {
@ -100,7 +100,20 @@ namespace DataLoader
} }
catch (Exception ex) catch (Exception ex)
{ {
frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path); FormatInfoList lst = FormatInfoList.Get();
foreach (FormatInfo fi in lst)
{
// if this is the format we're updating, update it and break.
if (fi.Name == fname)
{
Format f = Format.Get(fi.FormatID);
f.Data = fmtdata;
f.GenMac = genmacdata;
f.Save();
return f;
}
}
//frmMain.AddError(ex, "AddFormatToDB-make format('{0}','{1}')", parent.Name, path);
} }
return rec; return rec;
} }
@ -120,6 +133,8 @@ namespace DataLoader
foreach (FileInfo fi in fis) foreach (FileInfo fi in fis)
{ {
//if (fi.Name.ToUpper() == "WCN2ALL.XML"|| fi.Name.ToUpper() == "OHLPALL.XML")
//{
bool issub = (fi.Name.IndexOf("_") > 0) ? true : false; bool issub = (fi.Name.IndexOf("_") > 0) ? true : false;
if (!issub && fi.Name.ToLower() != "baseall.xml") if (!issub && fi.Name.ToLower() != "baseall.xml")
{ {
@ -157,6 +172,7 @@ namespace DataLoader
//Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
} }
} }
//}
} }
} }
public FormatInfo GetFormat(string format) public FormatInfo GetFormat(string format)

View File

@ -318,6 +318,15 @@ namespace DataLoader
} }
Database.LoggingInfo = false; Database.LoggingInfo = false;
bool success = true; bool success = true;
if (cbFormatsOnly.Checked)
{
// ASSUMES No Formats/genmacs exist in database.
ldr._FmtAllPath = @"c:\development\fmtall";
ldr._GenmacAllPath = @"c:\development\genmacall";
ldr.LoadAllFormats();
MessageBox.Show("Formats Loaded");
return;
}
// if purge data, purge it all & reload folders & security. // if purge data, purge it all & reload folders & security.
if (cbPurgeData.Checked) if (cbPurgeData.Checked)
{ {
@ -330,11 +339,6 @@ namespace DataLoader
Status = "Loading Security"; Status = "Loading Security";
success = ldr.LoadSecurity(tbVesamPath.Text, tbVePromsPath.Text); success = ldr.LoadSecurity(tbVesamPath.Text, tbVePromsPath.Text);
} }
if (cbFormatsOnly.Checked)
{
MessageBox.Show("Formats Loaded");
return;
}
} }
if (success) if (success)
{ {