Example #1
0
        void AlSolicitarExcepcionesSincro(CmdSincronizar c)
        {
            //Diálogo modal para confirmar actualización de excepciones
            frmExcepciones w = new frmExcepciones(c);

            w.StartPosition = FormStartPosition.CenterParent;
            w.ShowDialog(this);
        }
Example #2
0
        bool AlSolicitarSincro(CmdSincronizar c)
        {
            //Diálogo modal para confirmar sincronización
            frmAfectados w = new frmAfectados(c.ObtenerDatos(), string.Format("Registros que serán afectados al {0}", c.Descripcion));

            w.StartPosition = FormStartPosition.CenterParent;
            w.ShowDialog(this);
            return(w.DialogResult == DialogResult.OK);
        }
Example #3
0
        public frmExcepciones(CmdSincronizar cmd)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.Text = string.Format("Descartes a la hora de {0}", cmd.Descripcion);
            helper    = new CfgExcepciones(cmd);
            this.bsDatos.DataSource           = helper.Data;
            this.dgvDatos.AutoGenerateColumns = true;
            this.dgvDatos.DataSource          = this.bsDatos;
            this.tsslMsg.Text          = string.Format("Nº de registros recuperados: {0}", helper.Data.Rows.Count.ToString());
            this.dgvDatos.ColumnAdded += new DataGridViewColumnEventHandler(this.OnColumnAdded);
        }
Example #4
0
        public controlCmdSincronizar(TreeNode n)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            ToolTip tt = new ToolTip();

            tt.AutoPopDelay = 5000;
            tt.InitialDelay = 1000;
            tt.ReshowDelay  = 500;
            tt.ShowAlways   = true;
            tt.SetToolTip(this.txDesc, "Presiona 'Esc' para recuperar la descripción inicial");
            tt.SetToolTip(this.txTblCPD, "Presiona 'F12' para recuperar la lista de tablas  del CPD. Presiona 'Esc' para recuperar la tabla  CPD inicial");
            tt.SetToolTip(this.txTblSIGUA, "Presiona 'F12' para recuperar la lista de tablas  de SIGUANET. Presiona 'Esc' para recuperar la tabla SIGUANET inicial");

            _nodo = n;
            _cmd  = (CmdSincronizar)n.Tag;

            this.txDesc.Text         = descInicial = _cmd.Descripcion;
            this.txTblCPD.Text       = tblCPDInicial = _cmd.TablaCPD;
            this.txTblSIGUA.Text     = tblSIGUAInicial = _cmd.TablaSIGUA;
            this.grdJoins.DataSource = _cmd.ComplexData.Tables["Joins"];
            _cmd.ComplexData.Tables["Joins"].RowChanged        += new DataRowChangeEventHandler(JoinsDataChanged);
            _cmd.ComplexData.Tables["Joins"].RowDeleted        += new DataRowChangeEventHandler(JoinsDataChanged);
            this.grdSimulaciones.DataSource                     = _cmd.ComplexData.Tables["Simulaciones"];
            _cmd.ComplexData.Tables["Simulaciones"].RowChanged += new DataRowChangeEventHandler(SimulacionesDataChanged);
            _cmd.ComplexData.Tables["Simulaciones"].RowDeleted += new DataRowChangeEventHandler(SimulacionesDataChanged);
            this.rbActivarExc.Checked    = _cmd.AplicarExcepciones;
            this.rbDesactivarExc.Checked = !_cmd.AplicarExcepciones;

            switch (_cmd.Direccion)
            {
            case (TipoComprobacion.AltasPendientesEnSIGUA):
                this.txDireccion.Text = "Insertar registros del CPD que no existen en SIGUANET";
                this.grdCorrespondencias.DataSource = _cmd.ComplexData.Tables["Correspondencias"];
                _cmd.ComplexData.Tables["Correspondencias"].RowChanged += new DataRowChangeEventHandler(CorrespondenciasDataChanged);
                _cmd.ComplexData.Tables["Correspondencias"].RowDeleted += new DataRowChangeEventHandler(CorrespondenciasDataChanged);
                this.grdDefaults.DataSource = _cmd.ComplexData.Tables["Defaults"];
                _cmd.ComplexData.Tables["Defaults"].RowChanged += new DataRowChangeEventHandler(DefaultsDataChanged);
                _cmd.ComplexData.Tables["Defaults"].RowDeleted += new DataRowChangeEventHandler(DefaultsDataChanged);
                break;

            case (TipoComprobacion.BajasPendientesEnSIGUA):
                this.txDireccion.Text = "Borrar registros de SIGUANET que no existen en CPD";
                this.tabControl1.TabPages.Remove(this.tpCorrespondencias);
                this.tabControl1.TabPages.Remove(this.tpDefaults);
                break;

            case (TipoComprobacion.ModificacionesPendientesEnSIGUA):
                this.txDireccion.Text = "Actualizar registros de SIGUANET según sus correspondientes en CPD";
                this.grdCorrespondencias.DataSource = _cmd.ComplexData.Tables["Correspondencias"];
                _cmd.ComplexData.Tables["Correspondencias"].RowChanged += new DataRowChangeEventHandler(CorrespondenciasDataChanged);
                _cmd.ComplexData.Tables["Correspondencias"].RowDeleted += new DataRowChangeEventHandler(CorrespondenciasDataChanged);
                this.tabControl1.TabPages.Remove(this.tpDefaults);
                _cmd.AplicarExcepciones       = false;
                this.rbActivarExc.Enabled     = false;
                this.rbDesactivarExc.Enabled  = false;
                this.lnkConfigurarExc.Enabled = false;
                break;
            }
        }
Example #5
0
 public static DataSet GetRelationDataSet(CmdSincronizar cmd)
 {
     return(BuildRelationDataSet(cmd.TablaCPD, cmd.TablaSIGUA, cmd.ComplexData.Tables["Joins"], cmd.ComplexData.Tables["Correspondencias"], cmd.Direccion));
 }
Example #6
0
        private bool Exec(CmdSincronizar c, SyncroStep step)
        {
            bool      r = false;
            DataTable dt;
            string    msg = string.Empty;

            switch (step)
            {
            case SyncroStep.ExceptionsCfg:
                this.ComandoComienza(c, " >>> FASE DE CONFIGURACIÓN DE EXCEPCIONES", step);
                if (c.Direccion != TipoComprobacion.ModificacionesPendientesEnSIGUA)
                {
                    this.ComandoSolicitaExcepcionesSincro(c);
                }
                break;

            case SyncroStep.Simulation:
                this.ComandoComienza(c, " >>> FASE DE SIMULACIÓN", step);
                dt = c.Simular();
                if (dt.TableName == "Excepcion")
                {
                    this.ComandoInforma((string)dt.Rows[0]["Mensaje"]);
                    r = true;
                }
                else
                {
                    if (dt.Rows.Count > 0)
                    {
                        this.ComandoObtieneDatosCriticos(dt);
                        this.ComandoInforma("¡ATENCIÓN: SE DETECTARON INCIDENCIAS DURANTE LA FASE DE SIMULACIÓN!");
                        r = true;
                    }
                    else
                    {
                        this.ComandoInforma("NO SE DETECTARON INCIDENCIAS DURANTE LA FASE DE SIMULACIÓN");
                    }
                }
                break;

            case SyncroStep.Transaction:
                this.ComandoComienza(c, " >>> FASE DE TRANSACCIÓN", step);
                dt = c.ObtenerDatos();
                if (dt.TableName == "Excepcion")
                {
                    this.ComandoInforma((string)dt.Rows[0]["Mensaje"]);
                    r = true;
                }
                else
                {
                    if (this.ComandoSolicitaSincro(c))
                    {
                        DataTable dt1 = c.Sincronizar();
                        msg = (string)dt1.Rows[0]["Mensaje"];
                        this.ComandoInforma(msg);
                        r = true;
                    }
                    else
                    {
                        this.ComandoInforma("TRANSACCIÓN CANCELADA");
                        r = true;
                    }
                }
                break;
            }
            return(r);
        }
Example #7
0
        public void Ejecutar()
        {
            bool suspend = false;

            if (_state == SeqState.SeqDone)
            {
                _state = SeqState.SeqInProgress;
                this.SecuenciaComienza();
            }
            for (int i = SeqStep + 1; i < SeqList.Count; i++)
            {
                if (SeqList[i].GetType() == typeof(Operacion))
                {
                    ActiveOperation = (Operacion)SeqList[i];
                    suspend         = this.Exec((Operacion)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(PreSincro))
                {
                    ActiveTask = (PreSincro)SeqList[i];
                    suspend    = this.Exec((PreSincro)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(Sincro))
                {
                    ActiveTask = (Sincro)SeqList[i];
                    suspend    = this.Exec((Sincro)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(PostSincro))
                {
                    ActiveTask = (PostSincro)SeqList[i];
                    suspend    = this.Exec((PostSincro)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(Complemento))
                {
                    ActiveTask = (Complemento)SeqList[i];
                    suspend    = this.Exec((Complemento)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(CmdSeleccionar))
                {
                    suspend = this.Exec((CmdSeleccionar)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(CmdComparar))
                {
                    suspend = this.Exec((CmdComparar)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(CmdAvisar))
                {
                    suspend = this.Exec((CmdAvisar)SeqList[i]);
                }
                if (SeqList[i].GetType() == typeof(CmdSincronizar))
                {
                    CmdSincronizar c = (CmdSincronizar)SeqList[i];
                    //Fase de configuración de excepciones
                    suspend = this.Exec(c, SyncroStep.ExceptionsCfg);
                    //Fase de simulación
                    suspend = this.Exec(c, SyncroStep.Simulation);
                    //Fase de sincronización
                    if (!suspend)
                    {
                        suspend = this.Exec(c, SyncroStep.Transaction);
                    }
                }
                if (SeqList[i].GetType() == typeof(CmdEditar))
                {
                    suspend = this.Exec((CmdEditar)SeqList[i]);
                }
                SeqStep = i;
                if (suspend)
                {
                    break;
                }
            }
            if (SeqStep == SeqList.Count - 1)
            {
                _state  = SeqState.SeqDone;
                SeqStep = -1;
                this.SecuenciaTermina();
            }
        }