コード例 #1
0
ファイル: fCadTabelas.cs プロジェクト: ricardo-xavier/soft
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            string parceiro = edtParceiro.Text.Trim();
            string codigo   = edtCodigo.Text.Trim();

            result = tabelas.Exclui(parceiro, codigo, ref msg);
            if (!result)
            {
                MessageBox.Show(parceiro + "-" + codigo + "\r\n" + Globais.ErroExclusao("Tabela encontrada", msg), "Erro na exclusão da tabela", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            tabelas.Carrega(dgvCadastro, chkAtivos.Checked);
            Grid.Sort(dgvCadastro, col_sorted, ord_sorted);
            this.Cursor = Cursors.Default;
            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
        }
コード例 #2
0
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            string codigo = edtCodigo.Text.Trim();

            result = termos.Exclui(codigo, ref msg);
            if (!result)
            {
                MessageBox.Show(codigo + "\r\n" + Globais.ErroExclusao("Termo encontrado", msg), "Erro na exclusão do termo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            termos.Carrega(dgvCadastro);
            this.Cursor = Cursors.Default;
            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
        }
コード例 #3
0
ファイル: fCadProdutos.cs プロジェクト: ricardo-xavier/soft
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            string parceiro  = edtParceiro.Text.Trim();
            string codigo    = edtCodigo.Text.Trim();
            string subcodigo = edtSubCodigo.Text.Trim();

            result = produtos.Exclui(parceiro, codigo, subcodigo, ref msg);
            if (!result)
            {
                MessageBox.Show(codigo + "-" + subcodigo + "\r\n" + Globais.ErroExclusao("Produto encontrado", msg), "Erro na exclusão do produto", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            int selecionado = dgvCadastro.CurrentRow.Index;

            table.Rows.RemoveAt(selecionado);
            //produtos.Carrega(dgvCadastro, ref table, "");
            int n = dgvCadastro.Rows.Count;

            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
            else
            {
                if (selecionado == n)
                {
                    selecionado--;
                }
                dgvCadastro.Rows[selecionado].Cells[0].Selected = true;
                AtualizaDados(selecionado);
                AtualizaDadosLocal(selecionado);
            }
        }
コード例 #4
0
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            result = comissao.Exclui(fornecedor, caracteristica, Globais.StrToShort(edtCodigo.Text), ref msg);
            if (!result)
            {
                MessageBox.Show(edtCodigo.Text + "\r\n" + Globais.ErroExclusao("Comissão encontrada", msg), "Erro na exclusão da comissão", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            comissao.Carrega(fornecedor, caracteristica, dgvCadastro);
            this.Cursor = Cursors.Default;
            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
        }
コード例 #5
0
ファイル: fCadOrigens.cs プロジェクト: ricardo-xavier/soft
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

            if (acao == 'c')
            {
                return;
            }
            result = origens.Exclui(edtCodigo.Text, ref msg);
            if (!result)
            {
                MessageBox.Show(edtCodigo.Text + "\r\n" + Globais.ErroExclusao("Origem encontrada", msg), "Erro na exclusão da origem", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            origens.Carrega(dgvCadastro, ativas);
            this.Cursor = Cursors.Default;
            if (dgvCadastro.Rows.Count == 0)
            {
                InicializaCampos();
            }
        }
コード例 #6
0
        void BtnExcluiClick(object sender, EventArgs e)
        {
            string msg = "";
            bool   result;

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