// AGREGAR FAMILIAR private void button1_Click_1(object sender, EventArgs e) { int index; try { index = dataGridView1.CurrentCell.RowIndex; } catch (Exception a) { index = -1; } if (index == -1) { MessageBox.Show("No se ha seleccionado un afiliado.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (int.Parse(dt.Rows[index][1].ToString()) != 0) { MessageBox.Show("Solo un afiliado titular puede agregar familiares.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if ('d' == Char.Parse(dt.Rows[index][15].ToString())) { MessageBox.Show("El afiliado esta dado de baja, no puede ingresar familiares.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Abm_Afiliado.ABM_afi form = new Abm_Afiliado.ABM_afi(2, getIDForFamiliar()); form.Show(); } }
// UPDATE AFILIADO private void button8_Click(object sender, EventArgs e) { int index; try { index = dataGridView1.CurrentCell.RowIndex; } catch (Exception a) { index = -1; } if (index == -1) { MessageBox.Show("No se ha seleccionado un afiliado.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if ('d' == Char.Parse(dt.Rows[index][15].ToString())) { MessageBox.Show("El afiliado esta dado de baja, no se puede modificar.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Abm_Afiliado.ABM_afi form = new Abm_Afiliado.ABM_afi(1, getId()); form.Show(); }
// CREAR NUEVO AFILIADO private void button7_Click(object sender, EventArgs e) { Abm_Afiliado.ABM_afi form = new Abm_Afiliado.ABM_afi(0, 0); form.Show(); }