예제 #1
0
        //ATUALIZAR
        public static void Atualizar(MPessoa item)
        {
            if (item == null)
            {
                throw new Exception("Objeto PESSOA inválido");
            }

            if (item.Nome.Trim() == "" || item.Nome.Length > 200)
            {
                throw new Exception("Nome digitado inválido");
            }

            if (item.DataNascimento >= DateTime.Now)
            {
                throw new Exception("Ano de Nascimento não pode ser maior que a data atual!");
            }

            try
            {
                DPessoa.Atualizar(item);
            }
            catch
            {
                throw;
            }
        }
예제 #2
0
        public static void Atualizar(MPessoa item)
        {
            if (item == null)
            {
                throw new Exception("Objeto PESSOA inválido");
            }

            if (item.Nome.Trim() == "" || item.Nome.Length > 200)
            {
                throw new Exception("Objeto PESSOA nome inválido");
            }

            try
            {
                DPessoa.Atualizar(item);
            }
            catch
            {
                throw;
            }
        }