summaryrefslogtreecommitdiff
path: root/Gestor.Application/ViewModels/Drawer/InfoViewModel.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
commit1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch)
treee1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Gestor.Application/ViewModels/Drawer/InfoViewModel.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Gestor.Application/ViewModels/Drawer/InfoViewModel.cs')
-rw-r--r--Gestor.Application/ViewModels/Drawer/InfoViewModel.cs208
1 files changed, 0 insertions, 208 deletions
diff --git a/Gestor.Application/ViewModels/Drawer/InfoViewModel.cs b/Gestor.Application/ViewModels/Drawer/InfoViewModel.cs
deleted file mode 100644
index 1352f12..0000000
--- a/Gestor.Application/ViewModels/Drawer/InfoViewModel.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using Gestor.Application.Servicos;
-using Gestor.Application.Servicos.Seguros;
-using Gestor.Application.Servicos.Seguros.Itens;
-using Gestor.Application.ViewModels.Generic;
-using Gestor.Model.Common;
-using Gestor.Model.Domain.Common;
-using Gestor.Model.Domain.Generic;
-using Gestor.Model.Domain.Seguros;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace Gestor.Application.ViewModels.Drawer
-{
- public class InfoViewModel : BaseViewModel
- {
- private ObservableCollection<Contato> _contatos = new ObservableCollection<Contato>();
-
- private ObservableCollection<Item> _itens = new ObservableCollection<Item>();
-
- private ObservableCollection<Parcela> _parcelas = new ObservableCollection<Parcela>();
-
- private Gestor.Model.Domain.Seguros.Documento _documento;
-
- private Visibility _ocultarInfos;
-
- private bool _carregando;
-
- public bool Carregando
- {
- get
- {
- return this._carregando;
- }
- set
- {
- this._carregando = value;
- base.IsEnabled = !value;
- base.EnableMenu = !value;
- base.OnPropertyChanged("Carregando");
- }
- }
-
- public ObservableCollection<Contato> Contatos
- {
- get
- {
- return this._contatos;
- }
- set
- {
- this._contatos = value;
- base.OnPropertyChanged("Contatos");
- }
- }
-
- public Gestor.Model.Domain.Seguros.Documento Documento
- {
- get
- {
- return this._documento;
- }
- set
- {
- this._documento = value;
- base.OnPropertyChanged("Documento");
- }
- }
-
- public ObservableCollection<Item> Itens
- {
- get
- {
- return this._itens;
- }
- set
- {
- this._itens = value;
- base.OnPropertyChanged("Itens");
- }
- }
-
- public Visibility OcultarInfos
- {
- get
- {
- return this._ocultarInfos;
- }
- set
- {
- this._ocultarInfos = value;
- base.OnPropertyChanged("OcultarInfos");
- }
- }
-
- public ObservableCollection<Parcela> Parcelas
- {
- get
- {
- return this._parcelas;
- }
- set
- {
- this._parcelas = value;
- base.OnPropertyChanged("Parcelas");
- }
- }
-
- public InfoViewModel(Gestor.Model.Domain.Seguros.Documento documento, bool ocultarInfos)
- {
- this.Documento = documento;
- this.OcultarInfos = (ocultarInfos ? Visibility.Collapsed : Visibility.Visible);
- this.Seleciona();
- }
-
- public string GerarObs(Gestor.Model.Domain.Seguros.Documento doc)
- {
- if (doc.get_Tipo() == 0)
- {
- return string.Format("CLIENTE: {0}{1}CÓDIGO: {2}{3}PROPOSTA: {4}{5}APÓLICE: {6}", new object[] { doc.get_Controle().get_Cliente().get_Nome(), Environment.NewLine, doc.get_Id(), Environment.NewLine, doc.get_Proposta(), Environment.NewLine, doc.get_Apolice() });
- }
- return string.Format("CLIENTE: {0}{1}CÓDIGO: {2}{3}PROPOSTA: {4}{5}APÓLICE: {6}{7}PROPOSTA DE ENDOSSO: {8}{9}ENDOSSO: {10}", new object[] { doc.get_Controle().get_Cliente().get_Nome(), Environment.NewLine, doc.get_Id(), Environment.NewLine, doc.get_Proposta(), Environment.NewLine, doc.get_Apolice(), Environment.NewLine, doc.get_PropostaEndosso(), Environment.NewLine, doc.get_Endosso() });
- }
-
- public async void Seleciona()
- {
- bool controle;
- ObservableCollection<Parcela> observableCollection;
- this.Carregando = true;
- if (this.Documento != null)
- {
- this.Documento = await (new ApoliceServico()).BuscarApoliceAsync(this.Documento.get_Id(), false, false);
- }
- if (this.OcultarInfos == Visibility.Visible && this.Documento != null)
- {
- ObservableCollection<Parcela> observableCollection1 = await (new ParcelaServico()).BuscarParcelasAsync(this.Documento.get_Id());
- InfoViewModel infoViewModel = this;
- if (this.Documento.get_TipoRecebimento().GetValueOrDefault() == 2)
- {
- ObservableCollection<Parcela> observableCollection2 = observableCollection1;
- observableCollection = new ObservableCollection<Parcela>(
- from x in observableCollection2
- orderby x.get_VigenciaIncial() descending
- select x);
- }
- else
- {
- observableCollection = observableCollection1;
- }
- infoViewModel.Parcelas = observableCollection;
- }
- Gestor.Model.Domain.Seguros.Documento documento = this.Documento;
- if (documento != null)
- {
- controle = documento.get_Controle();
- }
- else
- {
- controle = false;
- }
- if (controle)
- {
- this.Itens = await (new ItemServico()).BuscarItens(this.Documento.get_Controle().get_Id(), 0);
- List<Contato> contatos = new List<Contato>();
- ClienteServico clienteServico = new ClienteServico();
- if (this.Documento.get_Controle().get_Cliente() != null)
- {
- ObservableCollection<ClienteTelefone> observableCollection3 = await clienteServico.BuscarTelefonesAsync(this.Documento.get_Controle().get_Cliente().get_Id());
- ObservableCollection<ClienteEmail> observableCollection4 = await clienteServico.BuscarEmailsAsync(this.Documento.get_Controle().get_Cliente().get_Id());
- if (observableCollection3 != null)
- {
- List<Contato> contatos1 = contatos;
- ObservableCollection<ClienteTelefone> observableCollection5 = observableCollection3;
- contatos1.AddRange(observableCollection5.Select<ClienteTelefone, Contato>((ClienteTelefone x) => {
- Contato contato = new Contato();
- contato.set_Tipo(0);
- contato.set_TipoTelefone(new TipoTelefone?(x.get_Tipo().GetValueOrDefault(1)));
- contato.set_Numero(string.Concat(x.get_Prefixo(), " ", x.get_Numero()));
- return contato;
- }).Take<Contato>(2).ToList<Contato>());
- }
- if (observableCollection4 != null)
- {
- List<Contato> contatos2 = contatos;
- ObservableCollection<ClienteEmail> observableCollection6 = observableCollection4;
- contatos2.AddRange(observableCollection6.Select<ClienteEmail, Contato>((ClienteEmail x) => {
- Contato contato = new Contato();
- contato.set_Tipo(1);
- contato.set_TipoTelefone(null);
- contato.set_Numero(x.get_Email());
- return contato;
- }).Take<Contato>(1).ToList<Contato>());
- }
- observableCollection3 = null;
- }
- this.Contatos = new ObservableCollection<Contato>(contatos);
- contatos = null;
- clienteServico = null;
- }
- this.Carregando = false;
- }
- }
-} \ No newline at end of file