Example #1
0
        public string GetEnderecoCompleto()
        {
            var endereco = Endereco?.Trim() ?? "";

            if (string.IsNullOrWhiteSpace(Endereco))
            {
                return(string.Empty);
            }

            if (!string.IsNullOrWhiteSpace(NumeroDoEndereco))
            {
                endereco += $", {NumeroDoEndereco.Trim()}";
            }
            if (!string.IsNullOrWhiteSpace(Bairro))
            {
                endereco += $" - {Bairro.Trim()}";
            }
            if (!string.IsNullOrWhiteSpace(Cidade))
            {
                endereco += $" - {Cidade.Trim()}";
            }
            if (!string.IsNullOrWhiteSpace(Uf))
            {
                endereco += $" - {Uf.Trim()}";
            }

            return(endereco);
        }
Example #2
0
        public bool Validar(out string Alertas)
        {
            StringBuilder msg = new StringBuilder();

            if (string.IsNullOrEmpty(Nome.Trim()))
            {
                msg.Append("Insira o Nome do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Sobrenome.Trim()))
            {
                msg.Append("Insira o Sobrenome do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Cpf.Trim()))
            {
                msg.Append("Insira o CPF do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Telefone.Trim()))
            {
                msg.Append("Insira o Numero de Telefone do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Rua.Trim()))
            {
                msg.Append("Insira o Logradouro do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Numero.Trim()))
            {
                msg.Append("Insira o Numero do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Bairro.Trim()))
            {
                msg.Append("Insira o Bairro do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(UF.Trim()))
            {
                msg.Append("Insira a UF do Cliente.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(CEP.Trim()))
            {
                msg.Append("Insira o Cep do Cliente.");
                msg.AppendLine();
            }
            Alertas = msg.ToString();
            return(msg.Length == 0);
        }
Example #3
0
 public Endereco ConvertyToEntity()
 {
     return(new Endereco
     {
         Bairro = Bairro == null ? null : Bairro.Trim(),
         Cep = Cep.Trim(),
         Complemento = Complemento == null ? null : Complemento.Trim(),
         Localidade = Localidade == null ? null : Localidade.Trim(),
         Logradouro = Logradouro == null ? null : Logradouro.Trim(),
         Status = true,
         Uf = Uf == null ? null : Uf.Trim()
     });
 }
Example #4
0
        public bool Validar(out string Alertas)
        {
            StringBuilder msg = new StringBuilder();

            if (string.IsNullOrEmpty(Nome.Trim()))
            {
                msg.Append("É necessário informar o nome do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Sobrenome.Trim()))
            {
                msg.Append("É necessário informar o sobrenome do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Rua.Trim()))
            {
                msg.Append("É necessário informar a rua do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Cidade.Trim()))
            {
                msg.Append("É necessário informar a cidade do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Bairro.Trim()))
            {
                msg.Append("É necessário informar o Bairro do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(CEP.Trim()))
            {
                msg.Append("É necessário informar o CEP do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(UF.Trim()))
            {
                msg.Append("É necessário informar o UF do Funcionario.");
                msg.AppendLine();
            }
            else if (string.IsNullOrEmpty(Telefone.Trim()))
            {
                msg.Append("É necessário informar o Telefone do Funcionario.");
                msg.AppendLine();
            }

            Alertas = msg.ToString();
            return(msg.Length == 0);
        }