Ejemplo n.º 1
0
        private void btnSeleccionarGestacion_Click(object sender, EventArgs e)
        {
            //si dgv no está vacío
            gestacion = gestaciones[dgvGestaciones.CurrentRow.Index];

            //la idea es que se modifique
            frmGestionarGestacion formGestionarGestacion = new frmGestionarGestacion(gestacion);

            if (formGestionarGestacion.ShowDialog() == DialogResult.OK)
            {
            }
        }
        private void btnAgregarGestacion_Click(object sender, EventArgs e)
        {
            frmGestionarGestacion formGestionarGestacion = new frmGestionarGestacion((int)udNumEmbarazos.Value);

            if (formGestionarGestacion.ShowDialog() == DialogResult.OK)
            {
                gestacion = formGestionarGestacion.Gestacion;
                gestaciones.Add(gestacion);

                Object[] filaGestacion = new Object[2];
                filaGestacion[0] = gestacion.clinica;
                filaGestacion[1] = gestacion.fecha_probable_parto.ToShortDateString();
                dgvGestaciones.Rows.Add(filaGestacion);
            }
        }
 private void btnSeleccionarGestacion_Click(object sender, EventArgs e)
 {
     if (gestaciones != null && dgvGestaciones.RowCount != 0)
     {
         gestacion = gestaciones[dgvGestaciones.CurrentRow.Index];
         frmGestionarGestacion formGestionarGestacion = new frmGestionarGestacion(gestacion, (int)udNumEmbarazos.Value);
         if (formGestionarGestacion.ShowDialog() == DialogResult.OK)
         {
             gestacion = formGestionarGestacion.Gestacion;
             gestaciones[dgvGestaciones.CurrentRow.Index] = gestacion;
             //actualizar la fila
             dgvGestaciones.Rows[dgvGestaciones.CurrentRow.Index].Cells[0].Value = gestacion.clinica;
             dgvGestaciones.Rows[dgvGestaciones.CurrentRow.Index].Cells[1].Value = gestacion.fecha_probable_parto.ToShortDateString();
         }
     }
 }