private void btnEditar_Click(object sender, EventArgs e) { if (dgv.RowCount > 0) { int oid = new int(); if (dgv.RowCount > 1) { oid = int.Parse(dgv.Rows[dgv.SelectedRows[0].Index].Cells[0].Value.ToString()); } else { oid = int.Parse(dgv.Rows[0].Cells[0].Value.ToString()); } FrmComensalAdd oFrmAdd = new FrmComensalAdd(this, oid, "U"); oFrmAdd.ShowDialog(); } else { MessageBox.Show("Debe Seleccionar un Comensal"); } }
private void btnNuevo_Click(object sender, EventArgs e) { int oid = new int(); FrmComensalAdd oFrm = new FrmComensalAdd(this, oid, "C"); oFrm.ShowDialog(); }