private void btnDeletar_Click(object sender, EventArgs e)
        {
            Camadas.BLL.Cliente   bllCli  = new Camadas.BLL.Cliente();
            Camadas.Model.Cliente cliente = new Camadas.Model.Cliente();
            string msg;

            if (lblIdCliente.Text != string.Empty)
            {
                msg = "Deseja Remover o Cliente Selecionado?";
                DialogResult resp;
                resp = MessageBox.Show(msg, "Remover", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (resp == DialogResult.Yes)
                {
                    cliente.idCliente = Convert.ToInt32(lblIdCliente.Text);
                    bllCli.Delete(cliente);
                }
            }
            else
            {
                msg = "Não há registro para remoção...";
                MessageBox.Show(msg, "Remover", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            dataGridView1.DataSource = "";
            dataGridView1.DataSource = bllCli.Select();
            limparCampos();
            Habilitar(false);
        }
        private void btnGravar_Click(object sender, EventArgs e)

        {
            Camadas.BLL.Cliente   bllCli  = new Camadas.BLL.Cliente();
            Camadas.Model.Cliente cliente = new Camadas.Model.Cliente();
            int idCliente = Convert.ToInt32(lblIdCliente.Text);

            string msg;

            if (idCliente == -1)
            {
                msg = "Confirma inserção dos dados?";
            }
            else
            {
                msg = "Confirma alteração dos dados?";
            }

            DialogResult resp;

            resp = MessageBox.Show(msg, "Gravar", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
            if (resp == DialogResult.Yes)
            {
                cliente.idCliente = idCliente;
                cliente.nome      = txtNome.Text;
                cliente.endereco  = txtEndereco.Text;
                cliente.telefone  = txtTelefone.Text;
                cliente.celular   = txtCelular.Text;
                cliente.cidade    = txtCidade.Text;
                cliente.estado    = txtEstado.Text;


                if (idCliente == -1)
                {
                    bllCli.Insert(cliente);
                }
                else
                {
                    bllCli.Update(cliente);
                }
            }
            dataGridView1.DataSource = "";
            dataGridView1.DataSource = bllCli.Select();
            limparCampos();
            Habilitar(false);
        }