Ejemplo n.º 1
0
        private void btnRemover_Click(object sender, EventArgs e)
        {
            CAMADAS.BLL.Almoxarifado bllAlmo = new CAMADAS.BLL.Almoxarifado();

            string msg    = "Não há dados selecionado para remover";
            string titBox = "Erro";

            if (lblID.Text != "")
            {
                msg = "Deseja Remover o Item: " + txtItem.Text;
                DialogResult resposta = MessageBox.Show(msg, titBox, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                if (resposta == DialogResult.Yes)
                {
                    int id = Convert.ToInt32(lblID.Text);
                    bllAlmo.Delete(id);
                }
            }
            else
            {
                MessageBox.Show(msg, titBox, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            limpaControles();
            dgvItens.DataSource = bllAlmo.Select();
        }