summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.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.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs')
-rw-r--r--Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs103
1 files changed, 103 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs
new file mode 100644
index 0000000..992960f
--- /dev/null
+++ b/Decompiler/Gestor.Application.ViewModels.Ferramentas/IncluirSeguradoraViewModel.cs
@@ -0,0 +1,103 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Gestor.Application.Helpers;
+using Gestor.Application.ViewModels.Generic;
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+
+namespace Gestor.Application.ViewModels.Ferramentas;
+
+public class IncluirSeguradoraViewModel : BaseSegurosViewModel
+{
+ private Seguradora _selectedSeguradora;
+
+ private Seguradora _adicionarSeguradora;
+
+ private List<Seguradora> _seguradorasAdicionadas;
+
+ private ObservableCollection<Seguradora> _seguradoras;
+
+ private string _filtro;
+
+ public Seguradora SelectedSeguradora
+ {
+ get
+ {
+ return _selectedSeguradora;
+ }
+ set
+ {
+ _selectedSeguradora = value;
+ OnPropertyChanged("SelectedSeguradora");
+ }
+ }
+
+ public Seguradora AdicionarSeguradora
+ {
+ get
+ {
+ return _adicionarSeguradora;
+ }
+ set
+ {
+ _adicionarSeguradora = value;
+ OnPropertyChanged("AdicionarSeguradora");
+ }
+ }
+
+ public List<Seguradora> SeguradorasAdicionadas
+ {
+ get
+ {
+ return _seguradorasAdicionadas;
+ }
+ set
+ {
+ _seguradorasAdicionadas = value;
+ OnPropertyChanged("SeguradorasAdicionadas");
+ }
+ }
+
+ public ObservableCollection<Seguradora> Seguradoras
+ {
+ get
+ {
+ return _seguradoras;
+ }
+ set
+ {
+ _seguradoras = value;
+ OnPropertyChanged("Seguradoras");
+ }
+ }
+
+ public string Filtro
+ {
+ get
+ {
+ return _filtro;
+ }
+ set
+ {
+ _filtro = value;
+ OnPropertyChanged("Filtro");
+ }
+ }
+
+ public IncluirSeguradoraViewModel(List<Seguradora> seguradoras)
+ {
+ SeguradorasAdicionadas = seguradoras;
+ }
+
+ public async void Pesquisar()
+ {
+ if (string.IsNullOrWhiteSpace(Filtro) || Filtro.Length < 3)
+ {
+ return;
+ }
+ string text = Uri.EscapeDataString(Filtro);
+ Seguradoras = new ObservableCollection<Seguradora>((await Connection.Get<List<Seguradora>>("Seguradoras/search?cia=" + text)).Where((Seguradora x) => SeguradorasAdicionadas.All((Seguradora y) => ((DomainBase)y).Id != ((DomainBase)x).Id)));
+ }
+}