diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index e8620969..dc4e5bb7 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -19,6 +19,7 @@ using Volian.Controls.Library; using DescriptiveEnum; using Volian.Base.Library; using Volian.Print.Library; + [assembly: log4net.Config.XmlConfigurator(Watch = true)] namespace VEPROMS @@ -224,7 +225,6 @@ namespace VEPROMS Volian.MSWord.WordDoc.KillWordApps(); // cleanup from previous run: Volian.Base.Library.TmpFile.RemoveAllTmps(); - if (VlnSettings.DebugMode) { //use local data (for development/debug mode) @@ -312,6 +312,8 @@ namespace VEPROMS displayBookMarks.SetupBookMarks(); DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek)); string c = Database.DBServer; + // D2017-260 - Use a prefix of the server name combined with the database name for temporary MSWord sections + DSOFile.TempFilePrefix = System.Text.RegularExpressions.Regex.Replace(System.Text.RegularExpressions.Regex.Replace(c, @"([^[\]]*) \[.*\]", "$1"), @"[\#\~\%\@\[\]\(\)\{\}\-. \\*<>:;""/?|]+", "_"); ChangeLogFileName("LogFileAppender", Database.ActiveDatabase + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt"); _MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>" , Application.ProductVersion,Database.RevDate, Environment.UserDomainName,Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt")); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index ba06ff2c..985eb247 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -465,6 +465,13 @@ namespace VEPROMS.CSLA.Library get { return _StartDTS; } set { _StartDTS = value; } } + //B2017-260 Prefix the Temporary document file with server name and database name + private static string _TempFilePrefix = ""; + public static string TempFilePrefix + { + get { return DSOFile._TempFilePrefix; } + set { DSOFile._TempFilePrefix = value; } + } private void CreateTemporaryFile() { _Unique = 0; @@ -472,7 +479,8 @@ namespace VEPROMS.CSLA.Library { if (_MyDocument != null) { - _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); + //B2017-260 Prefix the Temporary document file with server name and database name + _MyFile = new FileInfo(string.Format(@"{0}\{1}_tmp_{2}{3}{4}", VlnSettings.TemporaryFolder,TempFilePrefix, MyDocument.DocID, Unique, MyDocument.FileExtension)); FileInfo matchingFile = null; while (_MyFile.Exists) { @@ -501,7 +509,8 @@ namespace VEPROMS.CSLA.Library matchingFile = _MyFile; } } - _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); + //B2017-260 Prefix the Temporary document file with server name and database name + _MyFile = new FileInfo(string.Format(@"{0}\{1}_tmp_{2}{3}{4}", VlnSettings.TemporaryFolder, TempFilePrefix, MyDocument.DocID, Unique, MyDocument.FileExtension)); } // B2017-249 Recover Temporary File And AutoSave support for MSWord if (matchingFile != null)