summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Menus/DashboardView.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.Menus/DashboardView.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Menus/DashboardView.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Menus/DashboardView.cs926
1 files changed, 926 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Menus/DashboardView.cs b/Decompiler/Gestor.Application.Views.Menus/DashboardView.cs
new file mode 100644
index 0000000..5c2ffe1
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Menus/DashboardView.cs
@@ -0,0 +1,926 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Threading;
+using Gestor.Application.Drawers;
+using Gestor.Application.Helpers;
+using Gestor.Application.Servicos.Seguros;
+using Gestor.Application.ViewModels;
+using Gestor.Application.Views.Generic;
+using Gestor.Application.Views.Seguros;
+using Gestor.Common.Validation;
+using Gestor.Model.Common;
+using Gestor.Model.Domain.Ferramentas;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Relatorios.ClientesAtivosInativos;
+using Gestor.Model.Domain.Relatorios.Dashboard;
+using Gestor.Model.Domain.Relatorios.Renovacao;
+using Gestor.Model.Domain.Seguros;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Views.Menus;
+
+public class DashboardView : BaseUserControl, IComponentConnector, IStyleConnector
+{
+ internal Chip UsuarioChip;
+
+ internal Button TileRenovacao;
+
+ internal Button TileAniversariantes;
+
+ internal Button TileTarefas;
+
+ internal Button TileSinistro;
+
+ internal Button TileProspeccao;
+
+ internal TextBox TituloBox;
+
+ internal TextBox DescricaoBox;
+
+ internal Grid RenovacaoGrid;
+
+ internal Grid AniversariantesGrid;
+
+ internal Grid TarefasGrid;
+
+ internal Grid ProspeccaoGrid;
+
+ internal DatePicker InicioBox;
+
+ internal DatePicker FimBox;
+
+ internal ComboBox FiltroDocumento;
+
+ internal Grid SinistroGrid;
+
+ internal DatePicker InicioBox2;
+
+ internal DatePicker FimBox2;
+
+ private bool _contentLoaded;
+
+ public DashboardViewModel ViewModel { get; set; }
+
+ public DashboardView(DashboardViewModel viewModel)
+ {
+ ((FrameworkElement)this).Tag = "DASHBOARD";
+ ViewModel = viewModel;
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ }
+
+ private async void ContentLoad()
+ {
+ ((ContentControl)UsuarioChip).Content = Recursos.Usuario.Nome;
+ await ViewModel.BuscarRestricoes();
+ await ViewModel.CarregarNotas();
+ await ViewModel.CarregarFiltros();
+ bool num = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 24 && x.Restricao);
+ bool num2 = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 49 && x.Restricao);
+ bool num3 = ViewModel.Permissoes.Any((PermissaoUsuario x) => (int)x.Tela == 38 && !x.Consultar);
+ bool num4 = !Recursos.Usuario.PermissaoAggilizador.HasValue;
+ bool flag = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 25 && x.Restricao);
+ ((Selector)FiltroDocumento).SelectedIndex = 0;
+ List<Task> list = new List<Task>();
+ if (!num4)
+ {
+ ViewModel.CarregarRamos();
+ ((UIElement)TileProspeccao).Visibility = (Visibility)0;
+ if (!InicioBox.SelectedDate.HasValue)
+ {
+ InicioBox.SelectedDate = DateTime.Today;
+ }
+ if (!FimBox.SelectedDate.HasValue)
+ {
+ FimBox.SelectedDate = InicioBox.SelectedDate.Value;
+ }
+ list.Add(ViewModel.CarregarProspect(InicioBox.SelectedDate.Value, FimBox.SelectedDate.Value));
+ }
+ else
+ {
+ ((UIElement)TileProspeccao).Visibility = (Visibility)2;
+ }
+ if (!num3)
+ {
+ ((UIElement)TileTarefas).Visibility = (Visibility)0;
+ ViewModel.SelectedTile = 3;
+ list.Add(ViewModel.CarregarTarefas());
+ }
+ else
+ {
+ ((UIElement)TileTarefas).Visibility = (Visibility)2;
+ }
+ if (!num2)
+ {
+ ((UIElement)TileAniversariantes).Visibility = (Visibility)0;
+ ViewModel.SelectedTile = 2;
+ list.Add(ViewModel.CarregarAniversariantes());
+ }
+ else
+ {
+ ((UIElement)TileAniversariantes).Visibility = (Visibility)2;
+ }
+ if (!flag)
+ {
+ ((UIElement)TileSinistro).Visibility = (Visibility)0;
+ ViewModel.SelectedTile = 5;
+ list.Add(ViewModel.CarregarSinistros());
+ }
+ else
+ {
+ ((UIElement)TileSinistro).Visibility = (Visibility)2;
+ }
+ if (!num)
+ {
+ ((UIElement)TileRenovacao).Visibility = (Visibility)0;
+ ViewModel.SelectedTile = 1;
+ list.Add(ViewModel.CarregarRenovacoes());
+ }
+ else
+ {
+ ((UIElement)TileRenovacao).Visibility = (Visibility)2;
+ }
+ await Task.WhenAll(list);
+ ViewModel.Load = false;
+ }
+
+ private async void ExcluirNota_OnClick(object sender, RoutedEventArgs e)
+ {
+ object dataContext = ((FrameworkElement)(Button)sender).DataContext;
+ Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null);
+ if (val != null)
+ {
+ await ViewModel.ExcluirNota(val);
+ await ViewModel.CarregarNotas();
+ }
+ }
+
+ private async void SarvarNota_OnClick(object sender, RoutedEventArgs e)
+ {
+ object dataContext = ((FrameworkElement)(Button)sender).DataContext;
+ Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null);
+ if (val != null)
+ {
+ List<KeyValuePair<string, string>> list = await ViewModel.Salvar(val);
+ if (list != null && list.Count != 0)
+ {
+ await ViewModel.CarregarNotas();
+ }
+ }
+ }
+
+ private async void NotaConcluida_OnClick(object sender, RoutedEventArgs e)
+ {
+ object dataContext = ((FrameworkElement)(Button)sender).DataContext;
+ Tarefa val = (Tarefa)((dataContext is Tarefa) ? dataContext : null);
+ if (val != null)
+ {
+ val.Conclusao = Funcoes.GetNetworkTime();
+ val.Status = (StatusTarefa)2;
+ await ViewModel.SalvarNota(val);
+ await ViewModel.CarregarNotas();
+ }
+ }
+
+ private void AdicionarNota_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EnableFields = true;
+ TituloBox.Text = string.Empty;
+ DescricaoBox.Text = string.Empty;
+ ViewModel.Publica = false;
+ }
+
+ private async void SalvarNota_OnClick(object sender, RoutedEventArgs e)
+ {
+ Tarefa destino = new Tarefa
+ {
+ Agendamento = Funcoes.GetNetworkTime(),
+ Titulo = TituloBox.Text,
+ Anotacoes = DescricaoBox.Text,
+ Usuario = Recursos.Usuario,
+ UsuarioCadastro = Recursos.Usuario,
+ Entidade = (TipoTarefa)1,
+ Status = (StatusTarefa)0
+ };
+ List<KeyValuePair<string, string>> list = await ViewModel.Salvar(destino);
+ if (list == null || list.Count == 0)
+ {
+ ViewModel.ToggleSnackBar("NOTA SALVA COM SUCESSO.");
+ ViewModel.EnableFields = false;
+ await ViewModel.CarregarNotas();
+ }
+ else
+ {
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ }
+
+ private void Cancelar_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EnableFields = false;
+ }
+
+ private async void TileRenovacao_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.SelectedTile = 1;
+ await Carregar();
+ }
+
+ private async Task Carregar()
+ {
+ ViewModel.Loading(isLoading: true);
+ ((UIElement)RenovacaoGrid).Visibility = (Visibility)2;
+ ((UIElement)AniversariantesGrid).Visibility = (Visibility)2;
+ ((UIElement)TarefasGrid).Visibility = (Visibility)2;
+ ((UIElement)ProspeccaoGrid).Visibility = (Visibility)2;
+ ((UIElement)SinistroGrid).Visibility = (Visibility)2;
+ if (ViewModel.Filtros == null)
+ {
+ await ViewModel.CarregarFiltros();
+ }
+ await ViewModel.CarregarNotas();
+ switch (ViewModel.SelectedTile)
+ {
+ case 1:
+ await ViewModel.CarregarRenovacoes();
+ ((UIElement)RenovacaoGrid).Visibility = (Visibility)0;
+ break;
+ case 2:
+ await ViewModel.CarregarAniversariantes();
+ ((UIElement)AniversariantesGrid).Visibility = (Visibility)0;
+ break;
+ case 3:
+ await ViewModel.CarregarTarefas();
+ ((UIElement)TarefasGrid).Visibility = (Visibility)0;
+ break;
+ case 4:
+ await ViewModel.CarregarProspect(InicioBox.SelectedDate.Value, FimBox.SelectedDate.Value);
+ ((UIElement)ProspeccaoGrid).Visibility = (Visibility)0;
+ break;
+ case 5:
+ await ViewModel.CarregarSinistros();
+ ((UIElement)SinistroGrid).Visibility = (Visibility)0;
+ break;
+ }
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private async Task CarregarForce()
+ {
+ ViewModel.Loading(isLoading: true);
+ ((UIElement)RenovacaoGrid).Visibility = (Visibility)2;
+ ((UIElement)AniversariantesGrid).Visibility = (Visibility)2;
+ ((UIElement)TarefasGrid).Visibility = (Visibility)2;
+ ((UIElement)ProspeccaoGrid).Visibility = (Visibility)2;
+ ((UIElement)SinistroGrid).Visibility = (Visibility)2;
+ await ViewModel.CarregarFiltros();
+ bool num = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 24 && x.Restricao);
+ bool restricaoAniversariantes = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 49 && x.Restricao);
+ bool restricaoTarefas = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 19 && x.Restricao);
+ bool restricaoSinistro = ViewModel.Restricoes.Any((RestricaoUsuario x) => (int)x.Tipo == 25 && x.Restricao);
+ if (!num)
+ {
+ await ViewModel.CarregarRenovacoes(force: true);
+ }
+ if (!restricaoAniversariantes)
+ {
+ await ViewModel.CarregarAniversariantes(force: true);
+ }
+ if (!restricaoTarefas)
+ {
+ await ViewModel.CarregarTarefas(force: true);
+ }
+ if (!restricaoSinistro)
+ {
+ await ViewModel.CarregarSinistros(force: true);
+ }
+ await ViewModel.CarregarNotas();
+ switch (ViewModel.SelectedTile)
+ {
+ case 1:
+ ((UIElement)RenovacaoGrid).Visibility = (Visibility)0;
+ break;
+ case 2:
+ ((UIElement)AniversariantesGrid).Visibility = (Visibility)0;
+ break;
+ case 3:
+ ((UIElement)TarefasGrid).Visibility = (Visibility)0;
+ break;
+ case 4:
+ ((UIElement)ProspeccaoGrid).Visibility = (Visibility)0;
+ break;
+ case 5:
+ ((UIElement)SinistroGrid).Visibility = (Visibility)0;
+ break;
+ }
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private async void TileAniversariantes_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.SelectedTile = 2;
+ await Carregar();
+ }
+
+ private async void TileTarefas_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.SelectedTile = 3;
+ await Carregar();
+ }
+
+ private void PopupBoxRenovacao_OnOpened(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0011: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0017: Expected O, but got Unknown
+ //IL_004a: 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_0060: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0076: Expected O, but got Unknown
+ //IL_0089: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b5: Expected O, but got Unknown
+ PopupBox val = (PopupBox)sender;
+ ObservableCollection<ClienteTelefone> observableCollection = new ObservableCollection<ClienteTelefone>();
+ Renovacao val2 = (Renovacao)((FrameworkElement)val).DataContext;
+ if (val2.Documento != null)
+ {
+ observableCollection = val2.Documento.Controle.Cliente.Telefones;
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(val2.Prospeccao.Telefone1))
+ {
+ observableCollection.Add(new ClienteTelefone
+ {
+ Prefixo = val2.Prospeccao.Prefixo1,
+ Numero = val2.Prospeccao.Telefone1
+ });
+ }
+ if (!string.IsNullOrEmpty(val2.Prospeccao.Telefone2))
+ {
+ observableCollection.Add(new ClienteTelefone
+ {
+ Prefixo = val2.Prospeccao.Prefixo2,
+ Numero = val2.Prospeccao.Telefone2
+ });
+ }
+ }
+ ViewModel.Telefones = observableCollection;
+ }
+
+ private void PopupBoxProspeccao_OnOpened(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0011: Expected O, but got Unknown
+ Prospectar val = (Prospectar)((FrameworkElement)(PopupBox)sender).DataContext;
+ ViewModel.Telefones = val.EntidadeCliente.Telefones;
+ }
+
+ private void PopupBox_OnClosed(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Anotacoes = "";
+ }
+
+ private void PopupBoxAniversariante_OnOpened(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0011: Expected O, but got Unknown
+ ClientesAtivosInativos val = (ClientesAtivosInativos)((FrameworkElement)(PopupBox)sender).DataContext;
+ ViewModel.Telefones = val.EntidadeCliente.Telefones;
+ }
+
+ private async void EnviarPorWhatsApp_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.Restricao((TipoRestricao)32))
+ {
+ await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR O WHATSAPP");
+ return;
+ }
+ Button val = (Button)sender;
+ if (((FrameworkElement)val).DataContext != null)
+ {
+ object dataContext = ((FrameworkElement)val).DataContext;
+ ClienteTelefone val2 = (ClienteTelefone)((dataContext is ClienteTelefone) ? dataContext : null);
+ if (val2 != null && !((((TelefoneBase)val2).Tipo.HasValue && (int)((TelefoneBase)val2).Tipo.GetValueOrDefault() == 8) ? (((TelefoneBase)val2).Prefixo + ((TelefoneBase)val2).Numero).Clear() : ("55" + ((TelefoneBase)val2).Prefixo + ((TelefoneBase)val2).Numero.Clear())).EnviarWhatsapp(ViewModel.Anotacoes))
+ {
+ await ViewModel.ShowMessage("HOUVE UM PROBLEMA AO ABRIR LINK DO WHATSAPP, O LINK FOI COPIADO EM SUA MAQUINA, BASTA ABRIR O NAVEGADOR DE INTERNET E COLAR NA BARRA DE ENDEREÇOS");
+ }
+ }
+ }
+
+ private async void AbrirAniversariante_OnClick(object sender, RoutedEventArgs e)
+ {
+ ClientesAtivosInativos val = (ClientesAtivosInativos)((FrameworkElement)(Button)sender).DataContext;
+ Cliente val2 = await new ClienteServico().BuscarClienteAsync(((DomainBase)val.EntidadeCliente).Id);
+ ((Window)new HosterWindow((ContentControl)(object)new ClienteView(val2, lockInsert: true), "CADASTRO DE CLIENTES - " + val2.Nome)).ShowDialog();
+ }
+
+ private async void AbrirRenovacao_OnClick(object sender, RoutedEventArgs e)
+ {
+ Renovacao val = (Renovacao)((FrameworkElement)(Button)sender).DataContext;
+ if (val.Documento == null)
+ {
+ ViewModel.Loading(isLoading: true);
+ await AbrirProspeccao(val.Prospeccao);
+ ViewModel.Loading(isLoading: false);
+ }
+ else
+ {
+ Documento val2 = await new ApoliceServico().BuscarApoliceAsync(((DomainBase)val.Documento).Id);
+ ((Window)new HosterWindow((ContentControl)(object)new ApoliceView(val2, lockInsert: true, invoke: false, (AcessoApolice)0, 0L), "CADASTRO DE APÓLICES - " + val2.Controle.Cliente.Nome)).Show();
+ }
+ }
+
+ private async Task AbrirProspeccao(Prospeccao data)
+ {
+ InicioBox.Text = ValidationHelper.FormatDate(InicioBox.Text);
+ FimBox.Text = ValidationHelper.FormatDate(FimBox.Text);
+ while (true)
+ {
+ data = await ViewModel.ShowProspeccaoDialog(data);
+ if (data == null)
+ {
+ return;
+ }
+ List<KeyValuePair<string, string>> list = await ViewModel.SalvarProspeccao(data);
+ if (list == null || list.Count == 0)
+ {
+ break;
+ }
+ await ViewModel.ShowMessage(list, ViewModel.ErroCamposInvalidos, "OK");
+ }
+ ViewModel.ToggleSnackBar("PROSPECÇÃO SALVA COM SUCESSO.");
+ await CarregarForce();
+ }
+
+ private void AbrirTarefa_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0011: Expected O, but got Unknown
+ Tarefa tarefa = (Tarefa)((FrameworkElement)(Button)sender).DataContext;
+ ViewModel.ShowDrawer(new TarefaDrawer(tarefa), 0, close: false);
+ }
+
+ private async void Refresh_OnClick(object sender, RoutedEventArgs e)
+ {
+ await CarregarForce();
+ }
+
+ private async void TileProspeccao_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!InicioBox.SelectedDate.HasValue)
+ {
+ InicioBox.SelectedDate = DateTime.Today;
+ }
+ if (!FimBox.SelectedDate.HasValue)
+ {
+ FimBox.SelectedDate = InicioBox.SelectedDate.Value;
+ }
+ ViewModel.SelectedTile = 4;
+ await Carregar();
+ }
+
+ private void Ramo_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ViewModel.LimparProspeccao();
+ }
+
+ private async void RefreshProspectar_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!InicioBox.SelectedDate.HasValue || !FimBox.SelectedDate.HasValue)
+ {
+ await ViewModel.ShowMessage("INÍCIO E FIM DEVEM ESTAR PREENCHIDOS.");
+ return;
+ }
+ if (InicioBox.SelectedDate.Value > FimBox.SelectedDate.Value)
+ {
+ await ViewModel.ShowMessage("INÍCIO NÃO DEVE SER MAIOR QUE O FIM.");
+ return;
+ }
+ if ((FimBox.SelectedDate.Value - InicioBox.SelectedDate.Value).TotalDays > 31.0)
+ {
+ await ViewModel.ShowMessage("O PERIODO TOTAL DO RELATÓRIO NÃO PODE SER MAIOR QUE 30 DIAS.");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.CarregarProspect(InicioBox.SelectedDate.Value, FimBox.SelectedDate.Value);
+ ((UIElement)ProspeccaoGrid).Visibility = (Visibility)0;
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private void Referencia_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ViewModel.LimparProspeccao();
+ }
+
+ private void DatePicker_OnSelectedDateChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ViewModel.LimparProspeccao();
+ }
+
+ private async void TileSinistro_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!InicioBox2.SelectedDate.HasValue)
+ {
+ InicioBox2.SelectedDate = DateTime.Today;
+ }
+ if (!FimBox2.SelectedDate.HasValue)
+ {
+ FimBox2.SelectedDate = DateTime.Today;
+ }
+ ViewModel.SelectedTile = 5;
+ await Carregar();
+ }
+
+ private async void AbrirSinistro_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button val = (Button)sender;
+ if (((FrameworkElement)val).DataContext != null)
+ {
+ Sinistro val2 = (Sinistro)((FrameworkElement)val).DataContext;
+ if (val2 != null)
+ {
+ Item item = (await ViewModel.CarregaSinistroApolice(((DomainBase)val2).Id)).ControleSinistro.Item;
+ ((Window)new HosterWindow((ContentControl)(object)new SinistroView(item, attached: false), "CADASTRO DE SINISTROS - " + item.Documento.Controle.Cliente.Nome + " - " + item.Documento.Apolice + " " + item.Documento.Endosso)).Show();
+ }
+ }
+ }
+
+ private async void RefreshSinsitro_OnClick(object sender, RoutedEventArgs e)
+ {
+ if (!InicioBox2.SelectedDate.HasValue || !FimBox2.SelectedDate.HasValue)
+ {
+ await ViewModel.ShowMessage("INÍCIO E FIM DEVEM ESTAR PREENCHIDOS.");
+ return;
+ }
+ if (InicioBox2.SelectedDate.Value > FimBox2.SelectedDate.Value)
+ {
+ await ViewModel.ShowMessage("INÍCIO NÃO DEVE SER MAIOR QUE O FIM.");
+ return;
+ }
+ if ((FimBox2.SelectedDate.Value - InicioBox2.SelectedDate.Value).TotalDays > 31.0)
+ {
+ await ViewModel.ShowMessage("O PERIODO TOTAL DO RELATÓRIO NÃO PODE SER MAIOR QUE 30 DIAS.");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.CarregarSinistros(InicioBox2.SelectedDate.Value, FimBox2.SelectedDate.Value);
+ ((UIElement)SinistroGrid).Visibility = (Visibility)0;
+ ViewModel.Loading(isLoading: false);
+ }
+
+ private void FiltroCliente_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ViewModel.LimparProspeccao();
+ }
+
+ private async void GerarCsv_OnClick(object sender, RoutedEventArgs e)
+ {
+ _ = "NovosNegocios" + DateTime.Now.Date.ToString("d").Replace("/", "") + ".csv";
+ if (ViewModel.Prospeccoes.Count == 0)
+ {
+ await ViewModel.ShowMessage("NÃO HÁ DADOS A SEREM EXPORTADOS NO .CSV");
+ return;
+ }
+ ViewModel.Loading(isLoading: true);
+ await ViewModel.GerarCsv();
+ ViewModel.Loading(isLoading: false);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/menus/dashboardview.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_00a7: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b1: Expected O, but got Unknown
+ //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c9: Expected O, but got Unknown
+ //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00d6: Expected O, but got Unknown
+ //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ed: Expected O, but got Unknown
+ //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fa: Expected O, but got Unknown
+ //IL_0107: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0111: Expected O, but got Unknown
+ //IL_0114: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011e: Expected O, but got Unknown
+ //IL_012b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0135: Expected O, but got Unknown
+ //IL_0138: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0142: Expected O, but got Unknown
+ //IL_014f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0159: Expected O, but got Unknown
+ //IL_015c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0166: Expected O, but got Unknown
+ //IL_0173: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017d: Expected O, but got Unknown
+ //IL_017f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_018b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0195: Expected O, but got Unknown
+ //IL_0197: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01a3: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ad: Expected O, but got Unknown
+ //IL_01af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01c5: Expected O, but got Unknown
+ //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01d2: Expected O, but got Unknown
+ //IL_01d5: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01df: Expected O, but got Unknown
+ //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01ec: Expected O, but got Unknown
+ //IL_01ef: Unknown result type (might be due to invalid IL or missing references)
+ //IL_01f9: Expected O, but got Unknown
+ //IL_01fc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0206: Expected O, but got Unknown
+ //IL_0209: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0213: Expected O, but got Unknown
+ //IL_0215: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0221: Unknown result type (might be due to invalid IL or missing references)
+ //IL_022b: Expected O, but got Unknown
+ //IL_022d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0239: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0243: Expected O, but got Unknown
+ //IL_0246: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0250: Expected O, but got Unknown
+ //IL_025d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0267: Expected O, but got Unknown
+ //IL_0274: Unknown result type (might be due to invalid IL or missing references)
+ //IL_027e: Expected O, but got Unknown
+ //IL_0298: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02a2: Expected O, but got Unknown
+ //IL_02af: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02b9: Expected O, but got Unknown
+ //IL_02c6: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02d0: Expected O, but got Unknown
+ //IL_02ea: Unknown result type (might be due to invalid IL or missing references)
+ //IL_02f4: Expected O, but got Unknown
+ //IL_0301: Unknown result type (might be due to invalid IL or missing references)
+ //IL_030b: Expected O, but got Unknown
+ //IL_030d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0319: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0323: Expected O, but got Unknown
+ //IL_0325: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0331: Unknown result type (might be due to invalid IL or missing references)
+ //IL_033b: Expected O, but got Unknown
+ //IL_033e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0348: Expected O, but got Unknown
+ //IL_034b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0355: Expected O, but got Unknown
+ //IL_0362: Unknown result type (might be due to invalid IL or missing references)
+ //IL_036c: Expected O, but got Unknown
+ //IL_0379: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0383: Expected O, but got Unknown
+ //IL_039d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03a7: Expected O, but got Unknown
+ //IL_03b4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03be: Expected O, but got Unknown
+ //IL_03cb: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03d5: Expected O, but got Unknown
+ //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
+ //IL_03fa: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0404: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ UsuarioChip = (Chip)target;
+ break;
+ case 2:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Refresh_OnClick);
+ break;
+ case 3:
+ TileRenovacao = (Button)target;
+ ((ButtonBase)TileRenovacao).Click += new RoutedEventHandler(TileRenovacao_OnClick);
+ break;
+ case 4:
+ TileAniversariantes = (Button)target;
+ ((ButtonBase)TileAniversariantes).Click += new RoutedEventHandler(TileAniversariantes_OnClick);
+ break;
+ case 5:
+ TileTarefas = (Button)target;
+ ((ButtonBase)TileTarefas).Click += new RoutedEventHandler(TileTarefas_OnClick);
+ break;
+ case 6:
+ TileSinistro = (Button)target;
+ ((ButtonBase)TileSinistro).Click += new RoutedEventHandler(TileSinistro_OnClick);
+ break;
+ case 7:
+ TileProspeccao = (Button)target;
+ ((ButtonBase)TileProspeccao).Click += new RoutedEventHandler(TileProspeccao_OnClick);
+ break;
+ case 8:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AdicionarNota_OnClick);
+ break;
+ case 9:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(SalvarNota_OnClick);
+ break;
+ case 10:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Cancelar_OnClick);
+ break;
+ case 11:
+ TituloBox = (TextBox)target;
+ break;
+ case 12:
+ DescricaoBox = (TextBox)target;
+ break;
+ case 15:
+ RenovacaoGrid = (Grid)target;
+ break;
+ case 19:
+ AniversariantesGrid = (Grid)target;
+ break;
+ case 23:
+ TarefasGrid = (Grid)target;
+ break;
+ case 25:
+ ProspeccaoGrid = (Grid)target;
+ break;
+ case 26:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(Ramo_OnSelectionChanged);
+ break;
+ case 27:
+ ((Selector)(ComboBox)target).SelectionChanged += new SelectionChangedEventHandler(Referencia_OnSelectionChanged);
+ break;
+ case 28:
+ InicioBox = (DatePicker)target;
+ ((UIElement)InicioBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)InicioBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ InicioBox.SelectedDateChanged += DatePicker_OnSelectedDateChanged;
+ break;
+ case 29:
+ FimBox = (DatePicker)target;
+ ((UIElement)FimBox).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)FimBox).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ FimBox.SelectedDateChanged += DatePicker_OnSelectedDateChanged;
+ break;
+ case 30:
+ FiltroDocumento = (ComboBox)target;
+ ((Selector)FiltroDocumento).SelectionChanged += new SelectionChangedEventHandler(FiltroCliente_OnSelectionChanged);
+ break;
+ case 31:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(RefreshProspectar_OnClick);
+ break;
+ case 32:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(GerarCsv_OnClick);
+ break;
+ case 35:
+ SinistroGrid = (Grid)target;
+ break;
+ case 36:
+ InicioBox2 = (DatePicker)target;
+ ((UIElement)InicioBox2).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)InicioBox2).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ InicioBox2.SelectedDateChanged += DatePicker_OnSelectedDateChanged;
+ break;
+ case 37:
+ FimBox2 = (DatePicker)target;
+ ((UIElement)FimBox2).LostKeyboardFocus += new KeyboardFocusChangedEventHandler(base.DatePicker_OnLostKeyboardFocus);
+ ((Control)FimBox2).MouseDoubleClick += new MouseButtonEventHandler(base.DataAtual_OnDoubleClick);
+ FimBox2.SelectedDateChanged += DatePicker_OnSelectedDateChanged;
+ break;
+ case 38:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(RefreshSinsitro_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IStyleConnector.Connect(int connectionId, object target)
+ {
+ //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_0059: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0065: Unknown result type (might be due to invalid IL or missing references)
+ //IL_006f: Expected O, but got Unknown
+ //IL_0071: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0087: Expected O, but got Unknown
+ //IL_0089: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0095: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009f: Expected O, but got Unknown
+ //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b7: Expected O, but got Unknown
+ //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ce: Expected O, but got Unknown
+ //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00e6: Expected O, but got Unknown
+ //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00fe: Expected O, but got Unknown
+ //IL_0100: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0116: Expected O, but got Unknown
+ //IL_0117: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0123: Unknown result type (might be due to invalid IL or missing references)
+ //IL_012d: Expected O, but got Unknown
+ //IL_012f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0145: Expected O, but got Unknown
+ //IL_0147: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0153: Unknown result type (might be due to invalid IL or missing references)
+ //IL_015d: 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_015f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0175: 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
+ switch (connectionId)
+ {
+ case 13:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirNota_OnClick);
+ break;
+ case 14:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(NotaConcluida_OnClick);
+ break;
+ case 16:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirRenovacao_OnClick);
+ break;
+ case 17:
+ ((PopupBox)target).Opened += new RoutedEventHandler(PopupBoxRenovacao_OnOpened);
+ ((PopupBox)target).Closed += new RoutedEventHandler(PopupBox_OnClosed);
+ break;
+ case 18:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(EnviarPorWhatsApp_OnClick);
+ break;
+ case 20:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirAniversariante_OnClick);
+ break;
+ case 21:
+ ((PopupBox)target).Opened += new RoutedEventHandler(PopupBoxAniversariante_OnOpened);
+ ((PopupBox)target).Closed += new RoutedEventHandler(PopupBox_OnClosed);
+ break;
+ case 22:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(EnviarPorWhatsApp_OnClick);
+ break;
+ case 24:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirTarefa_OnClick);
+ break;
+ case 33:
+ ((PopupBox)target).Opened += new RoutedEventHandler(PopupBoxProspeccao_OnOpened);
+ ((PopupBox)target).Closed += new RoutedEventHandler(PopupBox_OnClosed);
+ break;
+ case 34:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(EnviarPorWhatsApp_OnClick);
+ break;
+ case 39:
+ ((ButtonBase)(Button)target).Click += new RoutedEventHandler(AbrirSinistro_OnClick);
+ break;
+ }
+ }
+}