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.Data; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Threading; using CurrencyTextBoxControl; using Gestor.Application.Actions; using Gestor.Application.Componentes; using Gestor.Application.Drawers.Relatorios; using Gestor.Application.Helpers; using Gestor.Application.ViewModels.Relatorios; using Gestor.Application.Views.Ferramentas; using Gestor.Application.Views.Generic; using Gestor.Common.Helpers; using Gestor.Common.Validation; using Gestor.Model.API; using Gestor.Model.Common; using Gestor.Model.Domain.Configuracoes; using Gestor.Model.Domain.Ferramentas; using Gestor.Model.Domain.Generic; using Gestor.Model.Domain.MalaDireta; using Gestor.Model.Domain.Relatorios; using Gestor.Model.Domain.Relatorios.ApolicePendente; using Gestor.Model.Domain.Relatorios.Auditoria; using Gestor.Model.Domain.Relatorios.Classificacao; using Gestor.Model.Domain.Relatorios.ClientesAtivosInativos; using Gestor.Model.Domain.Relatorios.Comissao; using Gestor.Model.Domain.Relatorios.CriticaApolice; using Gestor.Model.Domain.Relatorios.EndossoCancelamento; using Gestor.Model.Domain.Relatorios.ExtratoBaixado; using Gestor.Model.Domain.Relatorios.FaturaPendente; using Gestor.Model.Domain.Relatorios.Licenciamento; using Gestor.Model.Domain.Relatorios.Log; using Gestor.Model.Domain.Relatorios.LogsEnvio; using Gestor.Model.Domain.Relatorios.MetaSeguradora; using Gestor.Model.Domain.Relatorios.MetaVendedor; using Gestor.Model.Domain.Relatorios.NotaFiscal; using Gestor.Model.Domain.Relatorios.Pendente; using Gestor.Model.Domain.Relatorios.Placa; using Gestor.Model.Domain.Relatorios.Producao; using Gestor.Model.Domain.Relatorios.Renovacao; using Gestor.Model.Domain.Relatorios.Sinistro; using Gestor.Model.Domain.Relatorios.Tarefa; using Gestor.Model.Domain.Seguros; using MaterialDesignThemes.Wpf; using Xceed.Wpf.AvalonDock.Controls; namespace Gestor.Application.Views.Relatorios; public class RelatorioView : BaseUserControl, IComponentConnector, IStyleConnector { internal RelatorioViewModel ViewModel; internal Image ProgressRing; internal ComboBox RelatorioBox; internal CurrencyTextBox ValorInicioBox; internal CurrencyTextBox ValorFimBox; internal DatePicker InicioBox; internal DatePicker FimBox; internal ToggleButton VisualizarRamosVendedoresTooltip; internal MenuItem GerarRelatorioButton; internal ComboBox RamoBox; internal ContentControl ReportControl; internal WebEditor WebEditor; internal PopupBox HelpPopup; internal TextBlock NaoHaDados; private bool _contentLoaded; public RelatorioView(string opcao) { ViewModel = new RelatorioViewModel(opcao); ((FrameworkElement)this).DataContext = ViewModel; InitializeComponent(); Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher; if (dispatcher != null) { dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad)); } ViewModel.Head = Recursos.Usuario.Nome + ", VOCÊ ESTÁ EM RELATÓRIOS"; Gestor.Application.Actions.Actions.RecarregarRelatorios = (Action)Delegate.Combine(Gestor.Application.Actions.Actions.RecarregarRelatorios, new Action(Recarregar)); } private void Recarregar(string sessao) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (!(ViewModel.Sessao != sessao)) { GerarResultados_OnClick(GerarRelatorioButton, new RoutedEventArgs()); } } private void ContentLoad() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((UIElement)InicioBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); InicioBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((UIElement)FimBox).PreviewKeyDown += new KeyEventHandler(base.DatePicker_PreviewKeyDown); FimBox.SelectedDateChanged += Periodo_OnSelectedDateChanged; ((Selector)RelatorioBox).SelectionChanged += new SelectionChangedEventHandler(TipoRelatorio_OnSelectionChanged); } private async void GerarResultados_OnClick(object sender, RoutedEventArgs e) { InicioBox.Text = ValidationHelper.FormatDate(InicioBox.Text); FimBox.Text = ValidationHelper.FormatDate(FimBox.Text); try { ViewModel.Inicio = Convert.ToDateTime(InicioBox.Text); ViewModel.Fim = Convert.ToDateTime(FimBox.Text); } catch (Exception) { return; } if (ViewModel.Inicio > ViewModel.Fim) { await ViewModel.ShowMessage("A DATA FINAL NÃO PODE SER MENOR QUE A DATA INICIAL DO FILTRO."); return; } if (((CollectionView)((ItemsControl)RelatorioBox).Items).Count == 0) { await ViewModel.ShowMessage("NÃO HÁ RELATÓRIOS QUE VOCÊ POSSA GERAR."); return; } if (ViewModel.InicioValor > ViewModel.FimValor) { await ViewModel.ShowMessage("O VALOR FINAL NÃO PODE SER MENOR QUE O VALOR INICIAL DO FILTRO."); return; } ViewModel.Carregando = true; ViewModel.IsEnabled = false; ViewModel.VisibilityHtml = false; if (ViewModel.Report != null) { ViewModel.Report = null; } ViewModel.LimparRelatorio(); if (!(await ViewModel.GerarRelatorio(ViewModel.Inicio, ViewModel.Fim))) { ((UIElement)NaoHaDados).Visibility = (Visibility)0; ((UIElement)ReportControl).Visibility = (Visibility)2; ViewModel.IsEnabled = true; ViewModel.ExtratosEnabled = false; ViewModel.Carregando = false; ViewModel.VisibilityHtml = false; return; } ((FrameworkElement)ReportControl).DataContext = ViewModel; Relatorio relatorioTipo = ViewModel.Relatorio; GridRelatorio gridRelatorio = new GridRelatorio(ViewModel); switch ((int)relatorioTipo) { case 3: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ApolicePendenteFiltrado; break; case 17: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.LicenciamentoFiltrado; break; case 27: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.PlacaFiltrado; break; case 18: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.TarefaFiltrado; break; case 2: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ProducaoFiltrado; break; case 4: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.RenovacaoFiltrado; break; case 5: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ComissaoFiltrado; break; case 6: case 16: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.PendenteFiltrado; break; case 9: case 10: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.SinistroFiltrado; break; case 23: ((UIElement)gridRelatorio.Totalizacao).Visibility = (Visibility)2; await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.LogsEnvioFiltrado; break; case 0: case 1: ViewModel.NovosNegocios = (int)relatorioTipo == 0; await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ClientesAtivosInativosFiltrado; break; case 7: case 11: case 20: WebEditor.Initialize(ViewModel.HtmlContent); break; case 8: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.AuditoriaFiltrado; break; case 13: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ExtratosFiltrado; break; case 12: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.FaturaPendenteFiltrado; break; case 14: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.MetaSeguradoraFiltrado; break; case 15: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.MetaVendedorFiltrado; break; case 19: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.NotaFiscalFiltrado; break; case 24: case 25: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.LogUtilizacaoFiltrado; break; case 26: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.ApoliceCriticaFiltrado; break; case 28: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.EndossoFiltrado; break; case 29: await gridRelatorio.DataGrid.ContruirLista(ViewModel.Relatorio); ((ItemsControl)gridRelatorio.DataGrid).ItemsSource = ViewModel.Classificacao; break; } gridRelatorio.SinteticoGrid.ItemsSource = ViewModel.Sintetic; ViewModel.Report = (((int)relatorioTipo == 11 || (int)relatorioTipo == 7 || (int)relatorioTipo == 20) ? null : gridRelatorio); ViewModel.VisibilityHtml = (int)relatorioTipo == 11 || (int)relatorioTipo == 7 || (int)relatorioTipo == 20; ((UIElement)NaoHaDados).Visibility = (Visibility)2; ((UIElement)ReportControl).Visibility = (Visibility)0; ViewModel.RelatorioVisibility = true; ViewModel.IsEnabled = true; ViewModel.ExtratosEnabled = true; ViewModel.Carregando = false; } private async void Imprimir_OnClick(object sender, RoutedEventArgs e) { bool flag = ((int)ViewModel.VisibilityAgrupamento == 0 && (int)ViewModel.Agrupamento != 0) || ViewModel.NotaFiscalPorSeguradora; if (flag) { flag = await ViewModel.ShowMessage("DESEJA SEPARAR GRUPOS POR PÁGINA?", "SIM", "NÃO"); } bool pageBreak = flag; ViewModel.Carregando = true; ViewModel.IsEnabled = false; bool html = ViewModel.VisibilityHtml; if (html) { ViewModel.VisibilityHtml = false; } await ViewModel.Print(pageBreak); if (html) { ViewModel.VisibilityHtml = true; } ViewModel.Carregando = false; ViewModel.IsEnabled = true; if ((int)ViewModel.Relatorio == 7 || (int)ViewModel.Relatorio == 20) { ((UIElement)WebEditor).Visibility = (Visibility)0; } } private async void Sintetico_OnClick(object sender, RoutedEventArgs e) { if ((int)ViewModel.Relatorio == 7 || (int)ViewModel.Agrupamento != 0 || (int)ViewModel.Relatorio == 11) { await ViewModel.Sintetico(); } else { await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR UM AGRUPAMENTO PARA SINTETIZAR OS RESULTADOS."); } } private void MaisFiltros_OnClick(object sender, RoutedEventArgs e) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if ((int)ViewModel.Relatorio == 24 || (int)ViewModel.Relatorio == 25) { ViewModel.VisibilityUsuarios = true; return; } ViewModel.Seguradoras = new List(ViewModel.Seguradoras); ViewModel.Ramos = new List(ViewModel.Ramos); ViewModel.Vendedores = new List(ViewModel.Vendedores); ViewModel.Produtos = new List(ViewModel.Produtos); ViewModel.Estipulantes = new List(ViewModel.Estipulantes); ViewModel.TipoSeguros = new List(ViewModel.TipoSeguros); ViewModel.RecheckAllLists(); ViewModel.ShowDrawer(new FiltroRelatorio(ViewModel, ViewModel.Relatorio), 0, close: false); } private void Periodo_OnSelectedDateChanged(object sender, SelectionChangedEventArgs e) { LimparRelatorio(); } private void LimparRelatorio() { ViewModel.LimparRelatorio(); if (ReportControl != null) { ReportControl.Content = null; ((FrameworkElement)ReportControl).DataContext = null; } } private async void ShowHelp(Relatorio relatorio) { if (!(await ViewModel.VerificarRestricao((TipoRestricao)61, root: true, showmessage: false))) { ((UIElement)HelpPopup).Visibility = (Visibility)2; return; } bool flag = true; if (HelpPopup != null) { ((UIElement)HelpPopup).Visibility = (Visibility)((!flag) ? 2 : 0); } } private void TipoRelatorio_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected I4, but got Unknown LimparRelatorio(); VisualizarRamosVendedoresTooltip.IsChecked = false; Relatorio relatorio = ViewModel.Relatorio; if (NaoHaDados != null) { ((UIElement)NaoHaDados).Visibility = (Visibility)2; } ShowHelp(relatorio); switch ((int)relatorio) { case 0: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 8: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 1: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 2: ViewModel.PlanilhaVisibility = (Visibility)0; break; case 3: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 4: ViewModel.PlanilhaVisibility = (Visibility)0; break; case 5: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 6: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 7: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 9: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 10: ViewModel.PlanilhaVisibility = (Visibility)2; break; case 11: ViewModel.PlanilhaVisibility = (Visibility)2; ViewModel.Info = ""; ViewModel.InfoVisibility = (Visibility)2; break; case 13: ViewModel.VisibilityAgrupamento = (Visibility)2; ViewModel.PlanilhaVisibility = (Visibility)2; break; case 23: ViewModel.VisibilityAgrupamento = (Visibility)2; ViewModel.PlanilhaVisibility = (Visibility)2; break; case 12: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: break; } } private async void ExportarExcel_OnClick(object sender, RoutedEventArgs e) { ViewModel.Carregando = true; ViewModel.IsEnabled = false; await ViewModel.GerarExcel(); ViewModel.IsEnabled = true; ViewModel.Carregando = false; } private async void Tarefas_OnClick(object sender, RoutedEventArgs e) { if (!(await ViewModel.ValidateTarefa())) { Tarefa data = new Tarefa { Entidade = (TipoTarefa)1, Titulo = EnumHelper.GetDescription(ViewModel.Relatorio), Usuario = Recursos.Usuario, Agendamento = Funcoes.GetNetworkTime() }; await AbrirTarefa(data); } } private async Task AbrirTarefa(Tarefa data) { ViewModel.IsEnabled = false; ViewModel.Carregando = true; Tarefa tarefa; while (true) { tarefa = await ViewModel.ShowTarefaDialog(data, nota: true); if (tarefa == null) { ViewModel.IsEnabled = true; ViewModel.Carregando = false; return; } if (tarefa.Usuario == null) { tarefa.Usuario = tarefa.UsuariosVinculados.FirstOrDefault(); } List responsaveis = ((IEnumerable)tarefa.UsuariosVinculados).Select((Func)((Usuario x) => new ResponsavelTarefa { IdTarefa = ((DomainBase)tarefa).Id, Usuario = x })).ToList(); tarefa.Responsaveis = responsaveis; tarefa.Anotacoes = "

" + tarefa.Anotacoes + "

"; tarefa.AgendamentoRetroativo = Recursos.Configuracoes.Any((ConfiguracaoSistema x) => (int)x.Configuracao == 45); List> list = tarefa.Validate(); if (string.IsNullOrWhiteSpace(tarefa.Anotacoes)) { list.Add(new KeyValuePair("ANOTAÇÕES", "OBRIGATÓRIO")); } if (list == null || list.Count == 0) { break; } await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK"); } List list2 = ViewModel.GerarTarefas(tarefa); if (list2 == null || list2.Count == 0) { ViewModel.IsEnabled = true; ViewModel.Carregando = false; await ViewModel.ShowMessage("FALHA AO CRIAR TAREFA."); } else { await ViewModel.SalvarTarefas(list2); ViewModel.ToggleSnackBar("TAREFA SALVA COM SUCESSO."); ViewModel.Alterar(alterar: false); ViewModel.IsEnabled = true; ViewModel.Carregando = false; } } private async void Acompanhamento_OnClick(object sender, RoutedEventArgs e) { await ViewModel.Acompanhamento(); } private async void Email_OnClick(object sender, RoutedEventArgs e) { ViewModel.Loading(isLoading: true); List list = await ViewModel.CriarLista(); if (list == null || list.Count == 0) { await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR AO MENOS UM CLIENTE PARA PROSSEGUIR."); ViewModel.Loading(isLoading: false); return; } if (Funcoes.IsWindowOpen("ENVIO DE E-MAIL")) { Funcoes.Destroy("ENVIO DE E-MAIL"); } ViewModel.Loading(isLoading: false); ((Window)new HosterWindow((ContentControl)(object)new MalaDiretaView(list), "ENVIO DE E-MAIL", 1200.0, 600.0, canMaximize: true)).Show(); } private async void Etiquetas_OnClick(object sender, RoutedEventArgs e) { ViewModel.Loading(isLoading: true); List list = await ViewModel.CriarListaEtiqueta(); if (list == null || list.Count == 0) { await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR AO MENOS UM CLIENTE PARA PROSSEGUIR."); ViewModel.Loading(isLoading: false); } else if (!Funcoes.IsWindowOpen("ETIQUETAS")) { bool apenasCliente = (int)ViewModel.Relatorio == 0 || (int)ViewModel.Relatorio == 1; ViewModel.Loading(isLoading: false); ((Window)new HosterWindow((ContentControl)(object)new EtiquetaView(list, apenasCliente), "ETIQUETAS", 900.0, 600.0)).Show(); } } private void Extrato_OnClick(object sender, RoutedEventArgs e) { ViewModel.ExibirExtratoDrawer(); } private void Protocolo_OnClick(object sender, RoutedEventArgs e) { ViewModel.MostrarProtocolo(); } private void AdicionarFiltro_OnClick(object sender, RoutedEventArgs e) { ViewModel.AdcionarFiltroPersonalizado(); } private void ExcluirFiltro_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 Chip val = (Chip)((sender is Chip) ? sender : null); if (val != null) { ListBox val2 = Extentions.FindVisualAncestor((DependencyObject)(object)val); FiltroPersonalizado val3 = (FiltroPersonalizado)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)]; if (val3 != null) { ViewModel.FiltroPersonalizadoSelecionado.Remove(val3); ViewModel.PesquisaPersonalizada(); } } } private void FecharFiltro_OnClick(object sender, RoutedEventArgs e) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 ViewModel.VisibilityFiltroPersonalizado = (Visibility)(((int)ViewModel.VisibilityFiltroPersonalizado != 2) ? 2 : 0); } private async void Apolice_OnClick(object sender, RoutedEventArgs e) { ViewModel.Loading(isLoading: true); List list = await ViewModel.CriarLista(); list = ((list == null) ? new List() : list.Where((MalaDireta x) => (x.Apolice.Tipo == 0 && !string.IsNullOrWhiteSpace(x.Apolice.Apolice)) || (x.Apolice.Tipo == 1 && !string.IsNullOrWhiteSpace(x.Apolice.Endosso))).ToList()); if (list.Count == 0) { await ViewModel.ShowMessage("NECESSÁRIO SELECIONAR AO MENOS UM CLIENTE PARA PROSSEGUIR."); ViewModel.Loading(isLoading: false); return; } if (Funcoes.IsWindowOpen("ENVIO DE E-MAIL")) { Funcoes.Destroy("ENVIO DE E-MAIL"); } ViewModel.Loading(isLoading: false); ((Window)new HosterWindow((ContentControl)(object)new MalaDiretaView(list), "ENVIO DE E-MAIL", 1200.0, 600.0, canMaximize: true)).Show(); } private async void Sincronizar_OnClick(object sender, RoutedEventArgs e) { ViewModel.Carregando = true; ViewModel.IsEnabled = false; await ViewModel.Sincronizar(); ViewModel.IsEnabled = true; ViewModel.Carregando = false; } private async void ToggleComparativo_OnChecked(object sender, RoutedEventArgs e) { if ((int)ViewModel.Relatorio == 11) { ViewModel.Carregando = true; ViewModel.IsEnabled = false; RelatorioViewModel viewModel = ViewModel; viewModel.HtmlContent = await ViewModel.GerarHtml(screen: true); WebEditor.Initialize(ViewModel.HtmlContent); ViewModel.IsEnabled = true; ViewModel.Carregando = false; } } private async void HelpPopup_Opened(object sender, RoutedEventArgs e) { await ViewModel.CarregarAjuda(); } private void OcultarAjuda_OnClick(object sender, RoutedEventArgs e) { ((UIElement)HelpPopup).Visibility = (Visibility)2; } private void Fechar_OnClick(object sender, RoutedEventArgs e) { HelpPopup.IsPopupOpen = !HelpPopup.IsPopupOpen; } private void FecharFiltroUsuario_OnClick(object sender, RoutedEventArgs e) { ViewModel.VisibilityUsuarios = false; } private void CopyLink_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) { AjudaTela val2 = (AjudaTela)((FrameworkElement)val).DataContext; string text = ""; if (val2.Minuto > 0 || val2.Segundo > 0) { text = $"&start={val2.Minuto * 60 + val2.Segundo}"; } (val2.Link + text).CopyToClipboard(); ViewModel.ToggleSnackBar("LINK COPIADO"); } } private void Play_Click(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) { AjudaTela val2 = (AjudaTela)((FrameworkElement)val).DataContext; string text = ""; if (val2.Minuto > 0 || val2.Segundo > 0) { text = $"&start={val2.Minuto * 60 + val2.Segundo}"; } Process.Start(val2.Link + text); } } private async void PlanilhaCompleta_OnClick(object sender, RoutedEventArgs e) { ViewModel.Carregando = true; await ViewModel.GerarPlanilhaCompleta(); ViewModel.Carregando = false; } private void ConfigurarRelatorio_OnClick(object sender, RoutedEventArgs e) { ViewModel.ShowDrawer(new ConfiguracaoRelatorio(ViewModel), 0, close: false); } private void AdicionarRamo_OnClick(object sender, RoutedEventArgs e) { ViewModel.AdicionarRamo(); } private void ExcluirRamo_onClick(object sender, RoutedEventArgs e) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Chip val = (Chip)((sender is Chip) ? sender : null); if (val != null) { Ramo val2 = (Ramo)((FrameworkElement)val).DataContext; if (val2 != null) { ViewModel.RemoverRamo(val2); } } } private void FecharInfo_Click(object sender, RoutedEventArgs e) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 ViewModel.InfoVisibility = (Visibility)(((int)ViewModel.InfoVisibility != 2) ? 2 : 0); } private void AbrirInfo_Click(object sender, RoutedEventArgs e) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 ViewModel.InfoVisibility = (Visibility)(((int)ViewModel.InfoVisibility != 2) ? 2 : 0); } private void AutoCompleteBoxUsuario_Populating(object sender, PopulatingEventArgs e) { e.Cancel = true; ViewModel.Filtrar(ValidationHelper.RemoveDiacritics(e.Parameter.Trim())).ContinueWith(delegate(Task> 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 void ReloadWindow_Click(object sender, RoutedEventArgs e) { LimparRelatorio(); } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] public void InitializeComponent() { if (!_contentLoaded) { _contentLoaded = true; Uri uri = new Uri("/Gestor.Application;component/views/relatorios/relatorioview.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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Expected O, but got Unknown //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Expected O, but got Unknown //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Expected O, but got Unknown //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Expected O, but got Unknown //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Expected O, but got Unknown //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Expected O, but got Unknown //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected O, but got Unknown //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Expected O, but got Unknown //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Expected O, but got Unknown //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Expected O, but got Unknown //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Expected O, but got Unknown //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Expected O, but got Unknown //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Expected O, but got Unknown //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Expected O, but got Unknown //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Expected O, but got Unknown //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Expected O, but got Unknown //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Expected O, but got Unknown //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Expected O, but got Unknown //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Expected O, but got Unknown switch (connectionId) { case 1: ProgressRing = (Image)target; break; case 2: RelatorioBox = (ComboBox)target; ((Selector)RelatorioBox).SelectionChanged += new SelectionChangedEventHandler(TipoRelatorio_OnSelectionChanged); break; case 3: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirInfo_Click); break; case 4: ValorInicioBox = (CurrencyTextBox)target; break; case 5: ValorFimBox = (CurrencyTextBox)target; break; case 6: InicioBox = (DatePicker)target; ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)InicioBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 7: FimBox = (DatePicker)target; ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)FimBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 8: VisualizarRamosVendedoresTooltip = (ToggleButton)target; ((ButtonBase)VisualizarRamosVendedoresTooltip).Click += new RoutedEventHandler(ReloadWindow_Click); break; case 9: GerarRelatorioButton = (MenuItem)target; GerarRelatorioButton.Click += new RoutedEventHandler(GerarResultados_OnClick); break; case 10: ((MenuItem)target).Click += new RoutedEventHandler(Imprimir_OnClick); break; case 11: ((MenuItem)target).Click += new RoutedEventHandler(ExportarExcel_OnClick); break; case 12: ((MenuItem)target).Click += new RoutedEventHandler(PlanilhaCompleta_OnClick); break; case 13: ((MenuItem)target).Click += new RoutedEventHandler(Extrato_OnClick); break; case 14: ((MenuItem)target).Click += new RoutedEventHandler(MaisFiltros_OnClick); break; case 15: ((MenuItem)target).Click += new RoutedEventHandler(ConfigurarRelatorio_OnClick); break; case 16: ((MenuItem)target).Click += new RoutedEventHandler(Sintetico_OnClick); break; case 17: ((MenuItem)target).Click += new RoutedEventHandler(Tarefas_OnClick); break; case 18: ((MenuItem)target).Click += new RoutedEventHandler(Etiquetas_OnClick); break; case 19: ((MenuItem)target).Click += new RoutedEventHandler(Acompanhamento_OnClick); break; case 20: ((MenuItem)target).Click += new RoutedEventHandler(Email_OnClick); break; case 21: ((MenuItem)target).Click += new RoutedEventHandler(Apolice_OnClick); break; case 22: ((MenuItem)target).Click += new RoutedEventHandler(Protocolo_OnClick); break; case 23: ((MenuItem)target).Click += new RoutedEventHandler(Sincronizar_OnClick); break; case 24: ((MenuItem)target).Click += new RoutedEventHandler(FecharFiltro_OnClick); break; case 25: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(FecharFiltro_OnClick); break; case 26: ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 27: ((UIElement)(DatePicker)target).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus); ((Control)(DatePicker)target).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick); break; case 28: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarFiltro_OnClick); break; case 30: RamoBox = (ComboBox)target; break; case 31: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarRamo_OnClick); break; case 33: ReportControl = (ContentControl)target; break; case 34: WebEditor = (WebEditor)target; break; case 35: HelpPopup = (PopupBox)target; HelpPopup.Opened += new RoutedEventHandler(HelpPopup_Opened); break; case 36: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(OcultarAjuda_OnClick); break; case 37: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick); break; case 40: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(FecharFiltroUsuario_OnClick); break; case 41: ((AutoCompleteBox)target).Populating += new PopulatingEventHandler(AutoCompleteBoxUsuario_Populating); ((AutoCompleteBox)target).TextChanged += new RoutedEventHandler(AutoCompleteBox_OnTextChanged); break; case 42: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(FecharInfo_Click); break; case 43: NaoHaDados = (TextBlock)target; break; default: _contentLoaded = true; break; } } [DebuggerNonUserCode] [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] [EditorBrowsable(EditorBrowsableState.Never)] void IStyleConnector.Connect(int connectionId, object target) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_001c: 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) //IL_0032: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown switch (connectionId) { case 29: ((Chip)target).DeleteClick += new RoutedEventHandler(ExcluirFiltro_OnClick); break; case 32: ((Chip)target).DeleteClick += new RoutedEventHandler(ExcluirRamo_onClick); break; case 38: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(CopyLink_OnClick); break; case 39: ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Play_Click); break; } } }