From 674ca83ba9243a9e95a7568c797668dab6aee26a Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:35:25 -0300 Subject: feat: upload files --- .../Model.Domain.Financeiro/BancosContas.cs | 195 +++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 Gestor.Model/Model.Domain.Financeiro/BancosContas.cs (limited to 'Gestor.Model/Model.Domain.Financeiro/BancosContas.cs') diff --git a/Gestor.Model/Model.Domain.Financeiro/BancosContas.cs b/Gestor.Model/Model.Domain.Financeiro/BancosContas.cs new file mode 100644 index 0000000..06eade3 --- /dev/null +++ b/Gestor.Model/Model.Domain.Financeiro/BancosContas.cs @@ -0,0 +1,195 @@ +using Gestor.Model.Attributes; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.Domain.Seguros; +using Gestor.Model.Helper; +using Gestor.Model.Resources; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Gestor.Model.Domain.Financeiro +{ + public class BancosContas : DomainBase, IDomain + { + private string _descricao; + + private string _agencia; + + private string _conta; + + private string _observacao; + + [Description("AGÊNCIA")] + [Log(true)] + public string Agencia + { + get + { + string str = this._agencia; + if (str == null) + { + return null; + } + return str.ToUpper().Trim(); + } + set + { + this._agencia = value; + } + } + + [Log(true)] + public bool Ativo + { + get; + set; + } + + [Log(true)] + public Gestor.Model.Domain.Common.Banco Banco + { + get; + set; + } + + [Log(true)] + public string Conta + { + get + { + string str = this._conta; + if (str == null) + { + return null; + } + return str.ToUpper().Trim(); + } + set + { + this._conta = value; + } + } + + [Description("DESCRIÇÃO")] + [Log(true)] + [Name(true)] + public string Descricao + { + get + { + string str = this._descricao; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._descricao = value; + } + } + + public long IdEmpresa { get; set; } = (long)1; + + [Description("OBSERVAÇÃO")] + [Log(true)] + public string Observacao + { + get + { + string str = this._observacao; + if (str != null) + { + return str.ToUpper(); + } + return null; + } + set + { + this._observacao = value; + } + } + + public bool Selecionado + { + get; + set; + } + + [JsonIgnore] + public Func>> ValidationEvent + { + get + { + BancosContas bancosConta = this; + return new Func>>(bancosConta.Validate); + } + } + + public BancosContas() + { + } + + public List Log() + { + string nome; + List tupleLists = new List(); + TupleList tupleList = new TupleList(); + ObservableCollection> observableCollection = new ObservableCollection>() + { + new Tuple("DESCRIÇÃO", (string.IsNullOrWhiteSpace(this.Descricao) ? "" : this.Descricao), ""), + new Tuple("AGÊNCIA", (string.IsNullOrWhiteSpace(this.Agencia) ? "" : this.Agencia), "") + }; + if (this.Banco == null) + { + nome = ""; + } + else + { + Gestor.Model.Domain.Common.Banco banco = this.Banco; + if (banco != null) + { + nome = banco.Nome; + } + else + { + nome = null; + } + } + observableCollection.Add(new Tuple("BANCO", nome, "")); + observableCollection.Add(new Tuple("CONTA CORRENTE/POUPANÇA", (string.IsNullOrWhiteSpace(this.Conta) ? "" : this.Conta), "")); + observableCollection.Add(new Tuple("ATIVO", (this.Ativo ? "SIM" : "NÃO"), "")); + observableCollection.Add(new Tuple("OBSERVAÇÕES", (string.IsNullOrWhiteSpace(this.Observacao) ? "" : this.Observacao), "")); + tupleList.Tuples = observableCollection; + tupleLists.Add(tupleList); + return tupleLists; + } + + public List> Validate() + { + List> keyValuePairs = new List>(); + if (string.IsNullOrWhiteSpace(this.Descricao)) + { + keyValuePairs.AddValue("Descricao|DESCRIÇÃO", Messages.Obrigatorio, true); + } + if (this.Banco == null) + { + keyValuePairs.AddValue("Banco", Messages.Obrigatorio, true); + } + if (string.IsNullOrWhiteSpace(this.Agencia)) + { + keyValuePairs.AddValue("Agencia|AGÊNCIA", Messages.Obrigatorio, true); + } + if (string.IsNullOrWhiteSpace(this.Conta)) + { + keyValuePairs.AddValue("Conta", Messages.Obrigatorio, true); + } + return keyValuePairs; + } + } +} \ No newline at end of file -- cgit v1.2.3