using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Linq; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using Agger.Registro; using Gestor.Application.Componentes; using Gestor.Application.Helpers; using Gestor.Application.Servicos; using Gestor.Application.Servicos.Generic; using Gestor.Application.Servicos.Seguros; using Gestor.Application.Servicos.Seguros.Itens; using Gestor.Application.ViewModels.Seguros.Itens; using Gestor.Application.Views.Seguros.Itens; using Gestor.Model.Common; using Gestor.Model.Domain.Card; using Gestor.Model.Domain.Common; using Gestor.Model.Domain.Ferramentas; using Gestor.Model.Domain.Generic; using Gestor.Model.Domain.MalaDireta; using Gestor.Model.Domain.Seguros; using Gestor.Model.Helper; using MaterialDesignThemes.Wpf; using Xceed.Wpf.AvalonDock.Controls; namespace Gestor.Application.ViewModels.Generic; public class BaseSegurosViewModel : BaseViewModel { private string _anotacoes; private bool _enableEndossar; private bool _enableRenovar; public AutoCompleteFilterPredicate ClienteItemFilter => (string searchText, object obj) => CultureInfo.InvariantCulture.CompareInfo.IndexOf(((Cliente)obj).Nome.ToUpper(), searchText.Trim(), CompareOptions.IgnoreNonSpace) > -1 || (((Cliente)obj).Documento != null && ((Cliente)obj).Documento.Contains(searchText.Trim())) || (((Cliente)obj).Rne != null && ((Cliente)obj).Rne.Contains(searchText.Trim())) || (((Cliente)obj).Cei != null && ((Cliente)obj).Cei.Contains(searchText.Trim())) || (((Cliente)obj).NomeSocialRg != null && ((Cliente)obj).NomeSocialRg.ToUpper().Contains(searchText.Trim().ToUpper())) || (((Cliente)obj).Telefones != null && ((Cliente)obj).Telefones.Count > 0 && ((Cliente)obj).Telefones.Any((ClienteTelefone x) => ((TelefoneBase)x).Numero.Contains(searchText.Trim()))); public string Anotacoes { get { return _anotacoes; } set { _anotacoes = value; OnPropertyChanged("Anotacoes"); } } public AutoCompleteFilterPredicate AgendaItemFilter => (string searchText, object obj) => ((Agenda)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate VendedorItemFilter => (string searchText, object obj) => ((Vendedor)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || (((Vendedor)obj).Documento != null && ((Vendedor)obj).Documento.ToUpper().Contains(searchText.ToUpper())); public AutoCompleteFilterPredicate ProfissaoItemFilter => (string searchText, object obj) => ((Profissao)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Profissao)obj).Codigo.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate EstipulanteItemFilter => (string searchText, object obj) => ((Estipulante)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Estipulante)obj).Documento.ToString().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate ProdutoItemFilter => (string searchText, object obj) => ((Produto)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate TipoTarefaItemFilter => (string searchText, object obj) => ((TipoDeTarefa)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate StatusProspeccaoItemFilter => (string searchText, object obj) => ((StatusDeProspeccao)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate NotaFiscalItemFilter => (string searchText, object obj) => ((NotaFiscal)obj).Seguradora.Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate StatusItemFilter => (string searchText, object obj) => ((Status)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate ReciboItemFilter => (string searchText, object obj) => ((Recibo)obj).Pagante.ToUpper().Contains(searchText.ToUpper()) || ((Recibo)obj).Recebedor.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate EtiquetaItemFilter => (string searchText, object obj) => ((Documento)obj).Controle.Cliente.Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate EmpresaItemFilter => (string searchText, object obj) => ((Empresa)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Empresa)obj).Documento.ToString().Contains(searchText.ToUpper()) || ((Empresa)obj).Serial.ToString().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate SocioItemFilter => (string searchText, object obj) => ((Socio)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Socio)obj).Email.ToString().Contains(searchText.ToUpper()) || ((Socio)obj).Telefone.ToString().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate UsuarioItemFilter => (string searchText, object obj) => ((Usuario)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Usuario)obj).Documento.ToString().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate NomeItemFilter => (string searchText, object obj) => ((Credencial)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate BancoItemFilter => (string searchText, object obj) => ((Banco)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Banco)obj).Codigo.ToString().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate AtividadeItemFilter => (string searchText, object obj) => ((Atividade)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Atividade)obj).Cnac.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate FabricanteItemFilter => (string searchText, object obj) => ((Fabricante)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate SeguradoraItemFilter => (string searchText, object obj) => ((Seguradora)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || (((Seguradora)obj).Documento != null && ((Seguradora)obj).Documento.ToUpper().Contains(searchText.ToUpper())) || (((Seguradora)obj).Susep != null && ((Seguradora)obj).Susep.ToUpper().Contains(searchText.ToUpper())); public AutoCompleteFilterPredicate ConfigItemFilter => (string searchText, object obj) => ((ConfigExtratoImport)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate ParceiroItemFilter => (string searchText, object obj) => ((Parceiro)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate TipoVendedorItemFilter => (string searchText, object obj) => ((TipoVendedor)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate RamoItemFilter => (string searchText, object obj) => ((Ramo)obj).Nome.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate ItemFilter => (string searchText, object obj) => ((Item)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public AutoCompleteFilterPredicate SinitroItemFilter => (string searchText, object obj) => ((ControleSinistro)obj).DataSinistro.ToString().Contains(searchText) || (((ControleSinistro)obj).Sinistros != null && ((ControleSinistro)obj).Sinistros.Count > 0 && ((ControleSinistro)obj).Sinistros[0].Numero.ToUpper().Contains(searchText.ToUpper())); public AutoCompleteFilterPredicate CoberturaPadraoItemFilter => (string searchText, object obj) => ((CoberturaPadrao)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); public bool EnableEndossar { get { return _enableEndossar; } set { _enableEndossar = value; OnPropertyChanged("EnableEndossar"); } } public bool EnableRenovar { get { return _enableRenovar; } set { _enableRenovar = value; OnPropertyChanged("EnableRenovar"); } } public List FilterCliente(List clientes, string searchText) { return clientes.Where((Cliente x) => x.Nome.ToUpper().Contains(searchText.ToUpper()) || (x.Documento != null && x.Documento.Contains(searchText)) || (x.Rne != null && x.Rne.Contains(searchText)) || (x.Cei != null && x.Cei.Contains(searchText))).ToList(); } internal async Task> BuscarClienteEmpresa(string value) { return await Task.Run(() => new BaseServico().BuscarClienteEmpresa(value)); } internal async Task> BuscarCliente(string value, List vinculos = null, TipoFiltroCliente tipoFiltroCliente = 2) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) return await new ClienteServico().BuscarCliente(value, vinculos, tipoFiltroCliente); } internal async Task> BuscarClienteVinculo(string value, long id) { return await Task.Run(() => new ClienteServico().BuscarClienteVinculo(value, id)); } internal async Task> BuscarProfissao(string value) { return await Task.Run(() => new BaseServico().BuscarProfissao(value)); } internal async Task> BuscarAtividade(string value) { return await Task.Run(() => new BaseServico().BuscarAtividade(value)); } internal async Task> BuscaFabricante(string value) { return await Task.Run(() => new BaseServico().BuscarFabricante(value)); } internal async Task> BuscarUsuario(string value) { return await Task.Run(() => new BaseServico().BuscarUsuario(value)); } internal async Task ShowDetalheExtrato(List detalhes) { DialogHost host = GetHost(); if (host == null || !host.IsOpen) { DialogDetalheExtrato dialogControl = new DialogDetalheExtrato(detalhes); await ExecuteRunExtendedDialogDetalheExtrato((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } } public async Task ExecuteRunExtendedDialogDetalheExtrato(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); } internal async Task ShowBuscaModeloDialog(string modelo, string ano) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } BuscarModeloView dialogControl = new BuscarModeloView(new BuscarModeloViewModel(modelo, ano)); return await ExecuteRunExtendedDialogBuscaModelo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task ShowEditarParcelasDialog(Documento documento) { DialogHost host = GetHost(); if (host == null || !host.IsOpen) { DialogEditarParcelas dialogControl = new DialogEditarParcelas(documento); await ExecuteRunExtendedDialogEditarParcelas((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } } public async Task ExecuteRunExtendedDialogEditarParcelas(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); } internal async Task ShowObservacaoDialog() { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogObservacao dialogControl = new DialogObservacao(); return await ExecuteRunExtendedDialogObservacao((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } public async Task ExecuteRunExtendedDialogObservacao(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (string)obj; } public async Task ExecuteRunExtendedDialogBuscaModelo(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (Fipe)obj; } internal async Task ShowVinculoDialog(VinculoRepasse vinculo, List repasses, Repasse repasse) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogVinculo dialogControl = new DialogVinculo(vinculo, repasses, repasse); return await ExecuteRunExtendedDialogVinculo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } public async Task ExecuteRunExtendedDialogVinculo(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (VinculoRepasse)obj; } internal async Task ShowTarefaDialog(Tarefa tarefa, bool nota = false, bool agendamento = false) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } List telefones = new List(); if (tarefa != null && tarefa.IdCliente > 0) { telefones = (await new ClienteServico().BuscarTelefonesAsync(tarefa.IdCliente)).Where((ClienteTelefone x) => ValidationHelper.ValidacaoTelefone(((TelefoneBase)x).Numero)).Select((Func)((ClienteTelefone x) => new TelefoneBase { Tipo = ((TelefoneBase)x).Tipo, Id = ((DomainBase)x).Id, Numero = ((TelefoneBase)x).Numero, Prefixo = ((TelefoneBase)x).Prefixo })).ToList(); } DialogTarefa dialogControl = new DialogTarefa(tarefa, telefones, nota, agendamento); return await ExecuteRunExtendedDialogTarefa((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task> ShowSelecionarItensDialog(long id) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogSelecionarItens dialogControl = new DialogSelecionarItens(id); return await ExecuteRunExtendedDialogSelecionarItens((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task> ShowReordenarItensDialog(List ids) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogReordenarItens dialogControl = new DialogReordenarItens(ids); return await ExecuteRunExtendedDialogReordenarItens((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task> ShowProtocoloDialog(List itens) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogProtocolo dialogControl = new DialogProtocolo(itens); return await ExecuteRunExtendedDialogProtocolo((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } public async Task> ExecuteRunExtendedDialogProtocolo(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj == null || obj is bool) { return null; } return ((ObservableCollection)obj).ToList(); } public async Task> ExecuteRunExtendedDialogReordenarItens(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj == null || obj is bool) { return null; } return (ObservableCollection)obj; } public async Task> ExecuteRunExtendedDialogSelecionarItens(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (ObservableCollection)obj; } internal async Task, Usuario, List, List, List>> ShowCopiarPermissaoDialog() { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogCopiarPermissao dialogControl = new DialogCopiarPermissao(new DialogCopiarPermissaoViewModel()); return await ExecuteRunExtendedDialogCopiarPermiss((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task> ShowExportarPermissaoDialog(long idUsuario) { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogExportarPermissao dialogControl = new DialogExportarPermissao(new DialogExportarPermissaoViewModel(idUsuario)); return await ExecuteRunExtendedDialogExportarPermiss((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } internal async Task ShowLogAcessoDialog(TipoTela tela, Usuario usuario) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) DialogHost host = GetHost(); if (host == null || !host.IsOpen) { DialogLogAcesso dialogControl = new DialogLogAcesso(tela, usuario); await ExecuteRunExtendedDialogEnviarEmails((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } } public async Task ExecuteRunExtendedDialogLogAcesso(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); } internal async Task ShowEnviarEmailsDialog(List lista, bool assinatura, bool original, List arquivosAnexados, string assunto, string corpo, Credencial credencial, FiltroArquivoDigital filtro, bool salvarAd, bool confirmarLeitura) { DialogHost host = GetHost(); if (host == null || !host.IsOpen) { DialogEnviarEmails dialogControl = new DialogEnviarEmails(new DialogEnviarEmailsViewModel(lista, assinatura, original, arquivosAnexados, assunto, corpo, credencial, filtro, salvarAd, confirmarLeitura)); await ExecuteRunExtendedDialogEnviarEmails((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } } internal async Task ShowPesquisaAvancadaDialog() { DialogHost host = GetHost(); if (host != null && host.IsOpen) { return null; } DialogPesquisaAvancadaViewModel dialogPesquisaAvancadaViewModel = new DialogPesquisaAvancadaViewModel(); DialogPesquisaAvancada dialogPesquisaAvancada = new DialogPesquisaAvancada(dialogPesquisaAvancadaViewModel); ((FrameworkElement)dialogPesquisaAvancada).DataContext = dialogPesquisaAvancadaViewModel; DialogPesquisaAvancada dialogControl = dialogPesquisaAvancada; return await ExecuteRunExtendedDialogPesquisaAvancada((UserControl)(object)dialogControl, (host != null) ? host.Identifier.ToString() : "RootDialog"); } public async Task ExecuteRunExtendedDialogTarefa(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (Tarefa)obj; } public async Task, Usuario, List, List, List>> ExecuteRunExtendedDialogCopiarPermiss(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (Tuple, Usuario, List, List, List>)obj; } public async Task> ExecuteRunExtendedDialogExportarPermiss(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (List)obj; } public async Task ExecuteRunExtendedDialogEnviarEmails(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); } public async Task ExecuteRunExtendedDialogPesquisaAvancada(UserControl dialogControl, string hostName) { Extentions.FindVisualChildren((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType().SingleOrDefault((Func)((Window x) => x.IsActive))).ToList().ForEach(delegate(WebEditor x) { ((UIElement)x).Visibility = (Visibility)2; }); object obj = await DialogHost.Show((object)dialogControl, (object)hostName, new DialogOpenedEventHandler(base.ExtendedOpenedEventHandler), new DialogClosingEventHandler(base.ExtendedClosingEventHandler)); if (obj is bool) { return null; } return (PesquisaAvancada)obj; } public async Task CarregaApolice(long id) { return await new ApoliceServico().BuscarApoliceAsync(id); } public async Task CarregaCliente(long id) { return await new ClienteServico().BuscarClienteAsync(id); } public async Task CarregaSinistroApolice(long id) { return await new SinistroServico().BuscarSinistro(id); } public async Task CarregaApoliceParcela(long id) { return await new ParcelaServico().BuscarApolice(id); } public async Task CarregaParcela(long id) { return await new ParcelaServico().BuscarParcela(id); } public async Task CarregarProspeccao(long id) { return await new ProspeccaoServico().BuscarProspeccao(id); } public async Task> CarregarItem(long id, StatusItem status = 2) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) return (await new ItemServico().BuscarItens(id, status)).ToList(); } public async Task CreateLinkAssistencia(Documento documento, string item, bool retorno = true) { if (documento == null) { return ""; } return $"{Address.Assistance}{((DomainBase)documento).Id.GeraAssistencia()}"; } public async Task CreateCardLogo(Empresa empresa, string id = null) { if (empresa == null) { return ""; } Logo logo = new Logo { CustomId = ApplicationHelper.NumeroSerial, Data = empresa.Logo, Corretora = ((!string.IsNullOrEmpty(empresa.NomeSocial)) ? empresa.NomeSocial : empresa.Nome), Whatsapp = empresa.Whatsapp, WhatsappSinistro = empresa.WhatsappSinistro }; string text = ((!string.IsNullOrWhiteSpace(id)) ? (await logo.Atualizarlogo(id)) : (await logo.Criarlogo())); id = text; return id; } public async Task CreateSeguradora(Seguradora seguradora, string id = null) { if (seguradora == null) { return ""; } int index = 1; AssistenciaCia assistencia = new AssistenciaCia { Seguradora = seguradora.Nome, IdSeguradora = ((DomainBase)seguradora).Id, LinkAppAndroid = seguradora.LinkAppAndroid, LinkAppIos = seguradora.LinkAppIos, CustomId = ApplicationHelper.NumeroSerial }; seguradora.Contatos.OrderBy((SeguradoraContato x) => ((object)((TelefoneBase)x).Tipo.GetValueOrDefault((TipoTelefone)7)).GetType()).ToList().ForEach(delegate(SeguradoraContato x) { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Invalid comparison between Unknown and I4 //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Invalid comparison between Unknown and I4 //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Invalid comparison between Unknown and I4 //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Invalid comparison between Unknown and I4 //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Invalid comparison between Unknown and I4 //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Invalid comparison between Unknown and I4 //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Invalid comparison between Unknown and I4 //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Invalid comparison between Unknown and I4 //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Invalid comparison between Unknown and I4 switch (index) { default: assistencia.Assistencia1Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value)); assistencia.Assistencia1 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero)))); assistencia.Assistencia1Obs = x.NomeContato; break; case 2: assistencia.Assistencia2Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value)); assistencia.Assistencia2 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero)))); assistencia.Assistencia2Obs = x.NomeContato; break; case 3: assistencia.Assistencia3Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value)); assistencia.Assistencia3 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero)))); assistencia.Assistencia3Obs = x.NomeContato; break; case 4: assistencia.Assistencia4Tipo = ((!((TelefoneBase)x).Tipo.HasValue) ? 10 : ((int)((TelefoneBase)x).Tipo.Value)); assistencia.Assistencia4 = ((((TelefoneBase)x).Tipo.HasValue && (int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 10) ? ("0800-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 11) ? ("0300-" + ((TelefoneBase)x).Numero) : (((int)((TelefoneBase)x).Tipo.GetValueOrDefault() == 7 && string.IsNullOrEmpty(((TelefoneBase)x).Prefixo)) ? ((TelefoneBase)x).Numero : ("(" + ((TelefoneBase)x).Prefixo + ") " + ((TelefoneBase)x).Numero)))); assistencia.Assistencia4Obs = x.NomeContato; break; } index++; }); string text = ((!string.IsNullOrWhiteSpace(id)) ? (await assistencia.AtualizarSeguradora(id)) : (await assistencia.CriarSeguradora())); id = text; return id; } }