-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCategoriesFrm.dfm
More file actions
464 lines (464 loc) · 10.1 KB
/
CategoriesFrm.dfm
File metadata and controls
464 lines (464 loc) · 10.1 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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
object CategoriesForm: TCategoriesForm
Left = 496
Top = 92
Width = 707
Height = 470
Caption = 'Categories'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnClose = FormClose
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 699
Height = 41
Align = alTop
TabOrder = 0
object DBNavigator1: TDBNavigator
Left = 8
Top = 8
Width = 240
Height = 25
DataSource = DataSourceCategories
TabOrder = 0
end
end
object DBGrid1: TDBGrid
Left = 0
Top = 41
Width = 265
Height = 402
Align = alLeft
DataSource = DataSourceCategories
TabOrder = 1
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'MS Sans Serif'
TitleFont.Style = []
end
object Panel2: TPanel
Left = 265
Top = 41
Width = 434
Height = 402
Align = alClient
TabOrder = 2
object Label1: TLabel
Left = 168
Top = 40
Width = 24
Height = 13
Caption = 'Type'
end
object Label2: TLabel
Left = 168
Top = 64
Width = 51
Height = 13
Caption = 'Min Count:'
end
object Label3: TLabel
Left = 168
Top = 88
Width = 54
Height = 13
Caption = 'Max. Count'
end
object ComboBoxCatVersion: TComboBox
Left = 8
Top = 8
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 0
OnChange = ComboBoxCatVersionChange
end
object StringGridAttributes: TStringGrid
Left = 8
Top = 40
Width = 145
Height = 353
Anchors = [akLeft, akTop, akBottom]
ColCount = 1
FixedCols = 0
FixedRows = 0
Options = [goVertLine, goHorzLine, goEditing]
TabOrder = 2
OnSelectCell = StringGridAttributesSelectCell
OnSetEditText = StringGridAttributesSetEditText
end
object CheckBoxRequired: TCheckBox
Left = 168
Top = 112
Width = 97
Height = 17
Caption = 'Required'
TabOrder = 6
OnClick = CheckBoxRequiredClick
end
object ButtonUp: TButton
Left = 168
Top = 136
Width = 75
Height = 25
Caption = 'Up'
TabOrder = 7
OnClick = ButtonUpClick
end
object ButtonDown: TButton
Left = 248
Top = 136
Width = 75
Height = 25
Caption = 'Down'
TabOrder = 8
OnClick = ButtonDownClick
end
object ButtonNew: TButton
Left = 168
Top = 168
Width = 75
Height = 25
Caption = 'New'
TabOrder = 9
OnClick = ButtonNewClick
end
object ButtonRemove: TButton
Left = 248
Top = 168
Width = 75
Height = 25
Caption = 'Remove'
TabOrder = 10
OnClick = ButtonRemoveClick
end
object ButtonSave: TButton
Left = 168
Top = 200
Width = 75
Height = 25
Caption = 'Save'
TabOrder = 11
OnClick = ButtonSaveClick
end
object ComboBoxType: TComboBox
Left = 248
Top = 40
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 3
OnChange = ComboBoxTypeChange
Items.Strings = (
'String'
'Date'
'Time'
'Number'
'Integer')
end
object EditMinCount: TEdit
Left = 248
Top = 64
Width = 145
Height = 21
TabOrder = 4
OnChange = EditMinCountChange
end
object EditMaxCount: TEdit
Left = 248
Top = 88
Width = 145
Height = 21
TabOrder = 5
OnChange = EditMaxCountChange
end
object ButtonPurgeVersions: TButton
Left = 160
Top = 8
Width = 89
Height = 25
Caption = 'Purge Versions'
TabOrder = 1
OnClick = ButtonPurgeVersionsClick
end
end
object TableCategories: TTable
AfterInsert = TableCategoriesAfterInsert
BeforeDelete = TableCategoriesBeforeDelete
BeforeScroll = TableCategoriesBeforeScroll
AfterScroll = TableCategoriesAfterScroll
DatabaseName = 'docManDB'
IndexName = 'CAT_NAME_IDX'
TableName = 'CATEGORIES'
Left = 40
Top = 160
object TableCategoriesID: TIntegerField
FieldName = 'ID'
Required = True
Visible = False
end
object TableCategoriesNAME: TStringField
DisplayLabel = 'Name'
FieldName = 'NAME'
Required = True
Size = 255
end
object TableCategoriesMAX_ATTR_ID: TIntegerField
FieldName = 'MAX_ATTR_ID'
Required = True
Visible = False
end
end
object DataSourceCategories: TDataSource
DataSet = TableCategories
Left = 56
Top = 96
end
object QuerySaveAttributes: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'insert into C_ATTR_DEFS'
'('
#9'ID,'
#9'CATEGORY_ID, CATEGORY_VERSION,'
#9'ATTR_ID,'
#9'NAME, TYPE, ORDER_NR,'
#9'REQUIRED,'
#9'MIN_COUNT, MAX_COUNT'
')'
'values'
'('
#9':ID,'
#9':CATEGORY_ID, :CATEGORY_VERSION,'
#9':ATTR_ID,'
#9':NAME, :TYPE, :ORDER_NR,'
#9':REQUIRED,'
#9':MIN_COUNT, :MAX_COUNT'
')'
' '
' ')
Left = 48
Top = 368
ParamData = <
item
DataType = ftUnknown
Name = 'ID'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'CATEGORY_ID'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'CATEGORY_VERSION'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'ATTR_ID'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'NAME'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'TYPE'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'ORDER_NR'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'REQUIRED'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'MIN_COUNT'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'MAX_COUNT'
ParamType = ptUnknown
end>
end
object QueryDeleteAttributes: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'delete from C_ATTR_DEFS d'
'where CATEGORY_ID = :theCategory '
' ')
Left = 80
Top = 288
ParamData = <
item
DataType = ftInteger
Name = 'theCategory'
ParamType = ptInput
end>
end
object QueryPurgeAttributes: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'delete from C_ATTR_DEFS d'
'where CATEGORY_ID = :theCategory'
'and not exists'
'('
#9'select * from C_ATTR_VALUES v'
#9'where v.ATTR_ID = d.ID'
')'
'and d.category_version != :theVersion'
' '
' '
' ')
Left = 176
Top = 280
ParamData = <
item
DataType = ftInteger
Name = 'theCategory'
ParamType = ptInput
end
item
DataType = ftInteger
Name = 'theVersion'
ParamType = ptInput
end>
end
object QueryCatVersions: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'select distinct CATEGORY_VERSION'
'from C_ATTR_DEFS'
'where CATEGORY_ID = :theCategory'
'order by CATEGORY_VERSION desc')
Left = 40
Top = 232
ParamData = <
item
DataType = ftInteger
Name = 'theCategory'
ParamType = ptInput
end>
object QueryCatVersionsCATEGORY_VERSION: TIntegerField
FieldName = 'CATEGORY_VERSION'
Origin = 'DOCMANDB."C_ATTR_DEFS.DB".CATEGORY_VERSION'
end
end
object QueryItems: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'select distinct ID'
'from ITEM_TREE it'
'where exists'
'('
#9'select *'
#9'from C_ATTR_DEFS cd, C_ATTR_VALUES cv'
#9'where cv.ATTR_ID = cd.ID'
#9'and it.ID = cv.ITEM_ID'
#9'and cd.category_version <> :theVersion1'
')'
'and not exists'
'('
#9'select *'
#9'from C_ATTR_DEFS cd, C_ATTR_VALUES cv'
#9'where cv.ATTR_ID = cd.ID'
#9'and it.ID = cv.ITEM_ID'
#9'and cd.category_version = :theVersion2'
')'
' '
' ')
Left = 193
Top = 169
ParamData = <
item
DataType = ftInteger
Name = 'theVersion1'
ParamType = ptInput
end
item
DataType = ftInteger
Name = 'theVersion2'
ParamType = ptInput
end>
object QueryItemsID: TIntegerField
FieldName = 'ID'
end
end
object QueryCountUpgradeItems: TQuery
DatabaseName = 'docManDB'
SQL.Strings = (
'select count(*) as COUNTER'
'from ITEM_TREE it'
'where exists'
'('
#9'select *'
#9'from C_ATTR_DEFS cd, C_ATTR_VALUES cv'
#9'where cv.ATTR_ID = cd.ID'
#9'and it.ID = cv.ITEM_ID'
#9'and cd.CATEGORY_VERSION <> :theVersion1'
#9'and cd.CATEGORY_ID = :theCatId1'
')'
'and not exists'
'('
#9'select *'
#9'from C_ATTR_DEFS cd, C_ATTR_VALUES cv'
#9'where cv.ATTR_ID = cd.ID'
#9'and it.ID = cv.ITEM_ID'
#9'and cd.CATEGORY_VERSION = :theVersion2'
#9'and cd.CATEGORY_ID = :theCatId2'
')'
' '
' '
' '
' '
' ')
Left = 201
Top = 105
ParamData = <
item
DataType = ftInteger
Name = 'theVersion1'
ParamType = ptInput
end
item
DataType = ftInteger
Name = 'theCatId1'
ParamType = ptInput
end
item
DataType = ftInteger
Name = 'theVersion2'
ParamType = ptInput
end
item
DataType = ftInteger
Name = 'theCatId2'
ParamType = ptInput
end>
object QueryCountUpgradeItemsCOUNTER: TIntegerField
FieldName = 'COUNTER'
end
end
end