summaryrefslogtreecommitdiff
path: root/Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
commit674ca83ba9243a9e95a7568c797668dab6aee26a (patch)
tree4a905b3fb1d827665a34d63f67bc5559f8e7235b /Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs
downloadgestor-674ca83ba9243a9e95a7568c797668dab6aee26a.tar.gz
gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.zip
feat: upload files
Diffstat (limited to 'Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs')
-rw-r--r--Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs122
1 files changed, 122 insertions, 0 deletions
diff --git a/Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs b/Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs
new file mode 100644
index 0000000..6f2e250
--- /dev/null
+++ b/Gestor.Application/ViewModels/Drawer/Ajuda/BoletosNotasViewModel.cs
@@ -0,0 +1,122 @@
+using Gestor.Application.Model.Ajuda;
+using Gestor.Application.Servicos.Ajuda;
+using Gestor.Application.ViewModels.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+
+namespace Gestor.Application.ViewModels.Drawer.Ajuda
+{
+ public class BoletosNotasViewModel : BaseViewModel
+ {
+ private readonly AjudaServico _ajudaServico;
+
+ private bool _carregando;
+
+ private List<Boleto> _boletos;
+
+ private string _boletoDisponivel;
+
+ private List<string> _status;
+
+ public string BoletoDisponivel
+ {
+ get
+ {
+ return this._boletoDisponivel;
+ }
+ set
+ {
+ this._boletoDisponivel = value;
+ base.OnPropertyChanged("BoletoDisponivel");
+ }
+ }
+
+ public List<Boleto> Boletos
+ {
+ get
+ {
+ return this._boletos;
+ }
+ set
+ {
+ this._boletos = value;
+ base.OnPropertyChanged("Boletos");
+ }
+ }
+
+ public bool Carregando
+ {
+ get
+ {
+ return this._carregando;
+ }
+ set
+ {
+ this._carregando = value;
+ base.IsEnabled = !value;
+ base.EnableMenu = !value;
+ base.OnPropertyChanged("Carregando");
+ }
+ }
+
+ public List<string> Status
+ {
+ get
+ {
+ return this._status;
+ }
+ set
+ {
+ this._status = value;
+ base.OnPropertyChanged("Status");
+ }
+ }
+
+ public BoletosNotasViewModel()
+ {
+ this._ajudaServico = new AjudaServico();
+ this.LoadCombos();
+ this.BoletoDisponivel = "Disponível para impressão a partir de\n10 (dez) dias antes do vencimento";
+ }
+
+ private void LoadCombos()
+ {
+ this.Status = new List<string>()
+ {
+ "PENDENTES",
+ "BAIXADOS"
+ };
+ }
+
+ public async void WorkOnSelectedStatus(string value)
+ {
+ List<Boleto> list;
+ this.Carregando = true;
+ this.Boletos = new List<Boleto>();
+ List<Boleto> boletos = await this._ajudaServico.BuscarBoletosNotas(value);
+ BoletosNotasViewModel boletosNotasViewModel = this;
+ if (value == "BAIXADOS")
+ {
+ List<Boleto> boletos1 = boletos;
+ IEnumerable<Boleto> hasValue =
+ from x in boletos1
+ where x.Pagamento.HasValue
+ select x;
+ list = (
+ from x in hasValue
+ orderby x.Pagamento descending
+ select x).ToList<Boleto>();
+ }
+ else
+ {
+ list = boletos;
+ }
+ boletosNotasViewModel.Boletos = list;
+ this.Carregando = false;
+ }
+ }
+} \ No newline at end of file