-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTableColumnMeta.cs
More file actions
336 lines (256 loc) · 9.06 KB
/
TableColumnMeta.cs
File metadata and controls
336 lines (256 loc) · 9.06 KB
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
using ExpressBase.Common.Objects;
using ExpressBase.Common.Structures;
using ExpressBase.Objects;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
namespace ExpressBase.Common
{
public class TableColumnMeta
{
public string Name { get; set; }
public VendorDbType Type { get; set; }
public string Default { get; set; }
public bool Unique { get; set; }
public EbControl Control { get; set; }
public string Label { get; set; }
}
public class AuditTrailEntry
{
public string Name { get; set; }
public string NewVal { get; set; }
public string OldVal { get; set; }
public string DataRel { get; set; }
public string TableName { get; set; }
public AuditTrailEntry() { }
}
public class AuditTrailInsertData
{
public string RefId { get; set; }
public int TableRowId { get; set; }
public int Action { get; set; }
public List<AuditTrailEntry> Fields { get; set; }
public AuditTrailInsertData()
{
this.Fields = new List<AuditTrailEntry>();
}
}
public class SingleColumn
{
public string Name { get; set; }
public object Value { get; set; }
public int Type { get; set; }
[JsonIgnore]
public EbControl Control { get; set; }
//public Dictionary<int, string[]> D { get; set; }//Display members //original
public Dictionary<int, Dictionary<string, string>> D { get; set; }//Display members //duplicate
public Dictionary<string, List<object>> R { get; set; }//Rows of ps
public string ObjType { get; set; }//Object type
public string F { get; set; }//Formatted text for date, time etc
public string M { get; set; }//Meta
public SingleColumn() { }
}
public class SingleRow
{
public int RowId { get; set; }
public int LocId { get; set; }
public string pId { get; set; }//parent row id
public bool IsUpdate { get; set; }
public bool IsDelete { get; set; }
public List<SingleColumn> Columns { get; set; }
[JsonIgnore]
public KeyValuePair<string, SingleTable> LinesTable { get; set; }
public SingleRow()
{
Columns = new List<SingleColumn>();
}
public SingleColumn GetColumn(string cname)
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(cname))
{
return this.Columns[i];
}
}
return null;
}
public bool RemoveColumn(string cname)
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(cname))
{
this.Columns.RemoveAt(i);
return true;
}
}
return false;
}
public void SetColumn(string cname, SingleColumn column)
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(cname))
{
this.Columns[i] = column;
return;
}
}
throw new KeyNotFoundException("KeyNotFoundException : Key = " + cname);
}
public object this[string name]
{
get
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(name))
{
return this.Columns[i].Value;
}
}
return null;
}
set
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(name))
{
this.Columns[i].Value = value;
return;
}
}
throw new KeyNotFoundException("KeyNotFoundException : Key = " + name);
}
}
public void SetEbDbType(string name, EbDbTypes ebDbType)
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(name))
{
this.Columns[i].Type = (int)ebDbType;
return;
}
}
throw new KeyNotFoundException("KeyNotFoundException : Key = " + name);
}
public void SetControl(string name, EbControl control)
{
for (int i = 0; i < this.Columns.Count; i++)
{
if (this.Columns[i].Name.Equals(name))
{
this.Columns[i].Control = control;
return;
}
}
throw new KeyNotFoundException("KeyNotFoundException : Key = " + name);
}
}
public class SingleTable : List<SingleRow>
{
public string ParentTable { get; set; }
public string ParentRowId { get; set; }
}
public class WebformData
{
public Dictionary<string, SingleTable> MultipleTables { get; set; }
public Dictionary<string, SingleTable> ExtendedTables { get; set; }
public Dictionary<string, SingleRow> DGsRowDataModel { get; set; }
[JsonIgnore]
public Dictionary<string, SingleTable> PsDm_Tables { get; set; }
public Dictionary<string, bool> DisableDelete { get; set; }
public Dictionary<string, bool> DisableCancel { get; set; }
public Dictionary<string, bool> DisableEdit { get; set; }
public string MasterTable { get; set; }
public int FormVersionId { get; set; }
public bool IsLocked { get; set; }
public bool IsCancelled { get; set; }
public bool IsReadOnly { get; set; } //new
public string SrcRefId { get; set; }
public int SrcVerId { get; set; } //new
public int SrcDataId { get; set; }
public int CreatedBy { get; set; }
public string CreatedAt { get; set; }
public int ModifiedBy { get; set; }
public string ModifiedAt { get; set; }
public string CancelReason { get; set; }
public List<int> LocPermissions { get; set; }
public bool MultiLocViewAccess { get; set; }
public bool MultiLocEditAccess { get; set; }
public WebformDataInfo Info { get; set; }
public WebformData()
{
MultipleTables = new Dictionary<string, SingleTable>();
ExtendedTables = new Dictionary<string, SingleTable>();
DGsRowDataModel = new Dictionary<string, SingleRow>();
PsDm_Tables = new Dictionary<string, SingleTable>();
DisableDelete = new Dictionary<string, bool>();
DisableCancel = new Dictionary<string, bool>();
DisableEdit = new Dictionary<string, bool>();
LocPermissions = new List<int>();
}
}
public class WebformDataInfo
{
public string CreBy { get; set; }
public string CreAt { get; set; }
public string CreFrom { get; set; }
public string ModBy { get; set; }
public string ModAt { get; set; }
}
public class WebformDataWrapper
{
public WebformData FormData { get; set; }
public int Status { get; set; }
public string Message { get; set; }
public string MessageInt { get; set; }
public string StackTraceInt { get; set; }
}
public class WebFormSchema
{
public string FormName { set; get; }
public List<TableSchema> Tables { set; get; }
public string MasterTable { set; get; }
public List<EbControl> ExtendedControls { get; set; }
public WebFormSchema()
{
Tables = new List<TableSchema>();
ExtendedControls = new List<EbControl>();
}
}
public class TableSchema
{
public string TableName { set; get; }
public string ParentTable { get; set; }
public List<ColumnSchema> Columns { set; get; }
public WebFormTableTypes TableType { get; set; }
public string Title { get; set; }
public string ContainerName { get; set; }
public string CustomSelectQuery { get; set; }
public bool DescOdr { get; set; }//Descending order eb_row_num - datagrid
//public bool IsDynamic { get; set; }//datagird in dynamic tab
public bool DoNotPersist { get; set; }//DoNotPersist datagrid
public bool HideReviewedByRole { get; set; }//For review table
public TableSchema()
{
Columns = new List<ColumnSchema>();
}
}
public class ColumnSchema
{
public EbControl Control { get; set; }
public string ColumnName { set; get; }
public int EbDbType { set; get; }
}
public enum WebFormTableTypes
{
Normal,
Grid,
Review
}
}