summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs')
-rw-r--r--Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs100
1 files changed, 100 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs
new file mode 100644
index 0000000..39f6c10
--- /dev/null
+++ b/Decompiler/Gestor.Application.ViewModels.Drawer.Ajuda/BoletosNotasViewModel.cs
@@ -0,0 +1,100 @@
+using System.Collections.Generic;
+using System.Linq;
+using Gestor.Application.Model.Ajuda;
+using Gestor.Application.Servicos.Ajuda;
+using Gestor.Application.ViewModels.Generic;
+
+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 bool Carregando
+ {
+ get
+ {
+ return _carregando;
+ }
+ set
+ {
+ _carregando = value;
+ base.IsEnabled = !value;
+ base.EnableMenu = !value;
+ OnPropertyChanged("Carregando");
+ }
+ }
+
+ public List<Boleto> Boletos
+ {
+ get
+ {
+ return _boletos;
+ }
+ set
+ {
+ _boletos = value;
+ OnPropertyChanged("Boletos");
+ }
+ }
+
+ public string BoletoDisponivel
+ {
+ get
+ {
+ return _boletoDisponivel;
+ }
+ set
+ {
+ _boletoDisponivel = value;
+ OnPropertyChanged("BoletoDisponivel");
+ }
+ }
+
+ public List<string> Status
+ {
+ get
+ {
+ return _status;
+ }
+ set
+ {
+ _status = value;
+ OnPropertyChanged("Status");
+ }
+ }
+
+ public BoletosNotasViewModel()
+ {
+ _ajudaServico = new AjudaServico();
+ LoadCombos();
+ BoletoDisponivel = "Disponível para impressão a partir de\n10 (dez) dias antes do vencimento";
+ }
+
+ private void LoadCombos()
+ {
+ Status = new List<string>();
+ Status.Add("PENDENTES");
+ Status.Add("BAIXADOS");
+ }
+
+ public async void WorkOnSelectedStatus(string value)
+ {
+ Carregando = true;
+ Boletos = new List<Boleto>();
+ List<Boleto> list = await _ajudaServico.BuscarBoletosNotas(value);
+ Boletos = ((value == "BAIXADOS") ? (from x in list
+ where x.Pagamento.HasValue
+ orderby x.Pagamento descending
+ select x).ToList() : list);
+ Carregando = false;
+ }
+}