Example #1
0
        public ClientResponse VerifyIfClientIsValid(ClientModel client)
        {
            _regex = new RegexValidation();

            if (!_regex.ValidateCnpj(client.Cnpj))
            {
                return new ClientResponse()
                       {
                           Success = false, Message = "Invalid Cnpj format."
                       }
            }
            ;

            if (!_regex.ValidatePhone(client.Phone))
            {
                return new ClientResponse()
                       {
                           Success = false, Message = "Phone format invalid."
                       }
            }
            ;

            return(new ClientResponse()
            {
                Success = true, Message = string.Empty
            });
        }