From 225aa1499e37faf9d38257caabbadc68d78b427e Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 12:29:41 -0300 Subject: decompiler.com --- .../DialogProspeccaoViewModel.cs | 315 +++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 Decompiler/Gestor.Application.ViewModels.Generic/DialogProspeccaoViewModel.cs (limited to 'Decompiler/Gestor.Application.ViewModels.Generic/DialogProspeccaoViewModel.cs') diff --git a/Decompiler/Gestor.Application.ViewModels.Generic/DialogProspeccaoViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Generic/DialogProspeccaoViewModel.cs new file mode 100644 index 0000000..a86bb11 --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Generic/DialogProspeccaoViewModel.cs @@ -0,0 +1,315 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos.Seguros; +using Gestor.Model.Common; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Ferramentas; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; + +namespace Gestor.Application.ViewModels.Generic; + +public class DialogProspeccaoViewModel : BaseSegurosViewModel +{ + private readonly ClienteServico _servico; + + private Prospeccao _selectedProspeccao; + + private bool _isVisibleAnexos; + + private ObservableCollection _arquivosAnexados = new ObservableCollection(); + + private ArquivoDigital _selectedAnexado = new ArquivoDigital(); + + private ObservableCollection _arquivos = new ObservableCollection(); + + private Visibility _visibilityStatusPersonalizado; + + private ObservableCollection _usuarios; + + private ObservableCollection _vendedores; + + private DateTime _dataAgendamento; + + private DateTime _horaAgendamento; + + private List _produtos = Recursos.Produtos; + + private ObservableCollection _statusProspeccao; + + private List _ramos = Recursos.Ramos; + + public Prospeccao SelectedProspeccao + { + get + { + return _selectedProspeccao; + } + set + { + _selectedProspeccao = value; + OnPropertyChanged("SelectedProspeccao"); + } + } + + public bool IsVisibleAnexos + { + get + { + return _isVisibleAnexos; + } + set + { + _isVisibleAnexos = value; + OnPropertyChanged("IsVisibleAnexos"); + } + } + + public ObservableCollection ArquivosAnexados + { + get + { + return _arquivosAnexados; + } + set + { + _arquivosAnexados = value; + OnPropertyChanged("ArquivosAnexados"); + IsVisibleAnexos = value != null && value.Count > 0; + SelectedProspeccao.Anexos = value?.ToList(); + } + } + + public ArquivoDigital SelectedAnexado + { + get + { + return _selectedAnexado; + } + set + { + _selectedAnexado = value; + OnPropertyChanged("SelectedAnexado"); + } + } + + public ObservableCollection Arquivos + { + get + { + return _arquivos; + } + set + { + _arquivos = value; + OnPropertyChanged("Arquivos"); + } + } + + public Visibility VisibilityStatusPersonalizado + { + get + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + return _visibilityStatusPersonalizado; + } + set + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + _visibilityStatusPersonalizado = value; + OnPropertyChanged("VisibilityStatusPersonalizado"); + } + } + + public ObservableCollection Usuarios + { + get + { + return _usuarios; + } + set + { + _usuarios = value; + OnPropertyChanged("Usuarios"); + } + } + + public ObservableCollection Vendedores + { + get + { + return _vendedores; + } + set + { + _vendedores = value; + OnPropertyChanged("Vendedores"); + } + } + + public DateTime DataAgendamento + { + get + { + return _dataAgendamento; + } + set + { + _dataAgendamento = value; + if (SelectedProspeccao.Tarefa != null) + { + SelectedProspeccao.Tarefa.Agendamento = DateTime.Parse($"{value:d} {SelectedProspeccao.Tarefa.Agendamento:T}"); + } + OnPropertyChanged("DataAgendamento"); + } + } + + public DateTime HoraAgendamento + { + get + { + return _horaAgendamento; + } + set + { + _horaAgendamento = value; + if (SelectedProspeccao.Tarefa != null) + { + SelectedProspeccao.Tarefa.Agendamento = DateTime.Parse($"{SelectedProspeccao.Tarefa.Agendamento:d} {value:T}"); + } + OnPropertyChanged("HoraAgendamento"); + } + } + + public List Produtos + { + get + { + return _produtos; + } + set + { + _produtos = value; + OnPropertyChanged("Produtos"); + } + } + + public ObservableCollection StatusProspeccao + { + get + { + return _statusProspeccao; + } + set + { + _statusProspeccao = value; + OnPropertyChanged("StatusProspeccao"); + } + } + + public List Ramos + { + get + { + return _ramos; + } + set + { + _ramos = value; + OnPropertyChanged("Ramos"); + } + } + + public DialogProspeccaoViewModel(Prospeccao prospeccao) + { + //IL_000c: Unknown result type (might be due to invalid IL or missing references) + //IL_0016: Expected O, but got Unknown + //IL_01bc: Unknown result type (might be due to invalid IL or missing references) + //IL_01c1: Unknown result type (might be due to invalid IL or missing references) + //IL_01cc: Unknown result type (might be due to invalid IL or missing references) + //IL_01d3: Unknown result type (might be due to invalid IL or missing references) + //IL_01df: Unknown result type (might be due to invalid IL or missing references) + //IL_01ea: Unknown result type (might be due to invalid IL or missing references) + //IL_020e: Unknown result type (might be due to invalid IL or missing references) + //IL_021f: Expected O, but got Unknown + _servico = new ClienteServico(); + Usuarios = new ObservableCollection((from x in Recursos.Usuarios + where (Recursos.Usuario.IdEmpresa == 1 || x.IdEmpresa == Recursos.Usuario.IdEmpresa) && !x.Excluido + orderby x.Nome + select x).ToList()); + Vendedores = new ObservableCollection((from x in Recursos.Vendedores + where (Recursos.Usuario.IdEmpresa == 1 || x.IdEmpresa == Recursos.Usuario.IdEmpresa) && x.Ativo + orderby x.Nome + select x).ToList()); + StatusProspeccao = new ObservableCollection((from x in Recursos.StatusProspeccao + where x.Ativo + orderby x.Nome + select x).ToList()); + if (StatusProspeccao == null || StatusProspeccao.Count == 0) + { + VisibilityStatusPersonalizado = (Visibility)2; + } + if (prospeccao.Vendedor == null) + { + prospeccao.Vendedor = Vendedores.First((Vendedor x) => x.Corretora); + } + if (prospeccao.Tarefa == null) + { + prospeccao.Tarefa = new Tarefa + { + Titulo = "PROSPECÇÃO", + Entidade = (TipoTarefa)5, + IdEntidade = ((DomainBase)prospeccao).Id, + Usuario = Recursos.Usuario, + Agendamento = (prospeccao.VigenciaFinal ?? Funcoes.GetNetworkTime()), + Cliente = prospeccao.Nome + }; + } + SelectedProspeccao = prospeccao; + Tarefa tarefa = prospeccao.Tarefa; + DataAgendamento = ((tarefa != null) ? new DateTime?(tarefa.Agendamento) : null).Value; + Tarefa tarefa2 = prospeccao.Tarefa; + HoraAgendamento = ((tarefa2 != null) ? new DateTime?(tarefa2.Agendamento) : null).Value; + } + + public async Task BuscarInfoCliente(Cliente cliente) + { + cliente = await _servico.BuscarCliente(((DomainBase)cliente).Id); + Cliente val = cliente; + val.Telefones = await _servico.BuscarTelefonesAsync(((DomainBase)cliente).Id); + val = cliente; + val.Emails = await _servico.BuscarEmailsAsync(((DomainBase)cliente).Id); + return cliente; + } + + public async void Anexar() + { + List attacheds = ((IEnumerable)Arquivos).Select((Func)((IndiceArquivoDigital x) => new ArquivoDigital + { + Descricao = x.Descricao, + Extensao = x.Extensao + })).ToList(); + List list = await AddAttachments(ArquivosAnexados.ToList(), attacheds); + if (list != null) + { + list.AddRange(ArquivosAnexados); + ArquivosAnexados = new ObservableCollection(list); + } + } + + public void Delete(ArquivoDigital arquivo) + { + if (SelectedAnexado != null) + { + ArquivoDigital item = ArquivosAnexados.First((ArquivoDigital x) => x.Descricao == arquivo.Descricao); + ArquivosAnexados.Remove(item); + ArquivosAnexados = new ObservableCollection(ArquivosAnexados); + } + } +} -- cgit v1.2.3