diff --git a/PROMS/DataLoader/Formats.cs b/PROMS/DataLoader/Formats.cs index 348dde0e..13610f58 100644 --- a/PROMS/DataLoader/Formats.cs +++ b/PROMS/DataLoader/Formats.cs @@ -26,8 +26,8 @@ namespace DataLoader { public partial class Loader { - private string _FmtAllPath; - private string _GenmacAllPath; + public string _FmtAllPath; + public string _GenmacAllPath; private Format AddFormatToDB(Format parent, string format, bool issub, DateTime Dts, string Userid) { @@ -100,7 +100,20 @@ namespace DataLoader } 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; } @@ -120,6 +133,8 @@ namespace DataLoader foreach (FileInfo fi in fis) { + //if (fi.Name.ToUpper() == "WCN2ALL.XML"|| fi.Name.ToUpper() == "OHLPALL.XML") + //{ bool issub = (fi.Name.IndexOf("_") > 0) ? true : false; if (!issub && fi.Name.ToLower() != "baseall.xml") { @@ -157,6 +172,7 @@ namespace DataLoader //Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); } } + //} } } public FormatInfo GetFormat(string format) diff --git a/PROMS/DataLoader/frmLoader.cs b/PROMS/DataLoader/frmLoader.cs index e40795c7..1697c5e3 100644 --- a/PROMS/DataLoader/frmLoader.cs +++ b/PROMS/DataLoader/frmLoader.cs @@ -318,6 +318,15 @@ namespace DataLoader } Database.LoggingInfo = false; 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 (cbPurgeData.Checked) { @@ -330,11 +339,6 @@ namespace DataLoader Status = "Loading Security"; success = ldr.LoadSecurity(tbVesamPath.Text, tbVePromsPath.Text); } - if (cbFormatsOnly.Checked) - { - MessageBox.Show("Formats Loaded"); - return; - } } if (success) {