Esempio n. 1
0
        private void brn_Inserir_Click(object sender, EventArgs e)
        {
            try
            {
                Chaves_Manter_TL oTela = new Chaves_Manter_TL();
                oTela.Funcionalidade = Codigo_Funcionalidade.Inserir;

                oTela.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Tela", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Esempio n. 2
0
        private void gv_Listar_Chave_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                if (e.RowHandle > -1)
                {
                    short  oCodigo = Convert.ToInt16(gv_Listar_Chave.GetRowCellValue(e.RowHandle, Codigo_Chave));
                    string oNome   = Convert.ToString(gv_Listar_Chave.GetRowCellValue(e.RowHandle, col_Nome_Chave));

                    if (e.Column.AbsoluteIndex == col_Alterar.AbsoluteIndex)
                    {
                        Chaves_Manter_TL oTela_Manter = new Chaves_Manter_TL();
                        oTela_Manter.Funcionalidade = Codigo_Funcionalidade.Alterar;
                        oTela_Manter.Text           = "Alterar Bandeira Cartão - " + oNome;
                        oTela_Manter.Codigo         = oCodigo;

                        oTela_Manter.MdiParent   = this.MdiParent;
                        oTela_Manter.Tela_Origem = this;
                        oTela_Manter.Show();
                    }
                    else if (e.Column.AbsoluteIndex == col_Visualizar.AbsoluteIndex)
                    {
                        Chaves_Manter_TL oTela_Manter = new Chaves_Manter_TL();
                        oTela_Manter.Funcionalidade = Codigo_Funcionalidade.Visualizar;
                        oTela_Manter.Text           = "Visualizar Bandeira Cartão - " + oNome;
                        oTela_Manter.Codigo         = oCodigo;
                        oTela_Manter.MdiParent      = this.MdiParent;
                        oTela_Manter.Tela_Origem    = this;
                        oTela_Manter.Show();
                    }
                    else if (e.Column.AbsoluteIndex == col_Excluir.AbsoluteIndex)
                    {
                        if (MessageBox.Show("Deseja excluir o operador cartão\"" + oNome + "\"?", "Excluir", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            SG_Cadastro_Chave_NG.Chave.Excluir(oCodigo);
                            btn_Pesquisar_Click(sender, e);
                            MessageBox.Show("A chave excluida com sucesso!", "Operador");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Operador");
            }
        }