Example #1
0
        private void btnConfirmaAtualizar_Click(object sender, EventArgs e)
        {
            ctlContato _ctlContato = new ctlContato();

            _ctlContato.AtualizarContato(long.Parse(txtCpf.Text), txtNome.Text, long.Parse(txtFone.Text));

            MessageBox.Show("Cadastro atualizado com sucesso!");
        }
Example #2
0
        private void btnConfirmaDeletar_Click(object sender, EventArgs e)
        {
            ctlContato _ctlContato = new ctlContato();

            _ctlContato.DeletarContato(long.Parse(txtCpf.Text));

            MessageBox.Show("Cadastro excluído com sucesso!");
        }
Example #3
0
        private void btnConfirmaBuscar_Click(object sender, EventArgs e)
        {
            ctlContato _ctlContato = new ctlContato();

            _ctlContato.PesquisarContato(long.Parse(txtCpf.Text), out mdlContato _dbContato);

            if (_dbContato.nome != null)
            {
                txtCpf.Enabled = false;
                lblCpf.Enabled = false;

                txtNome.Visible = true;
                lblNome.Visible = true;

                txtFone.Visible = true;
                lblFone.Visible = true;

                btnConfirmaIncluir.Visible   = false;
                btnConfirmaBuscar.Visible    = true;
                btnConfirmaAtualizar.Visible = false;
                btnConfirmaDeletar.Visible   = false;



                txtNome.Text = _dbContato.nome;
                txtFone.Text = _dbContato.telefone.ToString();
                MessageBox.Show("Cadastro encontrado com sucesso!");

                txtNome.Enabled = false;
                lblNome.Enabled = false;
                txtFone.Enabled = false;
                lblFone.Enabled = false;

                atualizarToolStripMenuItem.Visible = true;
            }
            else
            {
                txtNome.Visible = false;
                lblNome.Visible = false;
                txtFone.Visible = false;
                lblFone.Visible = false;
                MessageBox.Show("Cadastro não encontrado!");
            }
        }