Beispiel #1
0
        public List <Cliente> Listar(Cliente cliente)
        {
            if (string.IsNullOrEmpty(cliente.Nome))
            {
                cliente.Nome = "";
            }

            if (string.IsNullOrEmpty(cliente.Email))
            {
                cliente.Email = "";
            }

            if (string.IsNullOrEmpty(cliente.Telefone))
            {
                cliente.Telefone = "";
            }

            DadosCliente d = new DadosCliente();

            return(d.Listar(cliente));
        }
Beispiel #2
0
        public void Cadastrar(Cliente cliente)
        {
            if (string.IsNullOrEmpty(cliente.Nome))
            {
                throw new Exception("Informar o nome");
            }

            if (string.IsNullOrEmpty(cliente.Email))
            {
                throw new Exception("Informar e-mail");
            }

            if (string.IsNullOrEmpty(cliente.Telefone))
            {
                throw new Exception("Informar telefone");
            }

            DadosCliente d = new DadosCliente();

            d.Cadastrar(cliente);
        }