Example #1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            ClienteServiceClient servico = new ClienteServiceClient();

            servico.Add(nome, cpf);

            MessageBox.Show("Cliente Cadastrado com Sucesso");
        }
Example #2
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf = txtCpf.Text;

            ClienteServiceClient servico = new ClienteServiceClient();

            servico.Add(nome, cpf);

            MessageBox.Show("Cliente Cadastrado com Sucesso");
        }
Example #3
0
        private void btnAdicionar_Click(object sender, EventArgs e)
        {
            try
            {
                var service = new ClienteServiceClient();
                var cliente = new Cliente();
                cliente.CPF = txtCPF.Text;
                cliente.Nome = txtNome.Text;
                service.Add(cliente);

                MessageBox.Show("Cliente adicionado com sucesso!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCPF.Text;

            ClienteServiceClient servico = new ClienteServiceClient();
            Cliente cliente = new Cliente
            {
                Nome = nome,
                Cpf  = cpf
            };

            servico.Add(cliente);

            MessageBox.Show("Cliente Cadastrado");
            MessageBox.Show("Cliente Cadastrado");
        }
Example #5
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            try {
                ClienteServiceClient servico = new ClienteServiceClient();
                Cliente clienteCadastro      = new Cliente();
                clienteCadastro.Nome = nome;
                clienteCadastro.Cpf  = cpf;
                servico.Add(clienteCadastro);

                MessageBox.Show("Cliente cadastrado com sucesso");
            }
            catch (Exception)
            {
                //salvaria um log
            }
        }
Example #6
0
File: Form1.cs Project: pgori/wcf
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            try
            {
                ClienteServiceClient service = new ClienteServiceClient();
                Cliente cliente = new Cliente();
                cliente.Nome = nome;
                cliente.Cpf  = cpf;
                service.Add(cliente);

                MessageBox.Show("Cliente Cadastrado Com Sucesso");
            }
            catch (Exception)
            {
            }
        }
Example #7
0
 private void btnSalvar_Click(object sender, EventArgs e)
 {
     try
     {
         var servico = new ClienteServiceClient();
         var nome    = txtNome.Text;
         var cpf     = txtCpf.Text;
         var cliente = new Cliente()
         {
             Nome = nome,
             Cpf  = cpf
         };
         servico.Add(cliente);
         MessageBox.Show("Cliente Salvo com Sucesso");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Não foi possivel salvar o cliente");
         throw;
     }
 }
Example #8
0
        private void BtnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCpf.Text;

            try
            {
                ClienteServiceClient servico = new ClienteServiceClient();
                Cliente clienteCadastro      = new Cliente()
                {
                    Nome = nome,
                    Cpf  = cpf
                };
                servico.Add(clienteCadastro);
                MessageBox.Show("Cliente cadastrado com sucesso!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #9
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            string nome = txtNome.Text;
            string cpf  = txtCPF.Text;

            try
            {
                ClienteServiceClient servico = new ClienteServiceClient();
                Cliente cliente = new Cliente
                {
                    Nome = nome,
                    CPF  = cpf
                };

                servico.Add(cliente);

                MessageBox.Show("Cliente cadastrado com sucesso!");
            }
            catch (Exception)
            {
            }
        }