-
Notifications
You must be signed in to change notification settings - Fork 0
/
modConnection.cs
83 lines (74 loc) · 1.74 KB
/
modConnection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Data.Common;
using UpgradeHelpers.DB.ADO;
namespace SKS
{
internal static class modConnection
{
private static DbConnection _CurrentConnection = null;
internal static DbConnection CurrentConnection
{
get
{
if (_CurrentConnection == null)
{
_CurrentConnection = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateConnection();
}
return _CurrentConnection;
}
set
{
_CurrentConnection = value;
}
}
private static ADORecordSetHelper _rs = null;
internal static ADORecordSetHelper rs
{
get
{
if (_rs == null)
{
_rs = new ADORecordSetHelper("");
}
return _rs;
}
set
{
_rs = value;
}
}
private static ADORecordSetHelper _rs2 = null;
internal static ADORecordSetHelper rs2
{
get
{
if (_rs2 == null)
{
_rs2 = new ADORecordSetHelper("");
}
return _rs2;
}
set
{
_rs2 = value;
}
}
internal static void OpenConnection()
{
CurrentConnection = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateConnection();
//UPGRADE_TODO: (7010) The connection string must be verified to fullfill the .NET data provider connection string requirements. More Information: https://www.mobilize.net/vbtonet/ewis/ewi7010
CurrentConnection.ConnectionString = modMain.ConnectionString;
CurrentConnection.Open();
}
internal static void ExecuteSql(string Statement)
{
rs = new ADORecordSetHelper("");
rs.Open(Statement, CurrentConnection, UpgradeHelpers.DB.LockTypeEnum.LockPessimistic);
}
internal static void ExecuteSql2(string Statement)
{
rs2 = new ADORecordSetHelper("");
rs2.Open(Statement, CurrentConnection, UpgradeHelpers.DB.LockTypeEnum.LockPessimistic);
}
}
}