diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 13:38:18 +0000 |
| commit | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch) | |
| tree | e1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs | |
| parent | 674ca83ba9243a9e95a7568c797668dab6aee26a (diff) | |
| download | gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip | |
chore: location
Diffstat (limited to 'Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs')
| -rw-r--r-- | Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs b/Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs new file mode 100644 index 0000000..d1a0c38 --- /dev/null +++ b/Codemerx/Gestor.Application/ViewModels/Financeiro/InfoExtratoViewModel.cs @@ -0,0 +1,81 @@ +using Gestor.Application.Servicos.Financeiro;
+using Gestor.Application.Servicos.Generic;
+using Gestor.Application.ViewModels.Generic;
+using Gestor.Model.Domain.Financeiro;
+using Gestor.Model.Domain.Generic;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+
+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 this._selectedSaldo;
+ }
+ set
+ {
+ if (value != null && !this._telaBancos)
+ {
+ value.set_DataFinal(null);
+ value.set_ValorFinal(null);
+ }
+ this._selectedSaldo = value;
+ base.OnPropertyChanged("SelectedSaldo");
+ this.SelectedSaldo.Initialize();
+ }
+ }
+
+ public InfoExtratoViewModel(bool telaBancos)
+ {
+ this._telaBancos = telaBancos;
+ this._saldoServico = new BancosContasServico();
+ }
+
+ public async Task<List<KeyValuePair<string, string>>> Salvar()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs;
+ List<KeyValuePair<string, string>> keyValuePairs1 = this.SelectedSaldo.Validate();
+ if (keyValuePairs1.Count <= 0)
+ {
+ if (!this._telaBancos)
+ {
+ this.SelectedSaldo.set_DataFinal(null);
+ this.SelectedSaldo.set_ValorFinal(null);
+ }
+ this.SelectedSaldo = await this._saldoServico.Save(this.SelectedSaldo);
+ if (this._saldoServico.Sucesso)
+ {
+ base.Alterar(false);
+ base.ToggleSnackBar("SALDO SALVO COM SUCESSO", true);
+ keyValuePairs = null;
+ }
+ else
+ {
+ keyValuePairs = null;
+ }
+ }
+ else
+ {
+ keyValuePairs = keyValuePairs1;
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file |