Exemplo n.º 1
0
        private void btnActualizarPara_Click(object sender, EventArgs e)
        {
            Globals.ThisAddIn.Application.ScreenUpdating = false;

            /*
             * Vamaya: Se añade esta validación para verificar el estado del los PCR's destino
             */
            if (Globals.ThisAddIn.validarDestinosMemorando() == false)
            {
                Globals.ThisAddIn.Application.ScreenUpdating = true;
                MessageBox.Show("Error: Problemas de caché en el Add-In, la lista de destinatarios está corrupta. Abra el Add-In nuevamente.");
                this.Close();
                //Se sale de la función para evitar validaciones adicionales depués de este paso
                return;
            }

            /*
             * Fin lineas de código insertadas
             */

            if (dgvUsuarios.SelectedRows.Count > 0)
            {
                Globals.ThisAddIn.listaDestinosMe.RemoveAt(Globals.ThisAddIn.listaDestinosMe.Count - 1);
                ServicesMemorando.insertarRegistro(dgvUsuarios, rbtConfidencial, txtNombre, btInsertarPara);
            }
            else
            {
                MessageBox.Show("Por favor seleccione una fila.");
            }
            Globals.ThisAddIn.Application.ScreenUpdating = true;
        }