public frmUpdateCBO(Form frm, Enumeradores.TipoOperacao tpo, BindingSource bnd) { InitializeComponent(); try { frmGrid = frm; tpOperacao = tpo; bndCBOGrid = bnd; MdiParent = frmGrid.MdiParent; if (tpOperacao.Equals(Enumeradores.TipoOperacao.Insert)) { CBODTOBindingSource.AddNew(); } else { cboDTO = (CBODTO)bndCBOGrid.Current; CBODTOBindingSource.DataSource = cboGL.GetCBO(cboDTO.Id); } cboDTO = (CBODTO)CBODTOBindingSource.Current; } catch { throw; } }
private void Excluir() { if (MessageBox.Show("Deseja realmente excluir ?", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { cboDTO = (CBODTO)CBODTOBindingSource.Current; try { cboGL.Delete(cboDTO.Id); CBODTOBindingSource.RemoveCurrent(); } catch { throw; } } }