|
@@ -792,22 +792,27 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
{
|
|
|
private SqlHelper dbHelper;
|
|
|
|
|
|
- public UserLibraryData(string libraryName)
|
|
|
+ public UserLibraryData(string libraryName,string resultpath)
|
|
|
{
|
|
|
NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
|
|
|
if (!libraryName.Contains(".db"))
|
|
|
{
|
|
|
libraryName += ".db";
|
|
|
}
|
|
|
- string fullPath = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + libraryName;
|
|
|
+ string fullPath = resultpath + libraryName;
|
|
|
+ string fullPath2 = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + libraryName;
|
|
|
if (System.IO.File.Exists(fullPath))
|
|
|
{
|
|
|
dbHelper = new SqlHelper("data source='" + fullPath + "'");
|
|
|
}
|
|
|
+ else if(System.IO.File.Exists(fullPath2))
|
|
|
+ {
|
|
|
+ dbHelper = new SqlHelper("data source='" + fullPath2 + "'");
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
dbHelper = null;
|
|
|
- log.Error("Failed to load user-defined library_"+ fullPath+"!");
|
|
|
+ log.Error("Failed to load user-defined library"+ "!");
|
|
|
}
|
|
|
}
|
|
|
|