summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
commit225aa1499e37faf9d38257caabbadc68d78b427e (patch)
tree102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs896
1 files changed, 896 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs b/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
new file mode 100644
index 0000000..a0715bd
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/VendedorView.cs
@@ -0,0 +1,896 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+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.Data;
+using System.Windows.Input;
+using System.Windows.Markup;
+using CurrencyTextBoxControl;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos;
+using Gestor.Application.Servicos.Ferramentas;
+using Gestor.Application.ViewModels.Ferramentas;
+using Gestor.Application.Views.Generic;
+using Gestor.Common.Helpers;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Common;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Xceed.Wpf.AvalonDock.Controls;
+
+namespace Gestor.Application.Views.Ferramentas;
+
+public class VendedorView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ public VendedorViewModel ViewModel;
+
+ internal DataGrid VendedorGrid;
+
+ internal MenuItem IncluirButton;
+
+ internal MenuItem AlterarButton;
+
+ internal MenuItem SalvarButton;
+
+ internal MenuItem CancelarButton;
+
+ internal MenuItem MaisOpcoesButton;
+
+ internal TextBox EmpresaBox;
+
+ internal TextBox IdBox;
+
+ internal TextBox NomeBox;
+
+ internal TextBox DocumentoPrincipalBox;
+
+ internal AutoCompleteBox AutoCompleteBanco;
+
+ internal TextBox AgenciaBox;
+
+ internal ComboBox TipoBox;
+
+ internal TextBox ContaBox;
+
+ internal TextBox TitularBox;
+
+ internal TextBox TitularDocBox;
+
+ internal ComboBox TipoIncidenciaDescontoBox;
+
+ internal ToggleButton AtivoBox;
+
+ internal Grid GridContatos;
+
+ private bool _contentLoaded;
+
+ public bool UpdatingScroll { get; set; }
+
+ public VendedorView()
+ {
+ ((FrameworkElement)this).Tag = "CADASTRO DE VENDEDOR";
+ ViewModel = new VendedorViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ }
+
+ private void Incluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Incluir();
+ AutoCompleteBanco.Text = "";
+ ValidarTela();
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.CancelarAlteracao();
+ ViewModel.IsExpanded = true;
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ AlterarPropriaCorretora();
+ }
+ }
+
+ private async void Salvar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Loading(isLoading: true);
+ ViewModel.IsExpanded = true;
+ if (!ViewModel.SelectedVendedor.Ativo && await BuscaVinculo(ViewModel.SelectedVendedor))
+ {
+ return;
+ }
+ 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)
+ {
+ if (((DomainBase)Recursos.Usuario).Id == 0L)
+ {
+ AlterarPropriaCorretora();
+ }
+ ScrollVendedor();
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private async Task<bool> BuscaVinculo(Vendedor vendedor)
+ {
+ if (!(await new VendedorUsuarioServico().FindVinculo(vendedor)))
+ {
+ return false;
+ }
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL INATIVAR VENDEDOR QUE POSSUI VINCULO DE USUÁRIO.");
+ ViewModel.Loading(isLoading: false);
+ return true;
+ }
+
+ private async void Adiantamento_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null && ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ADICIONAR ADIANTAMENTOS PARA O VENDEDOR PRÓPRIA CORRETORA.");
+ }
+ else
+ {
+ ViewModel.ShowDrawer(new AdiantamentoDrawerView(ViewModel.SelectedVendedor), 0, close: false);
+ }
+ }
+
+ private void IncluirRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirRepasse();
+ ValidarTela();
+ }
+
+ private void IncluirTelefone_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.IncluirTelefone();
+ ValidarTela();
+ }
+
+ private void ExcluirTelefone_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_002e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0034: Expected O, but got Unknown
+ Button val = (Button)((sender is Button) ? sender : null);
+ if (val != null)
+ {
+ ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
+ VendedorTelefone telefone = (VendedorTelefone)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
+ ViewModel.ExcluirTelefone(telefone);
+ }
+ }
+
+ private async void Alterar_OnClick(object sender, RoutedEventArgs e)
+ {
+ Vendedor selectedVendedor = ViewModel.SelectedVendedor;
+ bool flag = selectedVendedor != null && selectedVendedor.Corretora;
+ if (flag)
+ {
+ if (((DomainBase)Recursos.Usuario).Id != 0L)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ AlterarPropriaCorretora(habilitar: true);
+ }
+ ViewModel.IsExpanded = false;
+ VendedorViewModel viewModel = ViewModel;
+ Vendedor selectedVendedor2 = ViewModel.SelectedVendedor;
+ viewModel.CancelVendedor = (Vendedor)((selectedVendedor2 != null) ? ((DomainBase)selectedVendedor2).Clone() : null);
+ if (!flag)
+ {
+ ViewModel.Alterar(alterar: true);
+ }
+ ValidarTela();
+ }
+
+ public async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null && ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL CRIAR METAS DE VENDEDOR PARA O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ if (await ViewModel.VerificarPermissao((TipoTela)30))
+ {
+ ViewModel.ShowDrawer(new MetaVendedorView(ViewModel.SelectedVendedor), 0, close: false);
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void TipoBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0036: Expected O, but got Unknown
+ //IL_004a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0050: Expected O, but got Unknown
+ //IL_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0067: Expected O, but got Unknown
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0072: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0080: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0083: Invalid comparison between Unknown and I4
+ //IL_0085: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0088: Invalid comparison between Unknown and I4
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem == null)
+ {
+ return;
+ }
+ ListBoxItem val2 = ((DependencyObject)(object)val).FindAncestor<ListBoxItem>().FirstOrDefault();
+ if (val2 == null)
+ {
+ return;
+ }
+ ComboBox val3 = (ComboBox)((FrameworkElement)FindVisualChild.Find<ComboBox>((DependencyObject)(object)val2)).FindName("FormaPagtoBox");
+ if (val3 == null)
+ {
+ return;
+ }
+ CurrencyTextBox val4 = (CurrencyTextBox)((FrameworkElement)FindVisualChild.Find<CurrencyTextBox>((DependencyObject)(object)val2)).FindName("ValorBox");
+ CurrencyTextBox val5 = (CurrencyTextBox)((FrameworkElement)FindVisualChild.Find<CurrencyTextBox>((DependencyObject)(object)val2)).FindName("RenovacoesBox");
+ TipoRepasse val6 = (TipoRepasse)((Selector)val).SelectedItem;
+ ((Selector)val3).SelectedItem = (object)(FormaRepasse)1;
+ if ((int)val6 != 1)
+ {
+ if ((int)val6 == 2)
+ {
+ if (val4 != null)
+ {
+ val4.MaximumValue = 100m;
+ }
+ if (val5 != null)
+ {
+ val5.MaximumValue = 100m;
+ }
+ }
+ }
+ else
+ {
+ if (val4 != null)
+ {
+ val4.MaximumValue = 10000m;
+ }
+ if (val5 != null)
+ {
+ val5.MaximumValue = 10000m;
+ }
+ }
+ }
+
+ private void FormaPagtoBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0036: Expected O, but got Unknown
+ //IL_003c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0041: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0061: Expected I4, but got Unknown
+ ComboBox val = (ComboBox)sender;
+ if (((Selector)val).SelectedItem == null)
+ {
+ return;
+ }
+ Grid val2 = ((DependencyObject)(object)val).FindAncestor<Grid>().FirstOrDefault();
+ if (val2 == null)
+ {
+ return;
+ }
+ ComboBox val3 = (ComboBox)((FrameworkElement)FindVisualChild.Find<ComboBox>((DependencyObject)(object)val2)).FindName("BasePagtoBox");
+ FormaRepasse val4 = (FormaRepasse)((Selector)val).SelectedItem;
+ if (val3 != null)
+ {
+ ((UIElement)val3).IsEnabled = true;
+ switch (val4 - 1)
+ {
+ case 0:
+ ((Selector)val3).SelectedItem = null;
+ break;
+ case 1:
+ ((Selector)val3).SelectedItem = (object)(BaseRepasse)1;
+ break;
+ case 2:
+ ((Selector)val3).SelectedItem = (object)(BaseRepasse)3;
+ ((UIElement)val3).IsEnabled = false;
+ break;
+ }
+ }
+ }
+
+ 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 void AutoCompleteBoxVendedor_Populating(object sender, PopulatingEventArgs e)
+ {
+ e.Cancel = true;
+ ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task<List<Vendedor>> 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.FiltrarVendedor("");
+ }
+ }
+
+ private async void AbrirAquivoDigital_Click(object sender, RoutedEventArgs e)
+ {
+ if (!new PermissaoArquivoDigitalServico().BuscarPermissao(Recursos.Usuario, (TipoArquivoDigital)6).Consultar)
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR\nARQUIVO DIGITAL DE " + EnumHelper.GetDescription<TipoArquivoDigital>((TipoArquivoDigital)6) + ".");
+ return;
+ }
+ FiltroArquivoDigital filtro = new FiltroArquivoDigital
+ {
+ Id = ((DomainBase)ViewModel.SelectedVendedor).Id,
+ Tipo = (TipoArquivoDigital)6,
+ Parente = ViewModel.SelectedVendedor
+ };
+ ViewModel.ShowDrawer(new ArquivoDigitalDrawer(filtro), 0, close: false);
+ }
+
+ private void AbrirLog_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLog((TipoTela)15, ((DomainBase)ViewModel.SelectedVendedor).Id);
+ }
+
+ private void AbrirLogEmail_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.AbrirLogEmail((TipoTela)15, ((DomainBase)ViewModel.SelectedVendedor).Id);
+ }
+
+ private async void IncluirVinculo_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button btn = (Button)sender;
+ if (((btn != null) ? ((FrameworkElement)btn).DataContext : null) == null)
+ {
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ List<Repasse> repasses = await new VendedorServico().BuscaRepasses();
+ Repasse repasse = (Repasse)((FrameworkElement)btn).DataContext;
+ VinculoRepasse vinculo = new VinculoRepasse
+ {
+ IdRepasse = ((DomainBase)repasse).Id
+ };
+ if (!repasse.Ativo)
+ {
+ await ViewModel.ShowMessage("POR FAVOR, ATIVE O REPASSE PARA VINCULÁ-LO");
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ VinculoRepasse response = await ViewModel.ShowVinculoDialog(vinculo, repasses, repasse);
+ if (response == null)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ List<KeyValuePair<string, string>> list = response.Validate(repasse.Vinculo, repasse);
+ while (list != null && list.Count > 0)
+ {
+ await ViewModel.ShowMessage(list, "OS CAMPOS ABAIXO ESTÃO INVÁLIDOS.", "OK");
+ response = await ViewModel.ShowVinculoDialog(response, repasses, repasse);
+ if (response == null)
+ {
+ ViewModel.Loading(isLoading: false);
+ return;
+ }
+ list = response.Validate(repasse.Vinculo, repasse);
+ }
+ await ViewModel.SalvarVinculo(response);
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private async void ExcluirVinculo_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button val = (Button)sender;
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ VinculoRepasse vinculo = (VinculoRepasse)((FrameworkElement)val).DataContext;
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.ExcluirVinculo(vinculo);
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void AbrirLogRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Expected O, but got Unknown
+ //IL_0019: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001f: Expected O, but got Unknown
+ Button val = (Button)sender;
+ if (val != null && ((FrameworkElement)val).DataContext != null)
+ {
+ Repasse val2 = (Repasse)((FrameworkElement)val).DataContext;
+ ViewModel.AbrirLog((TipoTela)54, ((DomainBase)val2).Id);
+ }
+ }
+
+ private void DocumentoPrincipalBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ if (!((TextBoxBase)(TextBox)sender).IsReadOnly)
+ {
+ string text = ValidationHelper.Clear(DocumentoPrincipalBox.Text);
+ if (!string.IsNullOrEmpty(text))
+ {
+ DocumentoPrincipalBox.Text = ((text.Length == 11) ? ValidationHelper.FormatDocument(text.PadLeft(11, '0').Substring(0, 11)) : ValidationHelper.FormatDocument(text.PadLeft(14, '0').Substring(0, 14)));
+ }
+ }
+ }
+
+ private void AutoCompleteBanco_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs 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)
+ //IL_002e: Expected O, but got Unknown
+ AutoCompleteBox val = (AutoCompleteBox)sender;
+ SetValid(val, string.IsNullOrWhiteSpace(val.Text) || ViewModel.SelectedVendedor.Banco != null);
+ }
+
+ private static void SetValid(AutoCompleteBox autocomplete, bool valid)
+ {
+ ViewHelper.SetInvalid((Control)(object)autocomplete, "BANCO INVÁLIDO", valid);
+ }
+
+ private void ValidarTela()
+ {
+ if (ViewModel.SelectedVendedor != null)
+ {
+ List<KeyValuePair<string, string>> list = ViewModel.SelectedVendedor.Validate();
+ List<VendedorTelefone> telefones = ViewModel.SelectedVendedor.Telefones;
+ object obj;
+ if (telefones == null)
+ {
+ obj = null;
+ }
+ else
+ {
+ VendedorTelefone? obj2 = telefones.FirstOrDefault();
+ obj = ((obj2 != null) ? obj2.Validate() : null);
+ }
+ if (obj == null)
+ {
+ obj = new List<KeyValuePair<string, string>>();
+ }
+ list.AddRange((IEnumerable<KeyValuePair<string, string>>)obj);
+ ObservableCollection<Repasse> repasses = ViewModel.Repasses;
+ object obj3;
+ if (repasses == null)
+ {
+ obj3 = null;
+ }
+ else
+ {
+ Repasse? obj4 = repasses.FirstOrDefault();
+ obj3 = ((obj4 != null) ? obj4.Validate() : null);
+ }
+ if (obj3 == null)
+ {
+ obj3 = new List<KeyValuePair<string, string>>();
+ }
+ list.AddRange((IEnumerable<KeyValuePair<string, string>>)obj3);
+ ((DependencyObject)(object)this).ValidateFields(list, focusField: false);
+ }
+ }
+
+ private void VendedorView_SizeChanged(object sender, SizeChangedEventArgs 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)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0028: Unknown result type (might be due to invalid IL or missing references)
+ Size newSize = e.NewSize;
+ if (((Size)(ref newSize)).Width > 1260.0)
+ {
+ ViewModel.GridHeight2 = new GridLength(0.0);
+ Grid.SetRow((UIElement)(object)GridContatos, 0);
+ Grid.SetColumn((UIElement)(object)GridContatos, 1);
+ }
+ else
+ {
+ ViewModel.GridHeight2 = new GridLength(1.0, (GridUnitType)2);
+ Grid.SetRow((UIElement)(object)GridContatos, 1);
+ Grid.SetColumn((UIElement)(object)GridContatos, 0);
+ }
+ }
+
+ private async void AtivarInativarVendedor_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor != null)
+ {
+ if (ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ }
+ else if (!(await BuscaVinculo(ViewModel.SelectedVendedor)))
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.AtivarInativarVendedor(ViewModel.SelectedVendedor);
+ ScrollVendedor();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+ }
+
+ private async void AtivarInativarRepasse_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.SelectedVendedor.Corretora)
+ {
+ await ViewModel.ShowMessage("NÃO É POSSÍVEL ALTERAR O VENDEDOR PRÓPRIA CORRETORA.");
+ return;
+ }
+ Repasse val = (Repasse)((FrameworkElement)(Button)sender).DataContext;
+ if (val != null)
+ {
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.AtivarInativarRepasse(val);
+ ScrollVendedor();
+ ViewModel.Loading(isLoading: false);
+ }
+ }
+
+ private void ScrollVendedor()
+ {
+ if (!UpdatingScroll && ((Selector)VendedorGrid).SelectedItem != null)
+ {
+ VendedorGrid.ScrollIntoView(((Selector)VendedorGrid).SelectedItem);
+ }
+ UpdatingScroll = false;
+ }
+
+ public void AlterarPropriaCorretora(bool habilitar = false)
+ {
+ if (habilitar)
+ {
+ ((TextBoxBase)NomeBox).IsReadOnly = false;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = false;
+ ((UIElement)AlterarButton).IsEnabled = false;
+ ((UIElement)SalvarButton).IsEnabled = true;
+ ((UIElement)CancelarButton).IsEnabled = true;
+ ((UIElement)IncluirButton).IsEnabled = false;
+ }
+ else
+ {
+ ((TextBoxBase)NomeBox).IsReadOnly = true;
+ ((TextBoxBase)DocumentoPrincipalBox).IsReadOnly = true;
+ ((UIElement)AlterarButton).IsEnabled = true;
+ ((UIElement)SalvarButton).IsEnabled = false;
+ ((UIElement)CancelarButton).IsEnabled = false;
+ ((UIElement)IncluirButton).IsEnabled = false;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/vendedorview.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_0096: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ac: Expected O, but got Unknown
+ //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c3: Expected O, but got Unknown
+ //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d0: Expected O, but got Unknown
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Expected O, but got Unknown
+ //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0101: Expected O, but got Unknown
+ //IL_010e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0118: Expected O, but got Unknown
+ //IL_011b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0125: Expected O, but got Unknown
+ //IL_0132: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013c: Expected O, but got Unknown
+ //IL_013f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0149: Expected O, but got Unknown
+ //IL_0156: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0160: Expected O, but got Unknown
+ //IL_0162: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0178: Expected O, but got Unknown
+ //IL_017a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0186: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0190: Expected O, but got Unknown
+ //IL_0192: Unknown result type (might be due to invalid IL or missing references)
+ //IL_019e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a8: Expected O, but got Unknown
+ //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01b5: Expected O, but got Unknown
+ //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01cd: Expected O, but got Unknown
+ //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01db: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01e5: Expected O, but got Unknown
+ //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f2: Expected O, but got Unknown
+ //IL_01f5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ff: Expected O, but got Unknown
+ //IL_0202: Unknown result type (might be due to invalid IL or missing references)
+ //IL_020c: Expected O, but got Unknown
+ //IL_020f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0219: Expected O, but got Unknown
+ //IL_0227: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0231: Expected O, but got Unknown
+ //IL_023e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0248: Expected O, but got Unknown
+ //IL_024b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0255: Expected O, but got Unknown
+ //IL_0262: Unknown result type (might be due to invalid IL or missing references)
+ //IL_026c: Expected O, but got Unknown
+ //IL_0279: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0283: Expected O, but got Unknown
+ //IL_0286: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0290: Expected O, but got Unknown
+ //IL_0293: Unknown result type (might be due to invalid IL or missing references)
+ //IL_029d: Expected O, but got Unknown
+ //IL_02a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02aa: Expected O, but got Unknown
+ //IL_02ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b7: Expected O, but got Unknown
+ //IL_02ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02c4: Expected O, but got Unknown
+ //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02dc: Expected O, but got Unknown
+ //IL_02df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02e9: Expected O, but got Unknown
+ //IL_02ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f6: Expected O, but got Unknown
+ //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0304: Unknown result type (might be due to invalid IL or missing references)
+ //IL_030e: Expected O, but got Unknown
+ //IL_0310: Unknown result type (might be due to invalid IL or missing references)
+ //IL_031c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0326: Expected O, but got Unknown
+ //IL_0329: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0333: Expected O, but got Unknown
+ //IL_0335: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0341: Unknown result type (might be due to invalid IL or missing references)
+ //IL_034b: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxVendedor_Populating);
+ ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged);
+ break;
+ case 2:
+ VendedorGrid = (DataGrid)target;
+ break;
+ case 3:
+ IncluirButton = (MenuItem)target;
+ IncluirButton.Click += new RoutedEventHandler(Incluir_OnClick);
+ break;
+ case 4:
+ AlterarButton = (MenuItem)target;
+ AlterarButton.Click += new RoutedEventHandler(Alterar_OnClick);
+ break;
+ case 5:
+ SalvarButton = (MenuItem)target;
+ SalvarButton.Click += new RoutedEventHandler(Salvar_OnClick);
+ break;
+ case 6:
+ CancelarButton = (MenuItem)target;
+ CancelarButton.Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 7:
+ ((MenuItem)target).Click += new RoutedEventHandler(Adiantamento_Click);
+ break;
+ case 8:
+ ((MenuItem)target).Click += new RoutedEventHandler(Button_Click);
+ break;
+ case 9:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirAquivoDigital_Click);
+ break;
+ case 10:
+ MaisOpcoesButton = (MenuItem)target;
+ break;
+ case 11:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLog_OnClick);
+ break;
+ case 12:
+ ((MenuItem)target).Click += new RoutedEventHandler(AbrirLogEmail_OnClick);
+ break;
+ case 13:
+ EmpresaBox = (TextBox)target;
+ break;
+ case 14:
+ IdBox = (TextBox)target;
+ break;
+ case 15:
+ NomeBox = (TextBox)target;
+ break;
+ case 16:
+ DocumentoPrincipalBox = (TextBox)target;
+ ((UIElement)DocumentoPrincipalBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ ((UIElement)DocumentoPrincipalBox).LostFocus += new RoutedEventHandler(DocumentoPrincipalBox_LostFocus);
+ break;
+ case 17:
+ AutoCompleteBanco = (AutoCompleteBox)target;
+ AutoCompleteBanco.Populating += new PopulatingEventHandler(AutoCompleteBancoBox_Populating);
+ ((UIElement)AutoCompleteBanco).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(AutoCompleteBanco_OnLostKeyboardFocus);
+ break;
+ case 18:
+ AgenciaBox = (TextBox)target;
+ break;
+ case 19:
+ TipoBox = (ComboBox)target;
+ break;
+ case 20:
+ ContaBox = (TextBox)target;
+ break;
+ case 21:
+ TitularBox = (TextBox)target;
+ break;
+ case 22:
+ TitularDocBox = (TextBox)target;
+ ((UIElement)TitularDocBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 23:
+ TipoIncidenciaDescontoBox = (ComboBox)target;
+ break;
+ case 24:
+ AtivoBox = (ToggleButton)target;
+ break;
+ case 25:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtivarInativarVendedor_OnClick);
+ break;
+ case 26:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirRepasse_OnClick);
+ break;
+ case 33:
+ GridContatos = (Grid)target;
+ break;
+ case 34:
+ ((MenuItem)target).Click += new RoutedEventHandler(IncluirTelefone_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0043: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004d: Expected O, but got Unknown
+ //IL_004f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0065: Expected O, but got Unknown
+ //IL_0067: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0073: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Expected O, but got Unknown
+ //IL_007f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: Expected O, but got Unknown
+ //IL_0097: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ad: Expected O, but got Unknown
+ //IL_00af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c5: Expected O, but got Unknown
+ //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dd: Expected O, but got Unknown
+ //IL_00df: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Expected O, but got Unknown
+ //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0105: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010f: Expected O, but got Unknown
+ //IL_0110: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0127: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 27:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(IncluirVinculo_OnClick);
+ break;
+ case 28:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirLogRepasse_OnClick);
+ break;
+ case 29:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(TipoBox_OnSelectionChanged);
+ break;
+ case 30:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(FormaPagtoBox_OnSelectionChanged);
+ break;
+ case 31:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AtivarInativarRepasse_OnClick);
+ break;
+ case 32:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirVinculo_OnClick);
+ break;
+ case 35:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirTelefone_OnClick);
+ break;
+ case 36:
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 37:
+ ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(FormatarTelefone);
+ ((UIElement)(TextBox)target).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
+ break;
+ case 33:
+ case 34:
+ break;
+ }
+ }
+}