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.Comarca)Grid.CurrentRow.DataBoundItem; var frm = new FormCadastroComarca(obj); frm.ShowDialog(); frm.Dispose(); AtualizarGrid(); } Enabled(true); }
public override void btInserir_Click(object sender, EventArgs e) { base.btInserir_Click(sender, e); Enabled(false); var frm = new FormCadastroComarca(null); frm.ShowDialog(); if (frm.gravou) { bindingSource.Add(frm.comarca); } frm.Dispose(); AtualizarGrid(); Enabled(true); }