diff options
Diffstat (limited to 'Gestor.Model/Model.Domain.Common/Empresa.cs')
| -rw-r--r-- | Gestor.Model/Model.Domain.Common/Empresa.cs | 546 |
1 files changed, 0 insertions, 546 deletions
diff --git a/Gestor.Model/Model.Domain.Common/Empresa.cs b/Gestor.Model/Model.Domain.Common/Empresa.cs deleted file mode 100644 index 46a001c..0000000 --- a/Gestor.Model/Model.Domain.Common/Empresa.cs +++ /dev/null @@ -1,546 +0,0 @@ -using Gestor.Model.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.Runtime.CompilerServices;
-
-namespace Gestor.Model.Domain.Common
-{
- public class Empresa : EnderecoBase, IDomain
- {
- private string _nome;
-
- private string _documento;
-
- private string _serial;
-
- private string _site;
-
- private string _email;
-
- private string _primeiroPrefixo;
-
- private string _primeiroTelefone;
-
- private string _segundoPrefixo;
-
- private string _segundoTelefone;
-
- private string _quantidadeFiliais;
-
- private string _responsavel;
-
- private string _emailResponsavel;
-
- private TipoTelefone? _tipo1;
-
- private TipoTelefone? _tipo2;
-
- public string Documento
- {
- get
- {
- string str = this._documento;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._documento = value;
- }
- }
-
- public string Email
- {
- get
- {
- string str = this._email;
- if (str == null)
- {
- return null;
- }
- return str.ToLower().Trim();
- }
- set
- {
- this._email = value;
- }
- }
-
- public string EmailResponsavel
- {
- get
- {
- string str = this._emailResponsavel;
- if (str == null)
- {
- return null;
- }
- return str.ToLower().Trim();
- }
- set
- {
- this._emailResponsavel = value;
- }
- }
-
- public string Facebook
- {
- get;
- set;
- }
-
- public string Instagram
- {
- get;
- set;
- }
-
- public string Linkdin
- {
- get;
- set;
- }
-
- public string Localizacao
- {
- get;
- set;
- }
-
- public byte[] Logo
- {
- get;
- set;
- }
-
- public string LogoId
- {
- get;
- set;
- }
-
- public int MaxFileSize
- {
- get;
- set;
- }
-
- public string Nome
- {
- get
- {
- string str = this._nome;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._nome = value;
- }
- }
-
- public string NomeSocial
- {
- get;
- set;
- }
-
- public string PrimeiroPrefixo
- {
- get
- {
- string str = this._primeiroPrefixo;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._primeiroPrefixo = value;
- }
- }
-
- public string PrimeiroTelefone
- {
- get
- {
- string str = this._primeiroTelefone;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._primeiroTelefone = value;
- }
- }
-
- public string QuantidadeFiliais
- {
- get
- {
- string str = this._quantidadeFiliais;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._quantidadeFiliais = value;
- }
- }
-
- public long QuantidadeFuncionarios
- {
- get;
- set;
- }
-
- public string Responsavel
- {
- get
- {
- string str = this._responsavel;
- if (str != null)
- {
- return str.ToUpper();
- }
- return null;
- }
- set
- {
- this._responsavel = value;
- }
- }
-
- public string SegundoPrefixo
- {
- get
- {
- string str = this._segundoPrefixo;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._segundoPrefixo = value;
- }
- }
-
- public string SegundoTelefone
- {
- get
- {
- string str = this._segundoTelefone;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._segundoTelefone = value;
- }
- }
-
- public string SenhaAdmin
- {
- get;
- set;
- }
-
- public string Serial
- {
- get
- {
- string str = this._serial;
- if (str == null)
- {
- return null;
- }
- return str.ToUpper().Trim();
- }
- set
- {
- this._serial = value;
- }
- }
-
- public string Site
- {
- get
- {
- string str = this._site;
- if (str != null)
- {
- return str.Trim();
- }
- return null;
- }
- set
- {
- this._site = value;
- }
- }
-
- public TipoTelefone TipoTelefone1
- {
- get
- {
- if (this._tipo1.HasValue)
- {
- TipoTelefone? nullable = this._tipo1;
- if (!((int)nullable.GetValueOrDefault() == 0 & nullable.HasValue))
- {
- return this._tipo1.Value;
- }
- }
- return TipoTelefone.Comercial;
- }
- set
- {
- this._tipo1 = new TipoTelefone?(value);
- }
- }
-
- public TipoTelefone TipoTelefone2
- {
- get
- {
- if (this._tipo2.HasValue)
- {
- TipoTelefone? nullable = this._tipo2;
- if (!((int)nullable.GetValueOrDefault() == 0 & nullable.HasValue))
- {
- return this._tipo2.Value;
- }
- }
- return TipoTelefone.Comercial;
- }
- set
- {
- this._tipo2 = new TipoTelefone?(value);
- }
- }
-
- public string Twitter
- {
- get;
- set;
- }
-
- [JsonIgnore]
- public Func<List<KeyValuePair<string, string>>> ValidationEvent
- {
- get
- {
- Empresa empresa = this;
- return new Func<List<KeyValuePair<string, string>>>(empresa.Validate);
- }
- }
-
- public string Whatsapp
- {
- get;
- set;
- }
-
- public string WhatsappSinistro
- {
- get;
- set;
- }
-
- public Empresa()
- {
- }
-
- public List<TupleList> Log()
- {
- List<TupleList> tupleLists = new List<TupleList>();
- TupleList tupleList = new TupleList();
- ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>()
- {
- new Tuple<string, string, string>("DOCUMENTO (CPF/CNPJ)", (string.IsNullOrWhiteSpace(this.Documento) ? "" : this.Documento), ""),
- new Tuple<string, string, string>("NÚMERO DE SÉRIE", (string.IsNullOrWhiteSpace(this.Serial) ? "" : this.Serial), ""),
- new Tuple<string, string, string>("NOME", (string.IsNullOrWhiteSpace(this.Nome) ? "" : this.Nome), ""),
- new Tuple<string, string, string>("CEP", (string.IsNullOrWhiteSpace(base.Cep) ? "" : base.Cep), ""),
- new Tuple<string, string, string>("ENDEREÇO", (string.IsNullOrWhiteSpace(base.Endereco) ? "" : base.Endereco), ""),
- new Tuple<string, string, string>("NÚMERO", (string.IsNullOrWhiteSpace(base.Numero) ? "" : base.Numero), ""),
- new Tuple<string, string, string>("BAIRRO", (string.IsNullOrWhiteSpace(base.Bairro) ? "" : base.Bairro), ""),
- new Tuple<string, string, string>("CIDADE", (string.IsNullOrWhiteSpace(base.Cidade) ? "" : base.Cidade), ""),
- new Tuple<string, string, string>("ESTADO", (string.IsNullOrWhiteSpace(base.Estado) ? "" : base.Estado), ""),
- new Tuple<string, string, string>("SITE", (string.IsNullOrWhiteSpace(this.Site) ? "" : this.Site), ""),
- new Tuple<string, string, string>("E-MAIL", (string.IsNullOrWhiteSpace(this.Email) ? "" : this.Email), ""),
- new Tuple<string, string, string>("PRIMEIRO PREFIXO", (string.IsNullOrWhiteSpace(this.PrimeiroPrefixo) ? "" : this.PrimeiroPrefixo), ""),
- new Tuple<string, string, string>("PRIMEIRO TELEFONE", (string.IsNullOrWhiteSpace(this.PrimeiroTelefone) ? "" : this.PrimeiroTelefone), ""),
- new Tuple<string, string, string>("SEGUNDO PREFIXO", (string.IsNullOrWhiteSpace(this.SegundoPrefixo) ? "" : this.SegundoPrefixo), ""),
- new Tuple<string, string, string>("SEGUNDO TELEFONE", (string.IsNullOrWhiteSpace(this.SegundoTelefone) ? "" : this.SegundoTelefone), ""),
- new Tuple<string, string, string>("E-MAIL", (string.IsNullOrWhiteSpace(this.Email) ? "" : this.Email), "")
- };
- long quantidadeFuncionarios = this.QuantidadeFuncionarios;
- observableCollection.Add(new Tuple<string, string, string>("NÚMERO DE FUNCIONÁRIOS", quantidadeFuncionarios.ToString(), ""));
- observableCollection.Add(new Tuple<string, string, string>("RESPONSÁVEL FINANCEIRO", (string.IsNullOrWhiteSpace(this.Responsavel) ? "" : this.Responsavel), ""));
- observableCollection.Add(new Tuple<string, string, string>("E-MAIL DO RESPONSÁVEL", (string.IsNullOrWhiteSpace(this.EmailResponsavel) ? "" : this.EmailResponsavel), ""));
- tupleList.Tuples = observableCollection;
- tupleLists.Add(tupleList);
- return tupleLists;
- }
-
- public List<KeyValuePair<string, string>> Validate()
- {
- List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
- if (string.IsNullOrWhiteSpace(this.Documento))
- {
- keyValuePairs.AddValue<string, string>("Documento", Messages.Obrigatorio, true);
- }
- else if (!this.Documento.ValidacaoDocumento())
- {
- keyValuePairs.AddValue<string, string>("Documento", Messages.Invalido, true);
- }
- if (string.IsNullOrWhiteSpace(this.Serial))
- {
- keyValuePairs.AddValue<string, string>("Serial", Messages.Obrigatorio, true);
- }
- else if (this.Serial.Length > 18)
- {
- keyValuePairs.AddValue<string, string>("Serial", string.Format(Messages.MaiorQueLimite, 18), true);
- }
- if (!string.IsNullOrWhiteSpace(this.Site) && this.Site.Length > 80)
- {
- keyValuePairs.AddValue<string, string>("Site", string.Format(Messages.MaiorQueLimite, 80), true);
- }
- if (!string.IsNullOrWhiteSpace(this.SenhaAdmin) && this.SenhaAdmin.Length > 90)
- {
- keyValuePairs.AddValue<string, string>("SenhaAdmin", string.Format(Messages.MaiorQueLimite, 90), true);
- }
- if (string.IsNullOrWhiteSpace(this.Nome))
- {
- keyValuePairs.AddValue<string, string>("Nome", Messages.Obrigatorio, true);
- }
- else if (this.Nome.Length > 60)
- {
- keyValuePairs.AddValue<string, string>("Nome", string.Format(Messages.MaiorQueLimite, 60), true);
- }
- if (string.IsNullOrWhiteSpace(base.Cep))
- {
- keyValuePairs.AddValue<string, string>("Cep", Messages.Obrigatorio, true);
- }
- else if (!base.Cep.ValidacaoCep())
- {
- keyValuePairs.AddValue<string, string>("Cep", Messages.Invalido, true);
- }
- if (string.IsNullOrWhiteSpace(base.Endereco))
- {
- keyValuePairs.AddValue<string, string>("Endereco", Messages.Obrigatorio, true);
- }
- else if (base.Endereco.Length > 60)
- {
- keyValuePairs.AddValue<string, string>("Endereco", string.Format(Messages.MaiorQueLimite, 60), true);
- }
- if (string.IsNullOrWhiteSpace(base.Numero))
- {
- keyValuePairs.AddValue<string, string>("Numero", Messages.Obrigatorio, true);
- }
- else if (base.Numero.Length > 10)
- {
- keyValuePairs.AddValue<string, string>("Numero", string.Format(Messages.MaiorQueLimite, 10), true);
- }
- if (!string.IsNullOrWhiteSpace(base.Complemento) && base.Complemento.Length > 100)
- {
- keyValuePairs.AddValue<string, string>("Complemento", string.Format(Messages.MaiorQueLimite, 100), true);
- }
- if (string.IsNullOrWhiteSpace(base.Bairro))
- {
- keyValuePairs.AddValue<string, string>("Bairro", Messages.Obrigatorio, true);
- }
- else if (base.Bairro.Length > 150)
- {
- keyValuePairs.AddValue<string, string>("Bairro", string.Format(Messages.MaiorQueLimite, 150), true);
- }
- if (string.IsNullOrWhiteSpace(base.Cidade))
- {
- keyValuePairs.AddValue<string, string>("Cidade", Messages.Obrigatorio, true);
- }
- else if (base.Cidade.Length > 30)
- {
- keyValuePairs.AddValue<string, string>("Cidade", string.Format(Messages.MaiorQueLimite, 30), true);
- }
- if (string.IsNullOrWhiteSpace(base.Estado))
- {
- keyValuePairs.AddValue<string, string>("Estado", Messages.Obrigatorio, true);
- }
- else if (!base.Estado.ValidacaoEstado())
- {
- keyValuePairs.AddValue<string, string>("Estado", Messages.Invalido, true);
- }
- if (string.IsNullOrWhiteSpace(this.Email))
- {
- keyValuePairs.AddValue<string, string>("Email", Messages.Obrigatorio, true);
- }
- else if (!this.Email.ValidacaoEmail())
- {
- keyValuePairs.AddValue<string, string>("Email", Messages.Invalido, true);
- }
- else if (this.Email.Length > 50)
- {
- keyValuePairs.AddValue<string, string>("Email", string.Format(Messages.MaiorQueLimite, 50), true);
- }
- if (string.IsNullOrWhiteSpace(this.EmailResponsavel))
- {
- keyValuePairs.AddValue<string, string>("EmailResponsavel", Messages.Obrigatorio, true);
- }
- else if (!this.EmailResponsavel.ValidacaoEmail())
- {
- keyValuePairs.AddValue<string, string>("EmailResponsavel", Messages.Invalido, true);
- }
- else if (this.EmailResponsavel.Length > 50)
- {
- keyValuePairs.AddValue<string, string>("EmailResponsavel", string.Format(Messages.MaiorQueLimite, 50), true);
- }
- if (!string.IsNullOrEmpty(this.Facebook) && !this.Facebook.Contains("http"))
- {
- this.Facebook = string.Concat("https://", this.Facebook.Trim());
- }
- if (!string.IsNullOrEmpty(this.Instagram) && !this.Instagram.Contains("http"))
- {
- this.Instagram = string.Concat("https://", this.Instagram.Trim());
- }
- if (!string.IsNullOrEmpty(this.Linkdin) && !this.Linkdin.Contains("http"))
- {
- this.Linkdin = string.Concat("https://", this.Linkdin.Trim());
- }
- if (!string.IsNullOrEmpty(this.Twitter) && !this.Twitter.Contains("http"))
- {
- this.Twitter = string.Concat("https://", this.Twitter.Trim());
- }
- if (!string.IsNullOrEmpty(this.Site) && !this.Site.Contains("http"))
- {
- this.Site = string.Concat("http://", this.Site.Trim());
- }
- return keyValuePairs;
- }
- }
-}
\ No newline at end of file |