//Atualizar um registro existente
        public string Update(Pais pais)
        {
            StringBuilder erros = new StringBuilder();

            if (string.IsNullOrWhiteSpace(pais.Nome))
            {
                erros.AppendLine("O nome do país deve ser informado.");
            }

            if (!string.IsNullOrWhiteSpace(pais.Nome))
            {
                if (pais.Nome.Length > 20)
                {
                    erros.AppendLine("O nome do país não pode conter mais que 20 caracteres.");
                }
            }

            if (erros.Length != 0)
            {
                return(erros.ToString());
            }

            string respostaDB = dal.Update(pais);

            return(respostaDB);
        }
Example #2
0
        public static bool Update(DTO.PaisDTO myPaisDTO)
        {
            bool resultado = PaisDAL.Update(myPaisDTO);

            return(resultado);
        }