Пример #1
0
        public override void btAlterar_Click(object sender, EventArgs e)
        {
            base.btAlterar_Click(sender, e);

            Enabled(false);
            if (Grid.CurrentRow != null)
            {
                var obj = (Database_Class.Classes.Advogado)Grid.CurrentRow.DataBoundItem;

                var frm = new FormCadastroAdvogado(obj);
                frm.ShowDialog();
                frm.Dispose();

                AtualizarGrid();
            }

            Enabled(true);
        }
Пример #2
0
        public override void btInserir_Click(object sender, EventArgs e)
        {
            base.btInserir_Click(sender, e);

            Enabled(false);

            var frm = new FormCadastroAdvogado(null);

            frm.ShowDialog();

            if (frm.gravou)
            {
                bindingSource.Add(frm.advogado);
            }

            frm.Dispose();

            AtualizarGrid();

            Enabled(true);
        }