-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIM_TempLocal.vb
More file actions
476 lines (408 loc) · 13.2 KB
/
Copy pathIM_TempLocal.vb
File metadata and controls
476 lines (408 loc) · 13.2 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
465
466
467
468
469
470
471
472
473
474
475
476
Imports Npgsql
Public Class IM_TempLocal
Private mID_Local As Integer
Public Property ID_TempLocal() As Integer
Get
Return mID_Local
End Get
Set(ByVal value As Integer)
mID_Local = value
End Set
End Property
Private mDepartement As String
Public Property Departement() As String
Get
Return mDepartement
End Get
Set(ByVal value As String)
mDepartement = value
End Set
End Property
Private mInsee As String
Public Property Insee() As String
Get
Return mInsee
End Get
Set(ByVal value As String)
mInsee = value
End Set
End Property
Private mInvariant As String
Public Property Invariant() As String
Get
Return mInvariant
End Get
Set(ByVal value As String)
mInvariant = value
End Set
End Property
Private mPrefSection As String
Public Property PrefSection() As String
Get
Return mPrefSection
End Get
Set(ByVal value As String)
mPrefSection = value
End Set
End Property
Private mSection As String
Public Property Section() As String
Get
Return mSection
End Get
Set(ByVal value As String)
mSection = value
End Set
End Property
Private mPlan As String
Public Property Plan() As String
Get
Return mPlan
End Get
Set(ByVal value As String)
mPlan = value
End Set
End Property
Private mLettre As String
Public Property Lettre() As String
Get
Return mLettre
End Get
Set(ByVal value As String)
mLettre = value
End Set
End Property
Private mEntree As String
Public Property Entree() As String
Get
Return mEntree
End Get
Set(ByVal value As String)
mEntree = value
End Set
End Property
Private mNiveau As String
Public Property Niveau() As String
Get
Return mNiveau
End Get
Set(ByVal value As String)
mNiveau = value
End Set
End Property
Private mNumero As String
Public Property Numero() As String
Get
Return mNumero
End Get
Set(ByVal value As String)
mNumero = value
End Set
End Property
Private mCodeRivoli As String
Public Property CodeRivoli() As String
Get
Return mCodeRivoli
End Get
Set(ByVal value As String)
mCodeRivoli = value
End Set
End Property
Private mCodeMajic As String
Public Property CodeMajic() As String
Get
Return mCodeMajic
End Get
Set(ByVal value As String)
mCodeMajic = value
End Set
End Property
Private mNumVoie As String
Public Property NumVoie() As String
Get
Return mNumVoie
End Get
Set(ByVal value As String)
mNumVoie = value
End Set
End Property
Private mIndRep As String
Public Property IndRep() As String
Get
Return mIndRep
End Get
Set(ByVal value As String)
mIndRep = value
End Set
End Property
Private mLibelle As String
Public Property Libelle() As String
Get
Return mLibelle
End Get
Set(ByVal value As String)
mLibelle = value
End Set
End Property
Private mClefAlpha As String
Public Property ClefAlpha() As String
Get
Return mClefAlpha
End Get
Set(ByVal value As String)
mClefAlpha = value
End Set
End Property
Private mGPDL As String
Public Property GPDL() As String
Get
Return mGPDL
End Get
Set(ByVal value As String)
mGPDL = value
End Set
End Property
Private mSerieRole As String
Public Property SerieRole() As String
Get
Return mSerieRole
End Get
Set(ByVal value As String)
mSerieRole = value
End Set
End Property
Private mCompteCom As String
Public Property CompteCom() As String
Get
Return mCompteCom
End Get
Set(ByVal value As String)
mCompteCom = value
End Set
End Property
Private mDateMutation As String
Public Property DateMutation() As String
Get
Return mDateMutation
End Get
Set(ByVal value As String)
mDateMutation = value
End Set
End Property
Private mCodeEval As String
Public Property CodeEval() As String
Get
Return mCodeEval
End Get
Set(ByVal value As String)
mCodeEval = value
End Set
End Property
Private mTypeLocal As String
Public Property TypeLocal() As String
Get
Return mTypeLocal
End Get
Set(ByVal value As String)
mTypeLocal = value
End Set
End Property
Private mCodeConstructionP As String
Public Property CodeConstructionP() As String
Get
Return mCodeConstructionP
End Get
Set(ByVal value As String)
mCodeConstructionP = value
End Set
End Property
Private mCodeNature As String
Public Property CodeNature() As String
Get
Return mCodeNature
End Get
Set(ByVal value As String)
mCodeNature = value
End Set
End Property
Private mVL As String
Public Property VL() As String
Get
Return mVL
End Get
Set(ByVal value As String)
mVL = value
End Set
End Property
Private mOccupation As String
Public Property Occupation() As String
Get
Return mOccupation
End Get
Set(ByVal value As String)
mOccupation = value
End Set
End Property
Private mTopMutation As String
Public Property TopMutation() As String
Get
Return mTopMutation
End Get
Set(ByVal value As String)
mTopMutation = value
End Set
End Property
Private mAnneeConstruction As String
Public Property AnneeConstruction() As String
Get
Return mAnneeConstruction
End Get
Set(ByVal value As String)
mAnneeConstruction = value
End Set
End Property
Private mNbNiveau As String
Public Property NbNiveau() As String
Get
Return mNbNiveau
End Get
Set(ByVal value As String)
mNbNiveau = value
End Set
End Property
Public Sub New()
End Sub
Public Function Enregistre()
Dim sql1 As String = "INSERT INTO " & SchemaName & ".templocaux (departement, insee, invariant, prefsection, section, plan," _
& " lettre, entree, niveau, numero, coderivoli, codemajic, numvoie, indrep, libelle, clefalpha, gpdl," _
& " serierole, comptecom, datemutation, codeeval, typelocal, codeconstructionp, codenature, vl, occupation," _
& " topmutation, anneeconstruction, nbniveau ) VALUES (:p,:p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:p10,:p11,:p12,:p13,:p14,:p15,:p16,:p17,:p18,:p19,:p20,:p21,:p22,:p23,:p24,:p25,:p26,:p27,:p28) RETURNING idtemplocal;"
Dim cmd As New NpgsqlCommand(sql1, cnngen)
cmd.Parameters.Clear()
Dim p As New NpgsqlParameter("p", mDepartement)
cmd.Parameters.Add(p)
Dim p1 As New NpgsqlParameter("p1", mInsee)
cmd.Parameters.Add(p1)
Dim p2 As New NpgsqlParameter("p2", mInvariant)
cmd.Parameters.Add(p2)
Dim p3 As New NpgsqlParameter("p3", mPrefSection)
cmd.Parameters.Add(p3)
Dim p4 As New NpgsqlParameter("p4", mSection)
cmd.Parameters.Add(p4)
Dim p5 As New NpgsqlParameter("p5", mPlan)
cmd.Parameters.Add(p5)
Dim p6 As New NpgsqlParameter("p6", mLettre)
cmd.Parameters.Add(p6)
Dim p7 As New NpgsqlParameter("p7", mEntree)
cmd.Parameters.Add(p7)
Dim p8 As New NpgsqlParameter("p8", mNiveau)
cmd.Parameters.Add(p8)
Dim p9 As New NpgsqlParameter("p9", mNumero)
cmd.Parameters.Add(p9)
Dim p10 As New NpgsqlParameter("p10", mCodeRivoli)
cmd.Parameters.Add(p10)
Dim p11 As New NpgsqlParameter("p11", mCodeMajic)
cmd.Parameters.Add(p11)
Dim p12 As New NpgsqlParameter("p12", mNumVoie)
cmd.Parameters.Add(p12)
Dim p13 As New NpgsqlParameter("p13", mIndRep)
cmd.Parameters.Add(p13)
Dim p14 As New NpgsqlParameter("p14", mLibelle)
cmd.Parameters.Add(p14)
Dim p15 As New NpgsqlParameter("p15", mClefAlpha)
cmd.Parameters.Add(p15)
Dim p16 As New NpgsqlParameter("p16", mGPDL)
cmd.Parameters.Add(p16)
Dim p17 As New NpgsqlParameter("p17", mSerieRole)
cmd.Parameters.Add(p17)
Dim p18 As New NpgsqlParameter("p18", mCompteCom)
cmd.Parameters.Add(p18)
Dim p19 As New NpgsqlParameter("p19", mDateMutation)
cmd.Parameters.Add(p19)
Dim p20 As New NpgsqlParameter("p20", mCodeEval)
cmd.Parameters.Add(p20)
Dim p21 As New NpgsqlParameter("p21", mTypeLocal)
cmd.Parameters.Add(p21)
Dim p22 As New NpgsqlParameter("p22", mCodeConstructionP)
cmd.Parameters.Add(p22)
Dim p23 As New NpgsqlParameter("p23", mCodeNature)
cmd.Parameters.Add(p23)
Dim p24 As New NpgsqlParameter("p24", mVL)
cmd.Parameters.Add(p24)
Dim p25 As New NpgsqlParameter("p25", mOccupation)
cmd.Parameters.Add(p25)
Dim p26 As New NpgsqlParameter("p26", mTopMutation)
cmd.Parameters.Add(p26)
Dim p27 As New NpgsqlParameter("p27", mAnneeConstruction)
cmd.Parameters.Add(p27)
Dim p28 As New NpgsqlParameter("p28", mNbNiveau)
cmd.Parameters.Add(p28)
mID_Local = cmd.ExecuteScalar
Enregistre = mID_Local
cmd.Dispose()
End Function
Public Sub Affecte(ByVal ligne As String, ByVal ligne10 As String)
ligne = ligne.Replace(Chr(34), "_")
mDepartement = ligne.Substring(0, 2)
mInsee = ligne.Substring(3, 3)
mInvariant = ligne.Substring(6, 10)
mPrefSection = ligne.Substring(35, 3)
mSection = ligne.Substring(38, 2)
mPlan = ligne.Substring(40, 4)
mLettre = ligne.Substring(45, 2)
mEntree = ligne.Substring(47, 2)
mNiveau = ligne.Substring(49, 2)
mNumero = ligne.Substring(51, 5)
mCodeRivoli = ligne.Substring(56, 4)
mCodeMajic = ligne.Substring(61, 5)
mNumVoie = ligne.Substring(66, 4)
mIndRep = ligne.Substring(70, 1)
mLibelle = ligne.Substring(75, 30)
mClefAlpha = ligne.Substring(105, 1)
mGPDL = ligne10.Substring(35, 1)
mSerieRole = ligne10.Substring(36, 1)
mCompteCom = ligne10.Substring(37, 6)
mDateMutation = ligne10.Substring(43, 8)
mCodeEval = ligne10.Substring(57, 1)
mTypeLocal = ligne10.Substring(59, 1)
mCodeConstructionP = ligne10.Substring(65, 1)
mCodeNature = ligne10.Substring(66, 2)
mVL = ligne10.Substring(68, 9)
mOccupation = ligne10.Substring(93, 1)
mTopMutation = ligne10.Substring(107, 1)
mAnneeConstruction = ligne10.Substring(108, 4)
mNbNiveau = ligne10.Substring(112, 2)
End Sub
Public Sub Affecte(ByVal row As DataRow)
mID_Local = row("idtemplocal")
mDepartement = row("departement")
mInsee = row("insee")
mInvariant = row("invariant")
mPrefSection = row("prefsection")
mSection = row("section")
mPlan = row("plan")
mLettre = row("lettre")
mEntree = row("entree")
mNiveau = row("niveau")
mNumero = row("numero")
mCodeRivoli = row("coderivoli")
mCodeMajic = row("codemajic")
mNumVoie = row("numvoie")
mIndRep = row("indrep")
mLibelle = row("libelle")
mClefAlpha = row("clefalpha")
mGPDL = row("gpdl")
mSerieRole = row("serierole")
mCompteCom = row("comptecom")
mDateMutation = row("datemutation")
mCodeEval = row("codeeval")
mTypeLocal = row("typelocal")
mCodeConstructionP = row("codeconstructionp")
mCodeNature = row("codenature")
mVL = row("vl")
mOccupation = row("occupation")
mTopMutation = row("topmutation")
mAnneeConstruction = row("anneeconstruction")
mNbNiveau = row("nbniveau")
End Sub
End Class