forked from cyq1162/cyqdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAopPara.cs
337 lines (322 loc) · 8.58 KB
/
AopPara.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
using System;
using System.Collections.Generic;
using System.Text;
using CYQ.Data.Table;
using System.Data.Common;
using System.Data;
namespace CYQ.Data.Aop
{
/// <summary>
/// Aop参数信息
/// </summary>
public partial class AopInfo
{
// internal bool IsCustomAop = false;
private string _TableName;
/// <summary>
/// 表名
/// </summary>
public string TableName
{
get { return _TableName; }
set { _TableName = value; }
}
//private bool _IsView;
///// <summary>
///// 是否视图(或视图语句)
///// </summary>
//public bool IsView
//{
// get { return _IsView; }
// set { _IsView = value; }
//}
private DalType _DalType = DalType.None;
/// <summary>
/// 数据类型
/// </summary>
public DalType DalType
{
get
{
if (_DalType == DalType.None)
{
if (MAction != null)
{
_DalType = MAction.DalType;
}
else if (MProc != null)
{
_DalType = MProc.DalType;
}
}
return _DalType;
}
set { _DalType = value; }
}
private string _DataBase;
/// <summary>
/// 数据库名称
/// </summary>
public string DataBase
{
get {
if (string.IsNullOrEmpty(_DataBase))
{
if (MAction != null)
{
_DataBase = MAction.dalHelper.DataBase;
}
else if (MProc != null)
{
_DataBase = MProc.dalHelper.DataBase;
}
}
return _DataBase;
}
set { _DataBase = value; }
}
private object _AopPara;
/// <summary>
/// AOP的自定义参数
/// </summary>
public object AopPara
{
get { return _AopPara; }
set { _AopPara = value; }
}
private bool _IsTransaction;
/// <summary>
/// 是否事务中
/// </summary>
public bool IsTransaction
{
get { return _IsTransaction; }
set { _IsTransaction = value; }
}
}
public partial class AopInfo
{
private MAction _MAction;
/// <summary>
/// 当前上下文的处理程序。
/// </summary>
public MAction MAction
{
get { return _MAction; }
set { _MAction = value; }
}
private List<MDataTable> _TableList;
/// <summary>
/// 数据列表
/// </summary>
public List<MDataTable> TableList
{
get { return _TableList; }
set { _TableList = value; }
}
private MDataTable _Table;
/// <summary>
/// 数据表
/// </summary>
public MDataTable Table
{
get { return _Table; }
set { _Table = value; }
}
private MDataRow _Row;
/// <summary>
/// 数据行
/// </summary>
public MDataRow Row
{
get { return _Row; }
set { _Row = value; }
}
private object _Where;
/// <summary>
/// 查询条件
/// </summary>
public object Where
{
get { return _Where; }
set { _Where = value; }
}
private bool _AutoSetValue;
/// <summary>
/// 自动从Form表单提取值[插入或更新时使用]
/// </summary>
public bool AutoSetValue
{
get { return _AutoSetValue; }
set { _AutoSetValue = value; }
}
private InsertOp _InsertOp;
/// <summary>
/// 数据插入选项
/// </summary>
public InsertOp InsertOp
{
get { return _InsertOp; }
set { _InsertOp = value; }
}
private int _PageIndex;
/// <summary>
/// 分页起始页
/// </summary>
public int PageIndex
{
get { return _PageIndex; }
set { _PageIndex = value; }
}
private int _PageSize;
/// <summary>
/// 分页每页条数
/// </summary>
public int PageSize
{
get { return _PageSize; }
set { _PageSize = value; }
}
private string _UpdateExpression;
/// <summary>
/// 更新操作的附加表达式。
/// </summary>
public string UpdateExpression
{
get
{
return _UpdateExpression;
}
set
{
_UpdateExpression = value;
}
}
private object[] _SelectColumns;
/// <summary>
/// 指定的查询列
/// </summary>
public object[] SelectColumns
{
get { return _SelectColumns; }
set { _SelectColumns = value; }
}
private bool _IsSuccess;
/// <summary>
/// Begin方法是否调用成功[在End中使用]
/// </summary>
public bool IsSuccess
{
get { return _IsSuccess; }
set { _IsSuccess = value; }
}
private int _RowCount;
/// <summary>
/// 查询时返回的记录总数或ExeNonQuery的返回值
/// </summary>
public int RowCount
{
get { return _RowCount; }
set { _RowCount = value; }
}
private List<AopCustomDbPara> _CustomDbPara;
/// <summary>
/// 用户调用SetPara新增加的自定义参数
/// </summary>
public List<AopCustomDbPara> CustomDbPara
{
get { return _CustomDbPara; }
set { _CustomDbPara = value; }
}
}
public partial class AopInfo
{
private MProc _MProc;
/// <summary>
/// 当前上下文的处理程序。
/// </summary>
public MProc MProc
{
get { return _MProc; }
set { _MProc = value; }
}
private string _ProcName;
/// <summary>
/// 存储过程名或SQL语句
/// </summary>
public string ProcName
{
get { return _ProcName; }
set { _ProcName = value; }
}
private bool _IsProc;
/// <summary>
/// 是否存储过程
/// </summary>
public bool IsProc
{
get { return _IsProc; }
set { _IsProc = value; }
}
private DbParameterCollection _DbParameters;
/// <summary>
/// 命令参数
/// </summary>
public DbParameterCollection DBParameters
{
get { return _DbParameters; }
set { _DbParameters = value; }
}
private object _ExeResult;
/// <summary>
/// 执行后返回的结果
/// </summary>
public object ExeResult
{
get { return _ExeResult; }
set { _ExeResult = value; }
}
}
/// <summary>
/// 设置自定义参数[使用MAction时,对Where条件进行的参数化传参使用]
/// </summary>
public class AopCustomDbPara
{
private object _ParaName;
/// <summary>
/// 参数名称
/// </summary>
public object ParaName
{
get { return _ParaName; }
set { _ParaName = value; }
}
private object _Value;
/// <summary>
/// 参数值
/// </summary>
public object Value
{
get { return _Value; }
set { _Value = value; }
}
private DbType _DbType;
/// <summary>
/// 参数类型
/// </summary>
public DbType ParaDbType
{
get { return _DbType; }
set { _DbType = value; }
}
//private bool _IsSysPara;
///// <summary>
///// 是否系统内部产生的参数
///// </summary>
//internal bool IsSysPara
//{
// get { return _IsSysPara; }
// set { _IsSysPara = value; }
//}
}
}