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 --- .../InfoExtratoViewModel.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Decompiler/Gestor.Application.ViewModels.Financeiro/InfoExtratoViewModel.cs (limited to 'Decompiler/Gestor.Application.ViewModels.Financeiro/InfoExtratoViewModel.cs') diff --git a/Decompiler/Gestor.Application.ViewModels.Financeiro/InfoExtratoViewModel.cs b/Decompiler/Gestor.Application.ViewModels.Financeiro/InfoExtratoViewModel.cs new file mode 100644 index 0000000..1cf33dc --- /dev/null +++ b/Decompiler/Gestor.Application.ViewModels.Financeiro/InfoExtratoViewModel.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Gestor.Application.Servicos.Financeiro; +using Gestor.Application.ViewModels.Generic; +using Gestor.Model.Domain.Financeiro; +using Gestor.Model.Domain.Generic; + +namespace Gestor.Application.ViewModels.Financeiro; + +public class InfoExtratoViewModel : BaseFinanceiroViewModel +{ + private readonly BancosContasServico _saldoServico; + + private Saldo _selectedSaldo; + + public bool _telaBancos { get; set; } + + public Saldo SelectedSaldo + { + get + { + return _selectedSaldo; + } + set + { + if (value != null && !_telaBancos) + { + value.DataFinal = null; + value.ValorFinal = null; + } + _selectedSaldo = value; + OnPropertyChanged("SelectedSaldo"); + ((DomainBase)SelectedSaldo).Initialize(); + } + } + + public InfoExtratoViewModel(bool telaBancos) + { + _telaBancos = telaBancos; + _saldoServico = new BancosContasServico(); + } + + public async Task>> Salvar() + { + List> list = SelectedSaldo.Validate(); + if (list.Count > 0) + { + return list; + } + if (!_telaBancos) + { + SelectedSaldo.DataFinal = null; + SelectedSaldo.ValorFinal = null; + } + SelectedSaldo = await _saldoServico.Save(SelectedSaldo); + if (!_saldoServico.Sucesso) + { + return null; + } + Alterar(alterar: false); + ToggleSnackBar("SALDO SALVO COM SUCESSO"); + return null; + } +} -- cgit v1.2.3