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
|
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Threading;
using Gestor.Application.Drawers;
using Gestor.Application.Helpers;
using Gestor.Application.Servicos;
using Gestor.Application.ViewModels.Ferramentas;
using Gestor.Application.Views.Generic;
using Gestor.Common.Validation;
using Gestor.Model.Common;
using Gestor.Model.Domain.Common;
using Gestor.Model.Domain.Configuracoes;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Domain.Seguros;
using Gestor.Model.License;
namespace Gestor.Application.Views.Ferramentas;
public class UsuarioView : BaseUserControl, IComponentConnector
{
private bool _abrindoPermissao;
private bool _firstTime = true;
private bool _setting;
internal DataGrid UsuarioGrid;
internal MenuItem CancelarApoliceButton;
internal TextBox NomeBox;
internal TextBox CepBox;
internal TextBox EnderecoBox;
internal TextBox NumeroBox;
internal TextBox BairroBox;
internal TextBox CidadeBox;
internal TextBox EstadoBox;
private bool _contentLoaded;
public UsuarioViewModel ViewModel { get; set; }
public UsuarioView()
{
((FrameworkElement)this).Tag = "CADASTRO DE USUÁRIOS";
ViewModel = new UsuarioViewModel();
((FrameworkElement)this).DataContext = ViewModel;
InitializeComponent();
Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
if (dispatcher != null)
{
dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
}
}
private void ScrollToItem()
{
if (((Selector)UsuarioGrid).SelectedItem != null)
{
((UIElement)UsuarioGrid).UpdateLayout();
UsuarioGrid.ScrollIntoView(((Selector)UsuarioGrid).SelectedItem);
}
}
private async void ContentLoad()
{
ViewModel.Loading(isLoading: true);
await ViewModel.Seleciona();
ViewModel.Loading(isLoading: false);
}
private void Incluir_OnClick(object sender, RoutedEventArgs e)
{
ViewModel.Incluir();
List<KeyValuePair<string, string>> errorMessages = ViewModel.SelectedUsuario.Validate();
((DependencyObject)(object)this).ValidateFields(errorMessages);
ViewModel.IsExpanded = false;
((UIElement)NomeBox).Focus();
}
private async void Cancelar_OnClick(object sender, RoutedEventArgs e)
{
ViewModel.Loading(isLoading: true);
await ViewModel.CancelarAlteracao();
ViewModel.Loading(isLoading: false);
ScrollToItem();
}
private async void Salvar_OnClick(object sender, RoutedEventArgs e)
{
ViewModel.Loading(isLoading: true);
List<KeyValuePair<string, string>> list = await ViewModel.Salvar();
((DependencyObject)(object)this).ValidateFields(list);
bool num = list == null || list.Count == 0;
ViewModel.Loading(isLoading: false);
if (num)
{
ScrollToItem();
}
else
{
await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
}
}
private async void Alterar_OnClick(object sender, RoutedEventArgs e)
{
if (LicenseHelper.Produtos.Any((Licenca produto) => (int)produto.Produto == 91) && ViewModel.SelectedUsuario.Login.Contains("@"))
{
await ViewModel.ShowMessage("ALTERAÇÃO DESSE USUARIO TEM QUE SER FEITO NO PAINEL DO AGGILIZADOR.");
return;
}
await ViewModel.AlterarUsuario();
((DomainBase)ViewModel.SelectedUsuario).Initialize();
ViewModel.CancelUsuario = (Usuario)((DomainBase)ViewModel.SelectedUsuario).Clone();
ViewModel.Alterar(alterar: true);
ViewModel.IsExpanded = false;
((UIElement)NomeBox).Focus();
}
private async void Excluir_OnClick(object sender, RoutedEventArgs e)
{
if (LicenseHelper.Produtos.Any((Licenca produto) => (int)produto.Produto == 91) && ViewModel.SelectedUsuario.Login.Contains("@"))
{
await ViewModel.ShowMessage("EXCLUSÃO DESSE USUARIO TEM QUE SER FEITO NO PAINEL DO AGGILIZADOR.");
return;
}
await ViewModel.Excluir();
ScrollToItem();
}
private void AutoCompleteBancoBox_Populating(object sender, PopulatingEventArgs e)
{
if (e.Parameter.Length < 3)
{
return;
}
e.Cancel = true;
ViewModel.BuscarBanco(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Banco>> searchResult)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
if (searchResult.Result != null)
{
AutoCompleteBox val = (AutoCompleteBox)sender;
val.ItemsSource = searchResult.Result;
val.PopulateComplete();
}
}, TaskScheduler.FromCurrentSynchronizationContext());
}
private async void PostcodeBox_OnLostFocus(object sender, RoutedEventArgs e)
{
string text = ValidationHelper.FormatPostCode(((TextBox)sender).Text);
CepBox.Text = text;
if (ValidationHelper.ValidatePostCode(text))
{
EnderecoBase val = await ViewModel.BuscaCep(text);
if (val != null)
{
EnderecoBox.Text = val.Endereco;
CidadeBox.Text = val.Cidade;
EstadoBox.Text = val.Estado;
BairroBox.Text = val.Bairro;
}
}
}
private void AutoCompleteBoxUsuario_Populating(object sender, PopulatingEventArgs e)
{
e.Cancel = true;
ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Usuario>> searchResult)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
if (searchResult.Result != null)
{
AutoCompleteBox val = (AutoCompleteBox)sender;
val.ItemsSource = searchResult.Result;
val.PopulateComplete();
}
}, TaskScheduler.FromCurrentSynchronizationContext());
}
private void AutoCompleteBox_OnTextChanged(object sender, RoutedEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
if (string.IsNullOrWhiteSpace(((AutoCompleteBox)sender).Text))
{
ViewModel.FiltrarUsuario("");
}
}
private async void UsuarioGrid_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (ViewModel.EnableGrid)
{
DataGrid val = (DataGrid)sender;
if (val == null || ((Selector)val).SelectedIndex >= 0)
{
ViewModel.EnableGrid = false;
await ViewModel.SelecionaUsuario((Usuario)((val != null) ? ((ItemsControl)val).Items[((Selector)val).SelectedIndex] : null));
ViewModel.EnableGrid = true;
}
}
}
private async void Permissoes_OnClick(object sender, RoutedEventArgs e)
{
if (!_abrindoPermissao)
{
PermissaoUsuario val = ((IEnumerable<PermissaoUsuario>)ViewModel.PermissaoUsuario).FirstOrDefault((Func<PermissaoUsuario, bool>)((PermissaoUsuario permissao) => (int)permissao.Tela == 43));
int num;
if (!Recursos.Usuario.Administrador && ((DomainBase)Recursos.Usuario).Id != 0L && !Recursos.Usuario.Nome.Contains("ACESSO AGGER") && val != null)
{
_ = val.Consultar;
num = ((!val.Consultar) ? 1 : 0);
}
else
{
num = 0;
}
bool flag = (byte)num != 0;
if (flag)
{
flag = await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR PERMISSÕES.");
}
if (!flag)
{
_abrindoPermissao = true;
await ViewModel.OpenPermissao();
await Task.Delay(1000);
_abrindoPermissao = false;
}
}
}
private async void Vinculo_OnClick(object sender, RoutedEventArgs e)
{
await ViewModel.OpenVinculo();
}
private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
{
if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)12).Consultar)
{
await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + ValidationHelper.GetDescription((Enum)(object)(TipoArquivoDigital)12) + ".");
return;
}
ViewModel.EnableAlterar = false;
FiltroArquivoDigital filtro = new FiltroArquivoDigital
{
Id = ((DomainBase)ViewModel.SelectedUsuario).Id,
Tipo = (TipoArquivoDigital)12,
Parente = ViewModel.SelectedUsuario
};
ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
ViewModel.EnableAlterar = true;
}
private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
{
ViewModel.AbrirLog((TipoTela)16, ((DomainBase)ViewModel.SelectedUsuario).Id);
}
private async void AbrirLogAcesso_OnClick(object sender, RoutedEventArgs e)
{
await ViewModel.ShowLogAcessoDialog((TipoTela)49, ViewModel.SelectedUsuario);
}
private async void TelaInicial_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_setting || ((Selector)(ComboBox)sender).SelectedItem == null)
{
return;
}
if ((int)(TipoTelaInicial)((Selector)(ComboBox)sender).SelectedItem == 1 && ViewModel.Restricao((TipoRestricao)47))
{
_setting = true;
((Selector)(ComboBox)sender).SelectedItem = (object)(TipoTelaInicial)0;
_setting = false;
if (_firstTime)
{
_firstTime = false;
return;
}
await ViewModel.ShowMessage("FAVOR DESABILITAR A RESTRIÇÃO AO PAINEL B.I. ANTES.");
}
_firstTime = false;
}
private void CpfBox_OnLostFocus(object sender, RoutedEventArgs e)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
TextBox val = (TextBox)sender;
val.Text = ValidationHelper.FormatDocument(val.Text);
}
private async void CriarCartao_OnClick(object sender, RoutedEventArgs e)
{
bool dadosUsuario = Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 30);
await ViewModel.CriarCartao(dadosUsuario);
}
private async void Click_VerificaAdmCentralSegurado(object sender, RoutedEventArgs e)
{
await ViewModel.VerificaUsuarioAdmCentralSegurado();
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent()
{
if (!_contentLoaded)
{
_contentLoaded = true;
Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/usuarioview.xaml", UriKind.Relative);
Application.LoadComponent((object)this, uri);
}
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
internal Delegate _CreateDelegate(Type delegateType, string handler)
{
return Delegate.CreateDelegate(delegateType, this, handler);
}
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
[EditorBrowsable(EditorBrowsableState.Never)]
void IComponentConnector.Connect(int connectionId, object target)
{
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Expected O, but got Unknown
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Expected O, but got Unknown
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Expected O, but got Unknown
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Expected O, but got Unknown
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Expected O, but got Unknown
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Expected O, but got Unknown
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Expected O, but got Unknown
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Expected O, but got Unknown
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Expected O, but got Unknown
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Expected O, but got Unknown
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Expected O, but got Unknown
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Expected O, but got Unknown
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: Expected O, but got Unknown
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Expected O, but got Unknown
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Expected O, but got Unknown
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Expected O, but got Unknown
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Expected O, but got Unknown
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Expected O, but got Unknown
//IL_0242: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Expected O, but got Unknown
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Expected O, but got Unknown
//IL_0271: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Expected O, but got Unknown
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Expected O, but got Unknown
//IL_029f: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Expected O, but got Unknown
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Expected O, but got Unknown
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Expected O, but got Unknown
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Expected O, but got Unknown
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0309: Expected O, but got Unknown
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Expected O, but got Unknown
//IL_0319: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Expected O, but got Unknown
//IL_0326: Unknown result type (might be due to invalid IL or missing references)
//IL_0330: Expected O, but got Unknown
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Expected O, but got Unknown
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Expected O, but got Unknown
//IL_034c: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Expected O, but got Unknown
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_037c: Expected O, but got Unknown
//IL_037d: Unknown result type (might be due to invalid IL or missing references)
//IL_038a: Unknown result type (might be due to invalid IL or missing references)
//IL_0394: Expected O, but got Unknown
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
//IL_03ad: Expected O, but got Unknown
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
//IL_03c6: Expected O, but got Unknown
//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
//IL_03de: Expected O, but got Unknown
//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
//IL_03f6: Expected O, but got Unknown
switch (connectionId)
{
case 1:
((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxUsuario_Populating);
((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
break;
case 2:
UsuarioGrid = (DataGrid)target;
break;
case 3:
((MenuItem)target).Click += new RoutedEventHandler(Incluir_OnClick);
break;
case 4:
((MenuItem)target).Click += new RoutedEventHandler(Alterar_OnClick);
break;
case 5:
((MenuItem)target).Click += new RoutedEventHandler(Salvar_OnClick);
break;
case 6:
CancelarApoliceButton = (MenuItem)target;
CancelarApoliceButton.Click += new RoutedEventHandler(Cancelar_OnClick);
break;
case 7:
((MenuItem)target).Click += new RoutedEventHandler(Excluir_OnClick);
break;
case 8:
((MenuItem)target).Click += new RoutedEventHandler(Permissoes_OnClick);
break;
case 9:
((MenuItem)target).Click += new RoutedEventHandler(Vinculo_OnClick);
break;
case 10:
((MenuItem)target).Click += new RoutedEventHandler(CriarCartao_OnClick);
break;
case 11:
((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
break;
case 12:
((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
break;
case 13:
((MenuItem)target).Click += new RoutedEventHandler(AbrirLogAcesso_OnClick);
break;
case 14:
NomeBox = (TextBox)target;
break;
case 15:
((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(CpfBox_OnLostFocus);
break;
case 16:
((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TelaInicial_OnSelectionChanged);
break;
case 17:
((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
break;
case 18:
((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
((UIElement)(DatePicker)target).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown);
break;
case 19:
((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBancoBox_Populating);
break;
case 20:
CepBox = (TextBox)target;
((UIElement)CepBox).LostFocus += new RoutedEventHandler(PostcodeBox_OnLostFocus);
((UIElement)CepBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
break;
case 21:
EnderecoBox = (TextBox)target;
break;
case 22:
NumeroBox = (TextBox)target;
break;
case 23:
BairroBox = (TextBox)target;
break;
case 24:
CidadeBox = (TextBox)target;
break;
case 25:
EstadoBox = (TextBox)target;
break;
case 26:
((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
break;
case 27:
((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
break;
case 28:
((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
break;
case 29:
((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
break;
case 30:
((ButtonBase)(ToggleButton)target).Click += new RoutedEventHandler(Click_VerificaAdmCentralSegurado);
break;
default:
_contentLoaded = true;
break;
}
}
}
|