diff options
Diffstat (limited to 'Decompiler/Gestor.Application.ViewModels.Generic/BaseSegurosViewModel.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.ViewModels.Generic/BaseSegurosViewModel.cs | 656 |
1 files changed, 656 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.ViewModels.Generic/BaseSegurosViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Generic/BaseSegurosViewModel.cs new file mode 100644 index 0000000..b481bbb --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Generic/BaseSegurosViewModel.cs @@ -0,0 +1,656 @@ +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<object> 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<object> AgendaItemFilter => (string searchText, object obj) => ((Agenda)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> 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<object> ProfissaoItemFilter => (string searchText, object obj) => ((Profissao)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Profissao)obj).Codigo.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> EstipulanteItemFilter => (string searchText, object obj) => ((Estipulante)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Estipulante)obj).Documento.ToString().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> ProdutoItemFilter => (string searchText, object obj) => ((Produto)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> TipoTarefaItemFilter => (string searchText, object obj) => ((TipoDeTarefa)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> StatusProspeccaoItemFilter => (string searchText, object obj) => ((StatusDeProspeccao)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> NotaFiscalItemFilter => (string searchText, object obj) => ((NotaFiscal)obj).Seguradora.Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> StatusItemFilter => (string searchText, object obj) => ((Status)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> ReciboItemFilter => (string searchText, object obj) => ((Recibo)obj).Pagante.ToUpper().Contains(searchText.ToUpper()) || ((Recibo)obj).Recebedor.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> EtiquetaItemFilter => (string searchText, object obj) => ((Documento)obj).Controle.Cliente.Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> 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<object> 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<object> UsuarioItemFilter => (string searchText, object obj) => ((Usuario)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Usuario)obj).Documento.ToString().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> NomeItemFilter => (string searchText, object obj) => ((Credencial)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> BancoItemFilter => (string searchText, object obj) => ((Banco)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Banco)obj).Codigo.ToString().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> AtividadeItemFilter => (string searchText, object obj) => ((Atividade)obj).Nome.ToUpper().Contains(searchText.ToUpper()) || ((Atividade)obj).Cnac.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> FabricanteItemFilter => (string searchText, object obj) => ((Fabricante)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> 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<object> ConfigItemFilter => (string searchText, object obj) => ((ConfigExtratoImport)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> ParceiroItemFilter => (string searchText, object obj) => ((Parceiro)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> TipoVendedorItemFilter => (string searchText, object obj) => ((TipoVendedor)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> RamoItemFilter => (string searchText, object obj) => ((Ramo)obj).Nome.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> ItemFilter => (string searchText, object obj) => ((Item)obj).Descricao.ToUpper().Contains(searchText.ToUpper()); + + public AutoCompleteFilterPredicate<object> 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<object> 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<Cliente> FilterCliente(List<Cliente> 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<List<Cliente>> BuscarClienteEmpresa(string value) + { + return await Task.Run(() => new BaseServico().BuscarClienteEmpresa(value)); + } + + internal async Task<List<Cliente>> BuscarCliente(string value, List<long> 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<List<Cliente>> BuscarClienteVinculo(string value, long id) + { + return await Task.Run(() => new ClienteServico().BuscarClienteVinculo(value, id)); + } + + internal async Task<List<Profissao>> BuscarProfissao(string value) + { + return await Task.Run(() => new BaseServico().BuscarProfissao(value)); + } + + internal async Task<List<Atividade>> BuscarAtividade(string value) + { + return await Task.Run(() => new BaseServico().BuscarAtividade(value)); + } + + internal async Task<List<Fabricante>> BuscaFabricante(string value) + { + return await Task.Run(() => new BaseServico().BuscarFabricante(value)); + } + + internal async Task<List<Usuario>> BuscarUsuario(string value) + { + return await Task.Run(() => new BaseServico().BuscarUsuario(value)); + } + + internal async Task ShowDetalheExtrato(List<DetalheExtrato> 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<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Fipe> 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<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<string> 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<string> ExecuteRunExtendedDialogObservacao(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Fipe> ExecuteRunExtendedDialogBuscaModelo(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<VinculoRepasse> ShowVinculoDialog(VinculoRepasse vinculo, List<Repasse> 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<VinculoRepasse> ExecuteRunExtendedDialogVinculo(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Tarefa> ShowTarefaDialog(Tarefa tarefa, bool nota = false, bool agendamento = false) + { + DialogHost host = GetHost(); + if (host != null && host.IsOpen) + { + return null; + } + List<TelefoneBase> telefones = new List<TelefoneBase>(); + if (tarefa != null && tarefa.IdCliente > 0) + { + telefones = (await new ClienteServico().BuscarTelefonesAsync(tarefa.IdCliente)).Where((ClienteTelefone x) => ValidationHelper.ValidacaoTelefone(((TelefoneBase)x).Numero)).Select((Func<ClienteTelefone, TelefoneBase>)((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<ObservableCollection<Item>> 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<ObservableCollection<Item>> ShowReordenarItensDialog(List<long> 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<List<Documento>> ShowProtocoloDialog(List<Documento> 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<List<Documento>> ExecuteRunExtendedDialogProtocolo(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Documento>)obj).ToList(); + } + + public async Task<ObservableCollection<Item>> ExecuteRunExtendedDialogReordenarItens(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Item>)obj; + } + + public async Task<ObservableCollection<Item>> ExecuteRunExtendedDialogSelecionarItens(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Item>)obj; + } + + internal async Task<Tuple<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>> 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<List<Usuario>> 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<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<MalaDireta> lista, bool assinatura, bool original, List<ArquivoDigital> 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<PesquisaAvancada> 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<Tarefa> ExecuteRunExtendedDialogTarefa(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Tuple<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>> ExecuteRunExtendedDialogCopiarPermiss(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<List<PermissaoUsuario>, Usuario, List<RestricaoUsuario>, List<PermissaoArquivoDigital>, List<RestricaoUsuarioCamposRelatorios>>)obj; + } + + public async Task<List<Usuario>> ExecuteRunExtendedDialogExportarPermiss(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Usuario>)obj; + } + + public async Task ExecuteRunExtendedDialogEnviarEmails(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<PesquisaAvancada> ExecuteRunExtendedDialogPesquisaAvancada(UserControl dialogControl, string hostName) + { + Extentions.FindVisualChildren<WebEditor>((DependencyObject)(object)((IEnumerable)Application.Current.Windows).OfType<Window>().SingleOrDefault((Func<Window, bool>)((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<Documento> CarregaApolice(long id) + { + return await new ApoliceServico().BuscarApoliceAsync(id); + } + + public async Task<Cliente> CarregaCliente(long id) + { + return await new ClienteServico().BuscarClienteAsync(id); + } + + public async Task<Sinistro> CarregaSinistroApolice(long id) + { + return await new SinistroServico().BuscarSinistro(id); + } + + public async Task<Documento> CarregaApoliceParcela(long id) + { + return await new ParcelaServico().BuscarApolice(id); + } + + public async Task<Parcela> CarregaParcela(long id) + { + return await new ParcelaServico().BuscarParcela(id); + } + + public async Task<Prospeccao> CarregarProspeccao(long id) + { + return await new ProspeccaoServico().BuscarProspeccao(id); + } + + public async Task<List<Item>> 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<string> CreateLinkAssistencia(Documento documento, string item, bool retorno = true) + { + if (documento == null) + { + return ""; + } + return $"{Address.Assistance}{((DomainBase)documento).Id.GeraAssistencia()}"; + } + + public async Task<string> 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<string> 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; + } +} |