using Gestor.Model.Attributes; using System; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; namespace Gestor.Model.Domain.Generic { public class EnderecoBase : DomainBase { private string _cep; private string _endereco; private string _numero; private string _bairro; private string _cidade; private string _estado; [Log(true)] public string Bairro { get { return this._bairro; } set { this._bairro = value; } } [Log(true)] public string Cep { get { if (this._cep == null || !Regex.IsMatch(this._cep, "[0-9]+")) { return ""; } return this._cep.Trim(); } set { this._cep = value; } } [Log(true)] public string Cidade { get { return this._cidade; } set { this._cidade = value; } } [Log(true)] public string Complemento { get; set; } [Description("ENDEREÇO")] [Log(true)] public string Endereco { get { return this._endereco; } set { this._endereco = value; } } [Log(true)] public string Estado { get { string str = this._estado; if (str == null) { return null; } return str.ToUpper().Trim(); } set { this._estado = value; } } [Description("NÚMERO")] [Log(true)] public string Numero { get { string str = this._numero; if (str != null) { return str.ToUpper(); } return null; } set { this._numero = value; } } public EnderecoBase() { } } }