B2017-260 - Add a prefix to the temporary MSWord section file names including the SQL server name and the database name.

This commit is contained in:
Rich
2017-11-20 19:53:54 +00:00
parent 7ef955a981
commit 7469b70b06
2 changed files with 14 additions and 3 deletions

View File

@@ -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)