Example #1
0
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            result = cargos.Exclui(edtCodigo.Text, ref msg);
            if (!result)
            {
                MessageBox.Show(edtCodigo.Text + "\r\n" + Globais.ErroExclusao("Cargo encontrado", msg), "Erro na exclusão do cargo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            cargos.Carrega(dgvCadastro);
            this.Cursor = Cursors.Default;
            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
        }