Exemple #1
0
        public void UpdateDocumentation(string name, string cnpj)
        {
            if (IsDeleted)
            {
                throw new InvalidOperationException("Provider is deleted.");
            }

            if (!String.IsNullOrEmpty(name))
            {
                Name = name;
            }

            if (!String.IsNullOrEmpty(cnpj))
            {
                if (!BrValidator.ValidateCNPJ(cnpj))
                {
                    throw new ArgumentException("Invalid Cnpj.");
                }

                Cnpj = cnpj;
            }
        }
Exemple #2
0
        public void UpdateDocumentation(string name, string cpf)
        {
            if (IsDeleted)
            {
                throw new InvalidOperationException("Customer is deleted.");
            }

            if (!String.IsNullOrEmpty(name))
            {
                Name = name;
            }

            if (!String.IsNullOrEmpty(cpf))
            {
                if (!BrValidator.ValidateCPF(cpf))
                {
                    throw new ArgumentException("Invalid Cpf.");
                }

                Cpf = cpf;
            }
        }