Ejemplo n.º 1
0
        //---------------------------------------------------
        public override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer)
        {
            int            nVersion = GetNumVersion();
            CResultAErreur result   = serializer.TraiteVersion(ref nVersion);

            if (!result)
            {
                return(result);
            }
            result = base.MySerialize(serializer);
            if (!result)
            {
                return(result);
            }

            if (nVersion < 3)
            {
                // TESTDBKEYTODO
                serializer.ReadDbKeyFromOldId(ref m_dbKeyTypeProjet, typeof(CTypeProjet));
            }
            else
            {
                serializer.TraiteDbKey(ref m_dbKeyTypeProjet);
            }

            int nId = m_nIdChampProjet == null ? -1 : m_nIdChampProjet.Value;

            serializer.TraiteInt(ref nId);
            if (serializer.Mode == ModeSerialisation.Lecture)
            {
                m_nIdChampProjet = nId >= 0 ? (int?)nId : null;
            }

            result = serializer.TraiteListe <CAffectationsProprietes>(m_listeAffectations);
            if (!result)
            {
                return(result);
            }

            if (nVersion >= 1)
            {
                result = serializer.TraiteObject <C2iExpression>(ref m_formuleGanttId);
            }
            if (!result)
            {
                return(result);
            }
            if (nVersion >= 2)
            {
                serializer.TraiteBool(ref m_bGererIterations);
            }

            return(result);
        }
Ejemplo n.º 2
0
        //---------------------------------------------------
        public override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer)
        {
            int            nVersion = GetNumVersion();
            CResultAErreur result   = serializer.TraiteVersion(ref nVersion);

            if (!result)
            {
                return(result);
            }

            if (nVersion < 2)
            {
                // TESTDBKEYOK
                serializer.ReadDbKeyFromOldId(ref m_dbKeyTypeWorkflow, typeof(CTypeWorkflow));
                // TESTDBKEYOK
                serializer.ReadDbKeyFromOldId(ref m_dbKeyTypeEtapeDemarrage, typeof(CTypeEtapeWorkflow));
            }
            else
            {
                serializer.TraiteDbKey(ref m_dbKeyTypeWorkflow);
                serializer.TraiteDbKey(ref m_dbKeyTypeEtapeDemarrage);
            }

            if (nVersion >= 1)
            {
                result = serializer.TraiteObject <C2iExpression>(ref m_formuleInitialisationWorkflow);
                if (!result)
                {
                    return(result);
                }
            }
            else if (serializer.Mode == ModeSerialisation.Lecture)
            {
                m_formuleInitialisationWorkflow = null;
            }

            return(result);
        }
        //---------------------------------------------------
        public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer)
        {
            int            nVersion = GetNumVersion();
            CResultAErreur result   = serializer.TraiteVersion(ref nVersion);

            if (!result)
            {
                return(result);
            }
            //TESTDBKEYTODO : remplace m_nIDChampCustom par
            if (nVersion < 1)
            {
                serializer.ReadDbKeyFromOldId(ref m_dbKeyChampCustom, typeof(CChampCustom));
            }
            else
            {
                serializer.TraiteDbKey(ref m_dbKeyChampCustom);
            }
            serializer.TraiteString(ref m_strNomColonne);
            serializer.TraiteType(ref m_typeDonnee);
            return(result);
        }
Ejemplo n.º 4
0
        //---------------------------------------------------
        public override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer)
        {
            int            nVersion = GetNumVersion();
            CResultAErreur result   = serializer.TraiteVersion(ref nVersion);

            if (!result)
            {
                return(result);
            }

            if (nVersion < 3)
            {
                // TESTDBKEYOK
                serializer.ReadDbKeyFromOldId(ref m_dbKeyProcess, typeof(CProcessInDb));
            }
            else
            {
                serializer.TraiteDbKey(ref m_dbKeyProcess);
            }

            serializer.TraiteBool(ref m_bDemarrageManuel);
            serializer.TraiteString(ref m_strInstructions);
            if (nVersion >= 1)
            {
                result = serializer.TraiteObject <CProcess>(ref m_process);
                if (!result)
                {
                    return(result);
                }
            }
            if (nVersion >= 2)
            {
                serializer.TraiteBool(ref m_bUtiliserSortieDeProcessCommeCodeRetour);
            }


            return(result);
        }
Ejemplo n.º 5
0
        //-----------------------------------------------------------------------
        public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer)
        {
            CResultAErreur result   = CResultAErreur.True;
            int            nVersion = GetNumVersion();

            result = serializer.TraiteVersion(ref nVersion);
            if (!result)
            {
                return(result);
            }

            // Traite la liste des Ids de Types d'Alarmes
            int nNbTypeAlarme = m_listeIdTypesAlarmes.Count;

            serializer.TraiteInt(ref nNbTypeAlarme);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                foreach (CDbKey dbKey in m_listeIdTypesAlarmes)
                {
                    CDbKey dbKeyTmp = dbKey;
                    serializer.TraiteDbKey(ref dbKeyTmp);
                }
                break;

            case ModeSerialisation.Lecture:
                m_listeIdTypesAlarmes.Clear();
                for (int nVal = 0; nVal < nNbTypeAlarme; nVal++)
                {
                    CDbKey dbKeyTmp = null;
                    serializer.TraiteDbKey(ref dbKeyTmp);
                    m_listeIdTypesAlarmes.Add(dbKeyTmp);
                }
                break;
            }

            // Traite la liste des Ids de Site
            int nNbSites = m_listeIdSites.Count;

            serializer.TraiteInt(ref nNbSites);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                foreach (CDbKey dbKey in m_listeIdSites)
                {
                    CDbKey dbKeyTmp = dbKey;
                    serializer.TraiteDbKey(ref dbKeyTmp);
                }
                break;

            case ModeSerialisation.Lecture:
                m_listeIdSites.Clear();
                for (int nVal = 0; nVal < nNbSites; nVal++)
                {
                    CDbKey dbKeyTmp = null;
                    if (nVersion < 1)
                    {
                        serializer.ReadDbKeyFromOldId(ref dbKeyTmp, null);
                    }
                    else
                    {
                        serializer.TraiteDbKey(ref dbKeyTmp);
                    }
                    m_listeIdSites.Add(dbKeyTmp);
                }
                break;
            }

            // Traite la liste des Ids d'Equipements Logiques
            int nNbEqpt = m_listeIdEquipementsLogiques.Count;

            serializer.TraiteInt(ref nNbEqpt);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                foreach (CDbKey dbKey in m_listeIdEquipementsLogiques)
                {
                    CDbKey dbKeyTemp = dbKey;
                    serializer.TraiteDbKey(ref dbKeyTemp);
                }
                break;

            case ModeSerialisation.Lecture:
                m_listeIdEquipementsLogiques.Clear();
                for (int nVal = 0; nVal < nNbEqpt; nVal++)
                {
                    CDbKey dbKeyTmp = null;
                    if (nVersion < 1)
                    {
                        serializer.ReadDbKeyFromOldId(ref dbKeyTmp, null);
                    }
                    else
                    {
                        serializer.TraiteDbKey(ref dbKeyTmp);
                    }
                    m_listeIdEquipementsLogiques.Add(dbKeyTmp);
                }
                break;
            }

            // Traite la liste des Ids de Liens Résaux
            int nNbLiens = m_listeIdLiensReseau.Count;

            serializer.TraiteInt(ref nNbLiens);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                foreach (CDbKey dbKey in m_listeIdLiensReseau)
                {
                    CDbKey dbKeyTmp = dbKey;
                    serializer.TraiteDbKey(ref dbKeyTmp);
                }
                break;

            case ModeSerialisation.Lecture:
                m_listeIdLiensReseau.Clear();
                for (int nVal = 0; nVal < nNbLiens; nVal++)
                {
                    CDbKey dbKeyTmp = null;
                    if (nVersion < 1)
                    {
                        serializer.ReadDbKeyFromOldId(ref dbKeyTmp, null);
                    }
                    else
                    {
                        serializer.TraiteDbKey(ref dbKeyTmp);
                    }
                    m_listeIdLiensReseau.Add(dbKeyTmp);
                }
                break;
            }

            // Traite la liste des Ids d'Entité SNMP
            int nNbEntites = m_listeIdEntitesSnmp.Count;

            serializer.TraiteInt(ref nNbEntites);
            switch (serializer.Mode)
            {
            case ModeSerialisation.Ecriture:
                foreach (CDbKey dbKey in m_listeIdEntitesSnmp)
                {
                    CDbKey dbKeyTmp = dbKey;
                    serializer.TraiteDbKey(ref dbKeyTmp);
                }
                break;

            case ModeSerialisation.Lecture:
                m_listeIdEntitesSnmp.Clear();
                for (int nVal = 0; nVal < nNbEntites; nVal++)
                {
                    CDbKey dbKeyTmp = null;
                    if (nVersion < 1)
                    {
                        serializer.ReadDbKeyFromOldId(ref dbKeyTmp, null);
                    }
                    else
                    {
                        serializer.TraiteDbKey(ref dbKeyTmp);
                    }
                    m_listeIdEntitesSnmp.Add(dbKeyTmp);
                }
                break;
            }


            return(result);
        }