Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
        // 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();
            }
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e) // AGREGAR FAMILIAR
        {
            int index = dataGridView1.CurrentCell.RowIndex;

            if (index == -1)
            {
                MessageBox.Show("No se ha seleccionado un afiliado.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                long id = getId();
                Abm_Afiliado.ABM_afi form = new Abm_Afiliado.ABM_afi(2, id);
            }
        }
Exemplo n.º 4
0
 // 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();
 }