From ddacbd431f781ecf96e6f6d542aca94b08a25e4a Mon Sep 17 00:00:00 2001 From: John Date: Fri, 24 Sep 2010 12:29:58 +0000 Subject: [PATCH] --- PROMS/DataLoader/App.config | 3 ++- PROMS/DataLoader/Loader.cs | 21 ++++++++++++++------- PROMS/DataLoader/TextConvert.cs | 12 ++++++++---- PROMS/DataLoader/TransitionFixer.cs | 7 ++++--- PROMS/DataLoader/frmLoader.cs | 26 +++++++++++++++++--------- 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/PROMS/DataLoader/App.config b/PROMS/DataLoader/App.config index 490f74b0..246ca802 100644 --- a/PROMS/DataLoader/App.config +++ b/PROMS/DataLoader/App.config @@ -58,7 +58,8 @@ - + + diff --git a/PROMS/DataLoader/Loader.cs b/PROMS/DataLoader/Loader.cs index 39ef3f0b..5d9b6e32 100644 --- a/PROMS/DataLoader/Loader.cs +++ b/PROMS/DataLoader/Loader.cs @@ -15,6 +15,7 @@ using vlnObjectLibrary; using vlnServerLibrary; using VEPROMS.CSLA.Library; using Config; +using Volian.Base.Library; namespace DataLoader { @@ -80,13 +81,19 @@ namespace DataLoader { try { -#if DEBUG - _FmtAllPath = @"c:\development\fmtall"; - _GenmacAllPath = @"c:\development\genmacall"; -#else - _FmtAllPath = vepromspath + @"\fmtall"; - _GenmacAllPath = vepromspath + @"\genmacall"; -#endif +//#if DEBUG + if (VlnSettings.DebugMode) + { + _FmtAllPath = @"c:\development\fmtall"; + _GenmacAllPath = @"c:\development\genmacall"; + } +//#else + else + { + _FmtAllPath = vepromspath + @"\fmtall"; + _GenmacAllPath = vepromspath + @"\genmacall"; + } +//#endif frmMain.Status = "Make Connection"; // make the initial database connection record, annotation types & top // system folder. diff --git a/PROMS/DataLoader/TextConvert.cs b/PROMS/DataLoader/TextConvert.cs index d6e51304..e068d310 100644 --- a/PROMS/DataLoader/TextConvert.cs +++ b/PROMS/DataLoader/TextConvert.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; +using Volian.Base.Library; namespace DataLoader { @@ -177,10 +178,13 @@ namespace DataLoader // Convert dash to a non-breaking dash. This is a unicode character. // This character will be used in veproms rather than a dash. //if the dash is preceeded byte a token remove the space following the token -#if DEBUG - if (s2.Contains(@"\super ")) - Console.WriteLine("RTF Super token"); -#endif +//#if DEBUG + if (VlnSettings.DebugMode) + { + if (s2.Contains(@"\super ")) + Console.WriteLine("RTF Super token"); + } +//#endif s2 = Regex.Replace(s2, @"(\\[^ \\?]*) \-", @"$1\u8209?"); s2 = s2.Replace("-", @"\u8209?"); //Remove spaces between comment end nad Next token diff --git a/PROMS/DataLoader/TransitionFixer.cs b/PROMS/DataLoader/TransitionFixer.cs index a56c3d8a..bbed67b7 100644 --- a/PROMS/DataLoader/TransitionFixer.cs +++ b/PROMS/DataLoader/TransitionFixer.cs @@ -4,6 +4,7 @@ using System.Text; using Volian.Controls.Library; using VEPROMS.CSLA.Library; using System.Text.RegularExpressions; +using Volian.Base.Library; namespace DataLoader { @@ -105,12 +106,12 @@ namespace DataLoader if (updatedText != afterText)//|| newStripped != afterText) myProblems.RTBProblems.Add(item.ItemID, item.MyContent.ContentID, originalText, updatedText, MyStepRTB.Rtf, afterText, item.Path); } -#if DEBUG - else +//#if DEBUG + else if (VlnSettings.DebugMode) { Console.WriteLine("here"); } -#endif +//#endif } Status = "Saving problems"; ErrorCount = myProblems.RTBProblems.Count; diff --git a/PROMS/DataLoader/frmLoader.cs b/PROMS/DataLoader/frmLoader.cs index a18e539f..7f0d9b6d 100644 --- a/PROMS/DataLoader/frmLoader.cs +++ b/PROMS/DataLoader/frmLoader.cs @@ -10,6 +10,7 @@ using System; using System.Drawing; using System.Collections; +using System.Configuration; using System.ComponentModel; using System.Windows.Forms; using System.Data; @@ -105,6 +106,8 @@ namespace DataLoader public frmLoader() { + string debugMode = ConfigurationManager.AppSettings["Debug"]; + VlnSettings.DebugMode = bool.Parse(debugMode); // set debug for the Volian.Controls.Library ldr = new Loader(_MyLog, this); InitializeComponent(); MSWordToPDF.FormForPlotGraphics = this; @@ -137,13 +140,15 @@ namespace DataLoader //tbSource.Text = @"G:\PromsDat\VEHP1B\SAMGS.PRC";// South Texas STPNOC break; default: -#if (!DEBUG) - tbSource.Text = ""; break; -#else - throw new Exception("Not configured for " + SystemInformation.ComputerName); -#endif } +//#if (!DEBUG) + if (!VlnSettings.DebugMode) + tbSource.Text = ""; + else +//#else + throw new Exception("Not configured for " + SystemInformation.ComputerName); +//#endif } private void btnConvertSelected_Click(object sender, EventArgs e) { @@ -234,10 +239,13 @@ namespace DataLoader private void btnConvert_Click(object sender, System.EventArgs e) { if (!CheckLogPath()) return; -#if (!DEBUG) - DialogResult dlgrst = MessageBox.Show("The VE-PROMS data currently in SQL Server (Express) will be deleted.\r\n\nProceed with Data Conversion?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - if (dlgrst == DialogResult.No) return; -#endif +//#if (!DEBUG) + if (!VlnSettings.DebugMode) + { + DialogResult dlgrst = MessageBox.Show("The VE-PROMS data currently in SQL Server (Express) will be deleted.\r\n\nProceed with Data Conversion?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + if (dlgrst == DialogResult.No) return; + } +//#endif try { //TextConvert.ResetSpecialCharacters();