Exemplo n.º 1
0
        private void btnActualizarRemitente_Click(object sender, EventArgs e)
        {
            Globals.ThisAddIn.Application.ScreenUpdating = false;
            if (dgvUsuarios.SelectedRows.Count > 0)
            {
                int iRemitente = Globals.ThisAddIn.listaFirmantes.Count - 1;
                Globals.ThisAddIn.listaFirmantes.RemoveAt(iRemitente);
                ServicesMemorando.actualizarRemitente(dgvUsuarios, iRemitente);

                if (iRemitente == 0)
                {
                    if (dgvUsuarios.CurrentRow.Cells["FondoIndependiente"].FormattedValue.ToString() == "1")
                    {
                        Globals.ThisAddIn.insertarValorPropiedad(Constantes.propiedadFondoIndependiente, "True");
                    }
                    else
                    {
                        Globals.ThisAddIn.insertarValorPropiedad(Constantes.propiedadFondoIndependiente, "False");
                    }
                }

                txtNombre.Text = "";
                txtCargo.Text  = "";
                txtDpto.Text   = "";
            }
            else
            {
                MessageBox.Show("Por favor seleccione una fila.");
            }
            Globals.ThisAddIn.Application.ScreenUpdating = true;
        }
Exemplo n.º 2
0
        private void btnInsActDe_Click(object sender, EventArgs e)
        {
            Globals.ThisAddIn.Application.ScreenUpdating = false;
            int firmantes;

            if (dgvUsuarios.SelectedRows.Count > 0)
            {
                if (primerRemitenteAgregado)
                {
                    primerMarcaAgregada = ServicesMemorando.manipularMarcaAgua(primerMarcaAgregada, rbtNormal);
                    Globals.ThisAddIn.insertarRemitente();

                    btnEliminarRemitente.Enabled = true;
                    Globals.ThisAddIn.insertarValorPropiedad(Constantes.propiedadSegundoRemitente, "True");
                }
                else
                {
                    primerRemitenteAgregado = true;
                }

                ServicesMemorando.actualizarRemitente(dgvUsuarios, Globals.ThisAddIn.listaFirmantes.Count);
                firmantes = Globals.ThisAddIn.listaFirmantes.Count - 1;

                if (firmantes == 0)
                {
                    if (dgvUsuarios.CurrentRow.Cells["FondoIndependiente"].FormattedValue.ToString() == "1")
                    {
                        Globals.ThisAddIn.insertarValorPropiedad(Constantes.propiedadFondoIndependiente, "True");
                    }
                    else
                    {
                        Globals.ThisAddIn.insertarValorPropiedad(Constantes.propiedadFondoIndependiente, "False");
                    }
                }

                if (Globals.ThisAddIn.iMaxRemitentes == Globals.ThisAddIn.listaFirmantes.Count)
                {
                    btnInsActDe.Enabled = false;
                }

                LimpiarFormulario();
                txtNombre.Text = "";
                txtCargo.Text  = "";
                txtDpto.Text   = "";
            }
            else
            {
                MessageBox.Show("Por favor seleccione una fila");
            }
            Globals.ThisAddIn.Application.ScreenUpdating = true;
        }