diff --git a/PROMS/DataLoader/Loader.cs b/PROMS/DataLoader/Loader.cs index d989dd76..ed8d5498 100644 --- a/PROMS/DataLoader/Loader.cs +++ b/PROMS/DataLoader/Loader.cs @@ -82,25 +82,12 @@ namespace DataLoader { try { -//#if DEBUG - if (VlnSettings.DebugMode) - { - MessageBox.Show(@"Format files are taken from c:\development\fmtall"); - _FmtAllPath = @"c:\development\fmtall"; - _GenmacAllPath = @"c:\development\genmacall"; - } -//#else - else - { - MessageBox.Show(@"Format files are taken from " + vepromspath + @"\fmtall"); - _FmtAllPath = vepromspath + @"\fmtall"; - _GenmacAllPath = vepromspath + @"\genmacall"; - } -//#endif + _FmtAllPath = frmMain.MySettings.FormatFolder; + _GenmacAllPath = frmMain.MySettings.GenMacFolder; frmMain.Status = "Make Connection"; // make the initial database connection record, annotation types & top // system folder. - dbConn = Connection.MakeConnection("Default", "Default", "Data Source=.\\SQLEXPRESS;Initial Catalog=VEPROMS;Integrated Security=True", 1, null, DateTime.Now, "Migration"); + dbConn = Connection.MakeConnection("Default", "Default", frmMain.MySettings.ConnectionString.Replace("{DBName}",frmMain.MySettings.DBName), 1, null, DateTime.Now, "Migration"); ConfigFile cfg = new ConfigFile(); frmMain.Status = "Add AnnotationTypes"; diff --git a/PROMS/DataLoader/Procedures.cs b/PROMS/DataLoader/Procedures.cs index 8ff86def..5ae109f0 100644 --- a/PROMS/DataLoader/Procedures.cs +++ b/PROMS/DataLoader/Procedures.cs @@ -86,7 +86,6 @@ namespace DataLoader // check that file exists, i.e. if proc file doesn't exist but has entry in set // file, flag error, but continue. - //string fname = frmMain.tbSourceText +"\\"+ dr["entry"] + ".dbf"; string fname = pth + "\\" + dr["entry"] + ".dbf"; if (File.Exists(fname)) { @@ -381,7 +380,6 @@ namespace DataLoader } private void DbtOk(string fname, string pth) { - //string dbtname = frmMain.tbSourceText + "\\" + fname + ".dbt"; string dbtname = pth + "\\" + fname + ".dbt"; if (File.Exists(dbtname)) { diff --git a/PROMS/DataLoader/Properties/Settings.Designer.cs b/PROMS/DataLoader/Properties/Settings.Designer.cs index 5a4d8f15..564d3ec5 100644 --- a/PROMS/DataLoader/Properties/Settings.Designer.cs +++ b/PROMS/DataLoader/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4200 +// Runtime Version:2.0.50727.4216 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -118,5 +118,197 @@ namespace DataLoader.Properties { this["BackupFileName"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string BackupFolder { + get { + return ((string)(this["BackupFolder"])); + } + set { + this["BackupFolder"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True")] + public string ConnectionString { + get { + return ((string)(this["ConnectionString"])); + } + set { + this["ConnectionString"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("VEPROMS")] + public string DBName { + get { + return ((string)(this["DBName"])); + } + set { + this["DBName"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string DBPath { + get { + return ((string)(this["DBPath"])); + } + set { + this["DBPath"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string PDFFolder { + get { + return ((string)(this["PDFFolder"])); + } + set { + this["PDFFolder"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Unchecked")] + public global::System.Windows.Forms.CheckState CheckRTF { + get { + return ((global::System.Windows.Forms.CheckState)(this["CheckRTF"])); + } + set { + this["CheckRTF"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int Skip { + get { + return ((int)(this["Skip"])); + } + set { + this["Skip"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public int ConvertTo { + get { + return ((int)(this["ConvertTo"])); + } + set { + this["ConvertTo"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Checked")] + public global::System.Windows.Forms.CheckState RedPDFs { + get { + return ((global::System.Windows.Forms.CheckState)(this["RedPDFs"])); + } + set { + this["RedPDFs"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Checked")] + public global::System.Windows.Forms.CheckState OnlyThisSet { + get { + return ((global::System.Windows.Forms.CheckState)(this["OnlyThisSet"])); + } + set { + this["OnlyThisSet"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int ExecutionMode { + get { + return ((int)(this["ExecutionMode"])); + } + set { + this["ExecutionMode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Phase1")] + public string Phase1 { + get { + return ((string)(this["Phase1"])); + } + set { + this["Phase1"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Phase2")] + public string Phase2 { + get { + return ((string)(this["Phase2"])); + } + set { + this["Phase2"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Phase3")] + public string Phase3 { + get { + return ((string)(this["Phase3"])); + } + set { + this["Phase3"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\fmtall")] + public string FormatFolder { + get { + return ((string)(this["FormatFolder"])); + } + set { + this["FormatFolder"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("c:\\development\\genmacall")] + public string GenMacFolder { + get { + return ((string)(this["GenMacFolder"])); + } + set { + this["GenMacFolder"] = value; + } + } } } diff --git a/PROMS/DataLoader/Properties/Settings.settings b/PROMS/DataLoader/Properties/Settings.settings index 294fdcff..aa0e3e2c 100644 --- a/PROMS/DataLoader/Properties/Settings.settings +++ b/PROMS/DataLoader/Properties/Settings.settings @@ -26,5 +26,53 @@ + + + + + Data Source=.\SQLEXPRESS;Initial Catalog={DBName};Integrated Security=True + + + VEPROMS + + + + + + + + + Unchecked + + + 0 + + + 1 + + + Checked + + + Checked + + + 0 + + + Phase1 + + + Phase2 + + + Phase3 + + + c:\development\fmtall + + + c:\development\genmacall + \ No newline at end of file diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index ea8c0102..279a6e2a 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -636,12 +636,12 @@ namespace DataLoader switch (ex.Message) { case "Index file not found.":// then delete inf file - fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf"); + fi = new FileInfo(frmMain.MySettings.ProcedureSetPath + "\\" + FileName + ".inf"); fi.Delete(); LoadSection(ds, da, FileName);// Try Again break; case "External table is not in the expected format.": // then pad dbt file with 128 zeros. - fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt"); + fi = new FileInfo(frmMain.MySettings.ProcedureSetPath + "\\" + FileName + ".dbt"); FileStream fs = fi.OpenWrite(); fs.Position = fs.Length; byte[] buf = new byte[128];