Skip to content

Commit fbe5ca5

Browse files
committed
Switched DataAccess project to NuGet package
1 parent ccb7d89 commit fbe5ca5

21 files changed

+335
-173
lines changed

T4SQLTemplateLibrary/EngineServiceSetup/EngineServiceSetup.vdproj

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,36 @@
4545
}
4646
"Entry"
4747
{
48-
"MsmKey" = "8:_D3826FC20BA01AEFEAFB7FB084915301"
48+
"MsmKey" = "8:_C5DD5469CB657002B2003A18DE846FE8"
4949
"OwnerKey" = "8:_EB6FDD64509844DC91FE40DDDE0D3A7E"
5050
"MsmSig" = "8:_UNDEFINED"
5151
}
5252
"Entry"
5353
{
54-
"MsmKey" = "8:_D3826FC20BA01AEFEAFB7FB084915301"
54+
"MsmKey" = "8:_C5DD5469CB657002B2003A18DE846FE8"
5555
"OwnerKey" = "8:_926173DE0E60FFBF61B20B0AC615E010"
5656
"MsmSig" = "8:_UNDEFINED"
5757
}
5858
"Entry"
5959
{
60+
"MsmKey" = "8:_DFDE8E36EFAEE5625005F055DED6A94E"
61+
"OwnerKey" = "8:_EB6FDD64509844DC91FE40DDDE0D3A7E"
62+
"MsmSig" = "8:_UNDEFINED"
63+
}
64+
"Entry"
65+
{
66+
"MsmKey" = "8:_DFDE8E36EFAEE5625005F055DED6A94E"
67+
"OwnerKey" = "8:_2D3C74C050CBB50EAF56FCF7F4DAFD46"
68+
"MsmSig" = "8:_UNDEFINED"
69+
}
70+
"Entry"
71+
{
72+
"MsmKey" = "8:_DFDE8E36EFAEE5625005F055DED6A94E"
73+
"OwnerKey" = "8:_902F5F7E5FEB245B63F3C7253BBB96F8"
74+
"MsmSig" = "8:_UNDEFINED"
75+
}
76+
"Entry"
77+
{
6078
"MsmKey" = "8:_EB6FDD64509844DC91FE40DDDE0D3A7E"
6179
"OwnerKey" = "8:_UNDEFINED"
6280
"MsmSig" = "8:_UNDEFINED"
@@ -70,6 +88,12 @@
7088
"Entry"
7189
{
7290
"MsmKey" = "8:_UNDEFINED"
91+
"OwnerKey" = "8:_C5DD5469CB657002B2003A18DE846FE8"
92+
"MsmSig" = "8:_UNDEFINED"
93+
}
94+
"Entry"
95+
{
96+
"MsmKey" = "8:_UNDEFINED"
7397
"OwnerKey" = "8:_902F5F7E5FEB245B63F3C7253BBB96F8"
7498
"MsmSig" = "8:_UNDEFINED"
7599
}
@@ -82,13 +106,13 @@
82106
"Entry"
83107
{
84108
"MsmKey" = "8:_UNDEFINED"
85-
"OwnerKey" = "8:_926173DE0E60FFBF61B20B0AC615E010"
109+
"OwnerKey" = "8:_DFDE8E36EFAEE5625005F055DED6A94E"
86110
"MsmSig" = "8:_UNDEFINED"
87111
}
88112
"Entry"
89113
{
90114
"MsmKey" = "8:_UNDEFINED"
91-
"OwnerKey" = "8:_D3826FC20BA01AEFEAFB7FB084915301"
115+
"OwnerKey" = "8:_926173DE0E60FFBF61B20B0AC615E010"
92116
"MsmSig" = "8:_UNDEFINED"
93117
}
94118
}
@@ -290,7 +314,7 @@
290314
{
291315
"AssemblyRegister" = "3:1"
292316
"AssemblyIsInGAC" = "11:FALSE"
293-
"AssemblyAsmDisplayName" = "8:DbParallel.DataAccess, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"
317+
"AssemblyAsmDisplayName" = "8:DbParallel.DataAccess, Version=1.0.0.4, Culture=neutral, processorArchitecture=MSIL"
294318
"ScatterAssemblies"
295319
{
296320
"_926173DE0E60FFBF61B20B0AC615E010"
@@ -317,20 +341,20 @@
317341
"IsDependency" = "11:TRUE"
318342
"IsolateTo" = "8:"
319343
}
320-
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_D3826FC20BA01AEFEAFB7FB084915301"
344+
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C5DD5469CB657002B2003A18DE846FE8"
321345
{
322346
"AssemblyRegister" = "3:1"
323-
"AssemblyIsInGAC" = "11:FALSE"
324-
"AssemblyAsmDisplayName" = "8:DDTek.Oracle, Version=3.5.0.0, Culture=neutral, PublicKeyToken=c84cd5c63851e072, processorArchitecture=MSIL"
347+
"AssemblyIsInGAC" = "11:TRUE"
348+
"AssemblyAsmDisplayName" = "8:Oracle.DataAccess, Version=4.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86"
325349
"ScatterAssemblies"
326350
{
327-
"_D3826FC20BA01AEFEAFB7FB084915301"
351+
"_C5DD5469CB657002B2003A18DE846FE8"
328352
{
329-
"Name" = "8:DDTek.Oracle.dll"
353+
"Name" = "8:Oracle.DataAccess.dll"
330354
"Attributes" = "3:512"
331355
}
332356
}
333-
"SourcePath" = "8:DDTek.Oracle.dll"
357+
"SourcePath" = "8:Oracle.DataAccess.dll"
334358
"TargetName" = "8:"
335359
"Tag" = "8:"
336360
"Folder" = "8:_485FEF67C2D245DCAB253E8281A1B913"
@@ -348,6 +372,37 @@
348372
"IsDependency" = "11:TRUE"
349373
"IsolateTo" = "8:"
350374
}
375+
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DFDE8E36EFAEE5625005F055DED6A94E"
376+
{
377+
"AssemblyRegister" = "3:1"
378+
"AssemblyIsInGAC" = "11:FALSE"
379+
"AssemblyAsmDisplayName" = "8:T4SQL.Base, Version=1.0.0.1, Culture=neutral, PublicKeyToken=e64a73ddc9c094f9, processorArchitecture=MSIL"
380+
"ScatterAssemblies"
381+
{
382+
"_DFDE8E36EFAEE5625005F055DED6A94E"
383+
{
384+
"Name" = "8:T4SQL.Base.dll"
385+
"Attributes" = "3:512"
386+
}
387+
}
388+
"SourcePath" = "8:T4SQL.Base.dll"
389+
"TargetName" = "8:"
390+
"Tag" = "8:"
391+
"Folder" = "8:_485FEF67C2D245DCAB253E8281A1B913"
392+
"Condition" = "8:"
393+
"Transitive" = "11:FALSE"
394+
"Vital" = "11:TRUE"
395+
"ReadOnly" = "11:FALSE"
396+
"Hidden" = "11:FALSE"
397+
"System" = "11:FALSE"
398+
"Permanent" = "11:FALSE"
399+
"SharedLegacy" = "11:FALSE"
400+
"PackageAs" = "3:1"
401+
"Register" = "3:1"
402+
"Exclude" = "11:FALSE"
403+
"IsDependency" = "11:TRUE"
404+
"IsolateTo" = "8:"
405+
}
351406
}
352407
"FileType"
353408
{
@@ -416,7 +471,7 @@
416471
"Name" = "8:Microsoft Visual Studio"
417472
"ProductName" = "8:T4SQL Template Library Engine"
418473
"ProductCode" = "8:{60288E41-28EF-4CDD-BADF-4BF3BEE645FF}"
419-
"PackageCode" = "8:{633C7814-FD32-495F-BAED-20D822FD5B91}"
474+
"PackageCode" = "8:{184CFE6E-CD1A-4E58-A504-D694A02CE08D}"
420475
"UpgradeCode" = "8:{DF052A72-00BB-4271-A6D5-12FA73E8647D}"
421476
"AspNetVersion" = "8:4.0.30319.0"
422477
"RestartWWWService" = "11:FALSE"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System.Data.Common;
2+
using System.Configuration;
3+
4+
namespace T4SQL.SqlBuilder.DataAccess
5+
{
6+
public static partial class ConfigHelper
7+
{
8+
private static int _EnginePollInterval;
9+
internal static int EnginePollInterval // milliseconds
10+
{
11+
get { return _EnginePollInterval; }
12+
set { _EnginePollInterval = value; }
13+
}
14+
15+
static partial void ConfigInit()
16+
{
17+
_ConnectionSettingKey = "T4SQLDB";
18+
_PackageSettingKey = "Engine_Package";
19+
}
20+
}
21+
}
22+
23+
////////////////////////////////////////////////////////////////////////////////////////////////////
24+
//
25+
// Copyright 2013 Abel Cheng
26+
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
27+
// See http://www.apache.org/licenses/LICENSE-2.0.
28+
// All other rights reserved.
29+
// You must not remove this notice, or any other, from this software.
30+
//
31+
// Original Author: Abel Cheng <[email protected]>
32+
// Created Date: ‎March ‎21, ‎2013, ‏‎10:57:36 PM
33+
// Primary Host: http://t4sql.codeplex.com
34+
// Change Log:
35+
// Author Date Comment
36+
//
37+
//
38+
//
39+
//
40+
// (Keep code clean rather than complicated code plus long comments.)
41+
//
42+
////////////////////////////////////////////////////////////////////////////////////////////////////
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System.Data.Common;
2+
using System.Configuration;
3+
4+
namespace T4SQL.SqlBuilder.DataAccess
5+
{
6+
public static partial class ConfigHelper
7+
{
8+
private static string _ConnectionSettingKey = "T4SQLDB";
9+
private static string _PackageSettingKey = "Engine_Package";
10+
11+
#region Properties
12+
private static DbProviderFactory _DbProviderFactory;
13+
public static DbProviderFactory DbProviderFactory
14+
{
15+
get { return _DbProviderFactory; }
16+
}
17+
18+
private static string _ConnectionString;
19+
public static string ConnectionString
20+
{
21+
get { return _ConnectionString; }
22+
}
23+
24+
private static string _DatabasePackage;
25+
public static string DatabasePackage
26+
{
27+
get { return _DatabasePackage; }
28+
}
29+
#endregion
30+
31+
static ConfigHelper()
32+
{
33+
ConfigInit();
34+
35+
#region Default Initialization
36+
ConnectionStringSettings connSetting = ConfigurationManager.ConnectionStrings[_ConnectionSettingKey];
37+
_DbProviderFactory = DbProviderFactories.GetFactory(connSetting.ProviderName);
38+
_ConnectionString = connSetting.ConnectionString;
39+
40+
_DatabasePackage = ConfigurationManager.AppSettings[_PackageSettingKey];
41+
if (_DatabasePackage == null)
42+
_DatabasePackage = string.Empty;
43+
#endregion
44+
}
45+
46+
static partial void ConfigInit();
47+
}
48+
}

T4SQLTemplateLibrary/SqlBuilder/DbPackage.cs renamed to T4SQLTemplateLibrary/SqlBuilder/DataAccess/DbPackage.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,10 @@
66
using DbParallel.DataAccess;
77
using T4SQL.MetaData;
88

9-
namespace T4SQL.SqlBuilder
9+
namespace T4SQL.SqlBuilder.DataAccess
1010
{
11-
internal static class DbPackage
11+
public static partial class DbPackage
1212
{
13-
public static DbAccess CreateConnection()
14-
{
15-
return new DbAccess(EngineConfig.DbProviderFactory, EngineConfig.ConnectionString);
16-
}
17-
18-
private static string GetProcedure(string sp)
19-
{
20-
return EngineConfig.DatabasePackage + sp;
21-
}
22-
2313
public static DbmsEnvironment GetDbServerEnv(this DbAccess dbAccess)
2414
{
2515
const string sp = "GET_DB_SERVER_ENV";
@@ -52,7 +42,7 @@ public static void LoadEngineConfig(this DbAccess dbAccess)
5242
outPollInterval = parameters.AddOutput("outPoll_Interval").SetDbType(DbType.Byte);
5343
});
5444

55-
EngineConfig.EnginePollInterval = outPollInterval.Parameter<byte>() * 1000;
45+
ConfigHelper.EnginePollInterval = outPollInterval.Parameter<byte>() * 1000;
5646
}
5747

5848
private static EngineMain.ServiceMode Ping(DbAccess dbAccess, string sp)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Data;
3+
using System.Data.Common;
4+
using System.Collections.Generic;
5+
using DbParallel.DataAccess;
6+
7+
namespace T4SQL.SqlBuilder.DataAccess
8+
{
9+
public static partial class DbPackage
10+
{
11+
#region Initialization
12+
static DbPackage()
13+
{
14+
// DbAccess.DefaultCommandType = CommandType.StoredProcedure;
15+
}
16+
17+
public static DbAccess CreateConnection()
18+
{
19+
return new DbAccess(ConfigHelper.DbProviderFactory, ConfigHelper.ConnectionString);
20+
}
21+
22+
private static string GetProcedure(string sp)
23+
{
24+
return ConfigHelper.DatabasePackage + sp;
25+
}
26+
#endregion
27+
}
28+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#if DEBUG
2+
using System;
3+
using DbParallel.DataAccess;
4+
using T4SQL.SqlBuilder.DataAccess;
5+
#endif

T4SQLTemplateLibrary/SqlBuilder/EngineConfig.cs

Lines changed: 0 additions & 68 deletions
This file was deleted.

T4SQLTemplateLibrary/SqlBuilder/EngineMain.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Diagnostics;
66
using System.Collections.Generic;
77
using DbParallel.DataAccess;
8+
using T4SQL.SqlBuilder.DataAccess;
89

910
namespace T4SQL.SqlBuilder
1011
{
@@ -86,7 +87,7 @@ public void Start()
8687
LogEvent(e.Message, EventLogEntryType.Error, e.Source);
8788
}
8889

89-
Thread.Sleep(EngineConfig.EnginePollInterval);
90+
Thread.Sleep(ConfigHelper.EnginePollInterval);
9091
}
9192
});
9293
}

0 commit comments

Comments
 (0)