-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainMDI.frm
1156 lines (921 loc) · 37.2 KB
/
MainMDI.frm
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{0F0877EF-2A93-4AE6-8BA8-4129832C32C3}#230.0#0"; "SmartMenuXP.ocx"
Begin VB.MDIForm MainMDI
BackColor = &H00C0C0C0&
Caption = "OXY data - V.2015.06.09"
ClientHeight = 6765
ClientLeft = 60
ClientTop = 405
ClientWidth = 11370
Icon = "MainMDI.frx":0000
LinkTopic = "MDIForm1"
MouseIcon = "MainMDI.frx":038A
WindowState = 2 'Maximized
Begin MSComctlLib.ImageList ImageList1
Left = 60
Top = 810
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 39
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":0714
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":0AAE
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":0E48
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":11E2
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":157C
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":1916
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":1CB0
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":204A
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":23E4
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":277E
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":2B18
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":2EB2
Key = ""
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":324C
Key = ""
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":35E6
Key = ""
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":3980
Key = ""
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":3D1A
Key = ""
EndProperty
BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":40B4
Key = ""
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":444E
Key = ""
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":47E8
Key = ""
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":4B82
Key = ""
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":4F1C
Key = ""
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":52B6
Key = ""
EndProperty
BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":5650
Key = ""
EndProperty
BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":59EA
Key = ""
EndProperty
BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":5D84
Key = ""
EndProperty
BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":611E
Key = ""
EndProperty
BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":64B8
Key = ""
EndProperty
BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":6852
Key = ""
EndProperty
BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":6BEC
Key = ""
EndProperty
BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":6F86
Key = ""
EndProperty
BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":7320
Key = ""
EndProperty
BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":76BA
Key = ""
EndProperty
BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":7A54
Key = ""
EndProperty
BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":7DEE
Key = ""
EndProperty
BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":8188
Key = ""
EndProperty
BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":8522
Key = ""
EndProperty
BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":8C9C
Key = ""
EndProperty
BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":9036
Key = ""
EndProperty
BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "MainMDI.frx":93D0
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar tlbHerra
Align = 1 'Align Top
Height = 360
Left = 0
TabIndex = 2
Top = 375
Width = 11370
_ExtentX = 20055
_ExtentY = 635
ButtonWidth = 609
ButtonHeight = 582
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 32
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_gen"
Object.ToolTipText = "Seleccionar tema para filtro general"
ImageIndex = 32
Style = 5
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_forma_vista"
Object.ToolTipText = "Visualizar datos en forma de planilla o formulario"
ImageIndex = 1
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_fila_pri"
Object.ToolTipText = "Ir a la primera fila"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_fila_ant"
Object.ToolTipText = "Ir a la fila anterior"
ImageIndex = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_fila_sig"
Object.ToolTipText = "Ir a la fila siguiente"
ImageIndex = 4
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_fila_ult"
Object.ToolTipText = "Ir a la ultima fila"
ImageIndex = 5
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_actualizar"
Object.ToolTipText = "Actualizar información"
ImageIndex = 6
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_insertar"
Object.ToolTipText = "Insertar"
ImageIndex = 7
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_editar"
Object.ToolTipText = "Editar"
ImageIndex = 8
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_eliminar"
Object.ToolTipText = "Eliminar"
ImageIndex = 9
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_guardar"
Object.ToolTipText = "Guardar"
ImageIndex = 10
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_cancelar"
Object.ToolTipText = "Cancelar"
ImageIndex = 11
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_buscar"
Object.ToolTipText = "Buscar - DESHABILITADA"
ImageIndex = 12
EndProperty
BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_abr"
Object.ToolTipText = "Abrir filtro"
ImageIndex = 13
EndProperty
BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_gua"
Object.ToolTipText = "Guardar filtro"
ImageIndex = 14
EndProperty
BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_rap"
Object.ToolTipText = "Filtro rápido"
ImageIndex = 15
EndProperty
BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_ava"
Object.ToolTipText = "Filtro avanzado"
ImageIndex = 16
EndProperty
BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_atr"
Object.ToolTipText = "Ir al filtro anterior"
ImageIndex = 17
EndProperty
BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_filtro_eli"
Object.ToolTipText = "Eliminar filtro"
ImageIndex = 18
EndProperty
BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Key = "cmd_columna_orden_asc"
Object.ToolTipText = "Ordenar columna en forma ascendente"
ImageIndex = 19
EndProperty
BeginProperty Button21 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_orden_desc"
Object.ToolTipText = "Ordenar columna en forma descendente"
ImageIndex = 20
EndProperty
BeginProperty Button22 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_ajustar"
Object.ToolTipText = "Ajustar ancho de columna"
ImageIndex = 21
EndProperty
BeginProperty Button23 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_mas_decimales"
Object.ToolTipText = "Agregar decimales"
ImageIndex = 22
EndProperty
BeginProperty Button24 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_menos_decimales"
Object.ToolTipText = "Eliminar decimales"
ImageIndex = 23
EndProperty
BeginProperty Button25 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_ocultar"
Object.ToolTipText = "Ocultar columna"
ImageIndex = 24
EndProperty
BeginProperty Button26 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_mostrar"
Object.ToolTipText = "Mostrar columnas ocultas"
ImageIndex = 25
EndProperty
BeginProperty Button27 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_congelar"
Object.ToolTipText = "Congelar columna"
ImageIndex = 26
EndProperty
BeginProperty Button28 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_columna_descongelar"
Object.ToolTipText = "Descongelar columna"
ImageIndex = 27
EndProperty
BeginProperty Button29 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_copiar"
Object.ToolTipText = "Copiar rango seleccionado"
ImageIndex = 28
EndProperty
BeginProperty Button30 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_totalizar"
Object.ToolTipText = "Totalizar"
ImageIndex = 39
EndProperty
BeginProperty Button31 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_exportar"
Object.ToolTipText = "Exportar a Excel o Texto"
ImageIndex = 38
EndProperty
BeginProperty Button32 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "cmd_importar"
Object.ToolTipText = "Importar desde Excel"
ImageIndex = 37
EndProperty
EndProperty
BorderStyle = 1
End
Begin MSComctlLib.StatusBar staBarra2
Align = 2 'Align Bottom
Height = 285
Left = 0
TabIndex = 1
Top = 6195
Width = 11370
_ExtentX = 20055
_ExtentY = 503
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
EndProperty
EndProperty
End
Begin VBSmartXPMenu.SmartMenuXP mnu
Align = 1 'Align Top
Height = 375
Left = 0
Top = 0
Width = 855
_ExtentX = 1508
_ExtentY = 661
BackColor = -2147483633
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
TextAlign = 0
Shadow = 0 'False
End
Begin MSComctlLib.StatusBar staBarra1
Align = 2 'Align Bottom
Height = 285
Left = 0
TabIndex = 0
Top = 6480
Width = 11370
_ExtentX = 20055
_ExtentY = 503
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Object.Width = 1411
MinWidth = 1411
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Object.Width = 1411
MinWidth = 1411
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Object.Width = 1411
MinWidth = 1411
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar staBarra3
Align = 2 'Align Bottom
Height = 285
Left = 0
TabIndex = 3
Top = 5910
Visible = 0 'False
Width = 11370
_ExtentX = 20055
_ExtentY = 503
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "MainMDI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private m_dsiWhereGen(1, 3) As String
Dim aa As Variant
' 21/05/2015
' Edu Mazzu - Para habilitar un vinculo y que pueda abrir un documento desde la aplicaciòn
Const SW_SHOWNORMAL = 1
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Property Get dsiWhereGenAgregar(ByVal strColumna As String, ByVal strNombre As String, ByVal strCondicion As String) As Boolean
m_dsiWhereGen(1, 1) = strColumna 'nombre columna ej: well id
m_dsiWhereGen(1, 2) = strNombre 'nombre condicion ej: TD > 2540
m_dsiWhereGen(1, 3) = strCondicion 'lista de datos ej: 'eh-2054', 'eh-4565', etc...
'muestra whereGen en barra de estado
blnB = Me.dsiWhereMostrarSi()
'hago refresh en todas las grillas abiertas--------------------------------------------
Dim frmOpen As Form
Dim frmAnt As Form
'guardo frm activo
Set frmAnt = Me.ActiveForm
'recorro frms abiertos, hago refresh solo en las grillas
blnOpen = True
For Each frmOpen In Forms
'check si es <> filtroGeneral y MainMDI
If frmOpen.Name <> "MainMDI" And frmOpen.Name <> "filtrarGenFRM" Then
'set foco en grilla
frmOpen.SetFocus
blnB = frmOpen.dsiRefresh(True)
End If
Next frmOpen
'cierro
SQLclose
'recupero frmActivo anterior
If Not frmAnt Is Nothing Then
frmAnt.SetFocus
End If
End Property
Public Property Get dsiWhereGenEliminar() As Boolean
m_dsiWhereGen(1, 1) = "" 'nombre columna ej: well id
m_dsiWhereGen(1, 2) = "" 'nombre condicion ej: TD > 2540
m_dsiWhereGen(1, 3) = "" 'lista de datos ej: 'eh-2054', 'eh-4565', etc...
'muestra whereGen en barra de estado
blnB = Me.dsiWhereMostrarNo()
'hago refresh en todas las grillas abiertas--------------------------------------------
Dim frmOpen As Form
Dim frmAnt As Form
'guardo frm activo
Set frmAnt = Me.ActiveForm
'recorro frms abiertos, hago refresh solo en las grillas
blnOpen = True
For Each frmOpen In Forms
'check si es <> filtroGeneral y MainMDI
If frmOpen.Name <> "MainMDI" And frmOpen.Name <> "filtrarGenFRM" Then
'set foco en grilla
frmOpen.SetFocus
blnB = frmOpen.dsiRefresh(True)
End If
Next frmOpen
'cierro
SQLclose
'recupero frmActivo anterior
If Not frmAnt Is Nothing Then
frmAnt.SetFocus
End If
End Property
Public Property Get dsiWhereGen(strT As String) As String
Select Case LCase(strT)
Case "columna"
dsiWhereGen = m_dsiWhereGen(1, 1)
Case "nombre"
dsiWhereGen = m_dsiWhereGen(1, 2)
Case "condicion"
dsiWhereGen = m_dsiWhereGen(1, 3)
End Select
End Property
Public Property Get dsiWhereMostrarSi() As Boolean
'muestra en barra de estado de frm MDI
MainMDI.staBarra2.Panels(1) = " General: " & Me.dsiWhereGen("nombre")
MainMDI.staBarra2.Panels(1).ToolTipText = " General: " & Me.dsiWhereGen("nombre")
'clear order by
MainMDI.staBarra1.Panels(1) = ""
MainMDI.staBarra1.Panels(1).ToolTipText = ""
'clear ubicacion grilla
MainMDI.staBarra1.Panels(2) = ""
MainMDI.staBarra1.Panels(2).ToolTipText = ""
End Property
Public Property Get dsiWhereMostrarNo() As Boolean
'muestra en barra de estado de frm MDI
MainMDI.staBarra2.Panels(1) = ""
MainMDI.staBarra2.Panels(1).ToolTipText = ""
'clear order by
MainMDI.staBarra1.Panels(1) = ""
MainMDI.staBarra1.Panels(1).ToolTipText = ""
'clear ubicacion grilla
MainMDI.staBarra1.Panels(2) = ""
MainMDI.staBarra1.Panels(2).ToolTipText = ""
End Property
'no muestra mas usuario conectado, lugar reservado para sum, avg, etc.
'
'Public Property Get dsiLogonMostrar()
' Dim strT As String
' Dim intI As Integer
'inicializo
' strT = ""
'armo string con usuario - grupo - role
' strT = " " & SQLparam.UsuarioConectado
'muestro en barra de estado
' Me.staBarra1.Panels(3).Text = strT
' Me.staBarra1.Panels(3).ToolTipText = strT
'End Property
Public Property Get dsiHerramientas(blnB As Boolean) As Boolean
Me.tlbHerra.Buttons("cmd_forma_vista").Enabled = blnB
Me.tlbHerra.Buttons("cmd_fila_pri").Enabled = blnB
Me.tlbHerra.Buttons("cmd_fila_ant").Enabled = blnB
Me.tlbHerra.Buttons("cmd_fila_sig").Enabled = blnB
Me.tlbHerra.Buttons("cmd_fila_ult").Enabled = blnB
Me.tlbHerra.Buttons("cmd_actualizar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_insertar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_editar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_eliminar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_buscar").Enabled = False
Me.tlbHerra.Buttons("cmd_filtro_abr").Enabled = blnB
Me.tlbHerra.Buttons("cmd_filtro_gua").Enabled = blnB
Me.tlbHerra.Buttons("cmd_filtro_rap").Enabled = blnB
Me.tlbHerra.Buttons("cmd_filtro_ava").Enabled = blnB
Me.tlbHerra.Buttons("cmd_filtro_atr").Enabled = blnB
Me.tlbHerra.Buttons("cmd_filtro_eli").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_orden_asc").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_orden_desc").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_ajustar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_mas_decimales").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_menos_decimales").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_ocultar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_mostrar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_congelar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_columna_descongelar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_copiar").Enabled = blnB
MainMDI.tlbHerra.Buttons("cmd_totalizar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_exportar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_importar").Enabled = blnB
End Sub
Public Property Get dsiHerramientasComfirmar(blnB As Boolean) As Boolean
Me.tlbHerra.Buttons("cmd_guardar").Enabled = blnB
Me.tlbHerra.Buttons("cmd_cancelar").Enabled = blnB
End Property
Private Sub MDIForm_Activate()
'muestro en barra de estdo quien hizo logon
' blnB = Me.dsiLogonMostrar()
End Sub
Private Sub MDIForm_Load()
Dim rs As ADODB.Recordset
Dim Item As SmartMenuXP
Dim strT, strL As String
Dim intI As Integer
Dim blnB As Boolean
'check configuracion regional
If Not checkConfigRegional() Then
blnB = MsgBox("El sistema detecto que la configuración regional no es correcta." & vbCrLf & vbCrLf & _
"Configurar el formato para números de esta forma: 123,456,789.00." & vbCrLf & vbCrLf & _
"Configurar el formato para fechas de esta forma: dd/MM/yyyy.", vbCritical + vbOKOnly, "Atención...")
End
End If
'get parametros de conexion
blnB = SQLgetParam()
'check si parametros ok, get menu
If blnB Then
'get dsiOPC para dibujar menu, las condiciones para dibujar el menu
'primero las que no estan ocultas y segundo cuando el usuario conectado
'pertenece por lo menos a un grupo que tiene permisos de Visualizar
strT = "select dsiOPC.* " & _
"From dsiOPC " & _
"inner join dsiOPCpermis on dsiOPC.IDmenu = dsiOPCpermis.IDmenu and dsiOPC.id = dsiOPCpermis.IDopc " & _
"where dsiOPC.IDmenu = " & SQLparam.IDmenu & " and dsiOPCpermis.usuario in (" & SQLparam.Tag & ") and " & _
"isnull(oculto, 0) = 0 " & _
"group by dsiOPC.IDmenu, dsiOPC.id, nombre, tipo, padre, orden, oculto, icono " & _
"order by orden, padre, id"
Set rs = SQLexec(strT)
'chequeo error
If Not SQLparam.CnErrNumero = -1 Then
SQLError
SQLclose
End
End If
'recorro
While Not rs.EOF
'check SI tipo = gen, add combo filtro general
If rs!tipo = "gen" Then
Me.tlbHerra.Buttons.Item("cmd_filtro_gen").ButtonMenus.Add , "'" & rs!ID & "'", rs!nombre
Else
'check si padre = 0 o null, add como padre, sino add como hijo
If rs!padre = 0 Or IsNull(rs!padre) Then
blnB = mnu.MenuItems.Add(0, "'" & rs!tipo & rs!ID & "'", , rs!nombre, , , , smiunCheckBox)
Else
'blnB = mnu.MenuItems.Add("'grp" & rs!padre & "'", "'" & rs!tipo & rs!ID & "'", , rs!nombre, , , , smiunCheckBox)
If rs!tipo = "grp" Then
blnB = mnu.MenuItems.Add("'grp" & rs!padre & "'", "'" & rs!tipo & rs!ID & "'", , rs!nombre, , , , smiunCheckBox)
Else
blnB = mnu.MenuItems.Add("'grp" & rs!padre & "'", "'" & rs!tipo & rs!ID & "'", , rs!nombre & " - (" & rs!ID & ")", , , , smiunCheckBox)
End If
End If
End If
'siguiente
rs.MoveNext
Wend
End If
'cierro
SQLclose
'add menu herramientas todos tienen acceso siempre, es independiente de la seguridad
blnB = mnu.MenuItems.Add(0, "'grp9000'", , "Tools", , , , smiunCheckBox)
blnB = mnu.MenuItems.Add("'grp9000'", "'per9001'", , "Conection", , , , smiunCheckBox)
blnB = mnu.MenuItems.Add("'grp9000'", "'per9002'", , "Security", , , , smiunCheckBox)
blnB = mnu.MenuItems.Add("'grp9000'", "'per9004'", , "Costs", , , , smiunCheckBox)
blnB = mnu.MenuItems.Add("'grp9000'", "'per9005'", , "About DSInfo", , , , smiunCheckBox)
'ADD news - lo vinculamos con un HTML de novedades
blnB = mnu.MenuItems.Add("'grp9000'", "'per9009'", , "News", , , , smiunCheckBox)
blnB = mnu.MenuItems.Add("'grp9000'", "'per9999'", , "Exit", , , , smiunCheckBox)
'get where General from INI
blnB = Me.dsiWhereGenAgregar(ReadIni("main", "whereColumna"), ReadIni("main", "whereNombre"), ReadIni("main", "whereCondicion"))
'deshabilito herramientas
blnB = Me.dsiHerramientas(False)
blnB = Me.dsiHerramientasComfirmar(False)
End Sub
Private Sub MDIForm_Resize()
'divido la barra de estado1 en 3 partes iguales
Me.staBarra1.Panels(1).Width = Me.Width * 0.25
Me.staBarra1.Panels(2).Width = Me.Width * 0.4
Me.staBarra1.Panels(3).Width = Me.Width * 0.35
'ajusto barra de estado2 en 2 partes
Me.staBarra2.Panels(1).Width = Me.Width
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
Dim strT As String
Dim blnB As Boolean
'save where General - nombre columna
strT = Me.dsiWhereGen("columna")
blnB = WriteIni("main", "whereColumna", strT)
'save where General - nombre condicion
strT = Me.dsiWhereGen("nombre")
blnB = WriteIni("main", "whereNombre", strT)
'save where General - condicion
strT = Me.dsiWhereGen("condicion")
blnB = WriteIni("main", "whereCondicion", strT)
'save grupos y usuarios
'while
For intI = 1 To UBound(SQLparam.GrupoConectado)
'insert
SQLexec ("exec dsiGRPusuar_INS_sp " & "'" & SQLparam.GrupoConectado(intI) & "','" & SQLparam.UsuarioConectado & "'")
'check errores, con excepcion si es clave duplicada no muestra error, pasa de largo.
If Not SQLparam.CnErrNumero = -1 And SQLparam.CnErrNumero <> -2147217873 Then
SQLError
SQLclose
Exit Sub
End If
Next
'cierro cn
SQLclose
End Sub
Private Sub mnu_Click(ByVal ID As Long)
Dim frmOPC As gridFRM
Dim frmRPT As ReportesFRM
Dim frmPRC As procesosFRM
Dim frm As Form
Dim IDopc, IDtipo, strT As String
Dim rs As ADODB.Recordset
'get tipo y opcion
IDtipo = LCase(Mid(mnu.MenuItems.Key(ID), 2, 3))
IDopc = Mid(mnu.MenuItems.Key(ID), 5, 4)
Select Case LCase(IDtipo)
Case "grp"
Case "lnk"
' 21/05/2015
'Edu Mazzu - VINCULO - agregar un reporte mediante un vinculo
'get nombre VINCULO
strT = "select valor from dsiOPCconfig where tipo = 'VINCULO' and IDmenu = " & SQLparam.IDmenu & " and IDopc = " & IDopc
Set rs = SQLexec(strT)
'chequeo error
If Not SQLparam.CnErrNumero = -1 Then
SQLError
SQLclose
Exit Sub
Else
If Not rs.EOF Then
strRuta = rs!valor
ShellExecute Me.hwnd, "open", strRuta, "", App.Path, SW_SHOWNORMAL
Exit Sub
End If
End If
Case "per"
'check EXIT, salgo
If IDopc = 9999 Then
Call Unload(MainMDI)
End If
'check si conexion
If IDopc = 9001 Then
conexionFRM.Show vbModal
End If
'check si seguridad
If IDopc = 9002 Then
seguridadFRM.Show vbModal
End If
'CHECK si costos
If IDopc = 9004 Then
costosFRM.Show vbModal
End If
'CHECK si costos
If IDopc = 9005 Then
acercaDeFRM.Show vbModal
End If
'CHECK si news
If IDopc = 9009 Then
' 09/06/2015
'Edu Mazzu - VINCULO - agregar un reporte mediante un vinculo
'get nombre VINCULO
strT = "select valor from dsiOPCconfig where tipo = 'VINCULO' and IDmenu = " & SQLparam.IDmenu & " and IDopc = " & IDopc
Set rs = SQLexec(strT)
'chequeo error
If Not SQLparam.CnErrNumero = -1 Then
SQLError
SQLclose
Exit Sub
Else
If Not rs.EOF Then
strRuta = rs!valor
ShellExecute Me.hwnd, "open", strRuta, "", App.Path, SW_SHOWNORMAL
Exit Sub
End If
End If
End If
Case "exe", "cmd" 'ejecutables y scripts
'get nombre de exe o cmd
strT = "select * from dsiOPCconfig where IDmenu = " & SQLparam.IDmenu & " and IDopc = " & IDopc
Set rs = SQLexec(strT)
'chequeo error
If Not SQLparam.CnErrNumero = -1 Then
SQLError
SQLclose
End
End If
'check si existe archivo
If rs.RecordCount = 0 Then
Exit Sub
End If
'save nombre de archivo
strT = rs!valor
'cierro
SQLclose
'call archivo
Shell App.Path & "\" & strT, vbNormalFocus
Case "opc", "rpt", "prc" 'opciones comunes, reportes, store procedure
'check si esta open el frm seleccionado
Dim frmOpen As Form
Dim blnOpen As Boolean
blnOpen = True
For Each frmOpen In Forms
If frmOpen.Caption = mnu.MenuItems.Caption(ID) Then
'check si open, lo hago activo
frmOpen.SetFocus
blnOpen = False
End If
Next frmOpen
' 21/05/2015
' Edu Mazzu - Deshabilito la posibilidad de que no se puedan abrir mas de una opcion al mismo tiempo.
'
'si open, escapo
' If Not blnOpen Then
' Exit Sub
' End If
'opciones comunes
If IDtipo = "opc" Then
Set frmOPC = New gridFRM
Set frm = frmOPC
End If
'reportes
If IDtipo = "rpt" Then
Set frmRPT = New ReportesFRM
Set frm = frmRPT
End If
'procesos
If IDtipo = "prc" Then
Set frmPRC = New procesosFRM
Set frm = frmPRC
End If
'creo nuevo frm, le paso propiedades y show
frm.dsiIDmenu = SQLparam.IDmenu
frm.dsiIDopc = IDopc
frm.dsiTitulo = mnu.MenuItems.Caption(ID)
frm.Show