/// <summary> /// Exclui o item corrente da lista /// </summary> /// <returns></returns> public override bool Excluir() { try { bool ok = formaPagamento.Excluir(); if (ok) { lista.RemoveAt(Indice); } return(ok); } catch (Exception ex) { throw ex; } }
private void BtnExcluir_Click(object sender, EventArgs e) { if (GridDados.CurrentRow != null) { if (MessageBox.Show("Confirma a Exclusão do Registro", "Confirmação", MessageBoxButtons.YesNo) == DialogResult.Yes) { FormaPgto.IdFormaPgto = int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString()); FormaPgto.Excluir(); PopularGrid(); LimpaDados(); GridDados.Focus(); } } else { MessageBox.Show("Não existe Registro para Excluir", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }