//--------------------------------------------- public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } serializer.TraiteString(ref m_strLibelle); result = serializer.TraiteObject <CEasyQuery>(ref m_query); if (result) { result = serializer.TraiteObject <CListeQuerySource>(ref m_listeSources); } if (!result) { return(result); } serializer.TraiteString(ref m_strNomTableSource); serializer.TraiteString(ref m_strChampCleElement); serializer.TraiteString(ref m_strChampLatitude); serializer.TraiteString(ref m_strChampLongitude); serializer.TraiteString(ref m_strChampLibelle); serializer.TraiteDouble(ref m_fMetresEntrePoints); return(result); }
//--------------------------------------------------- public override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } result = serializer.TraiteObject <CParametreDeclencheurEvenement>(ref m_parametreDeclencheur); if (result) { result = serializer.TraiteObject <C2iExpression>(ref m_formuleElementDeclencheur); } return(result); }
//------------------------------------------------ public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } result = serializer.TraiteObject <CEasyQuery>(ref m_query); if (result) { result = serializer.TraiteObject <CListeQuerySource>(ref m_listeSources); } if (!result) { return(result); } int nNbTables = m_listeTablesARetourner.Count; serializer.TraiteInt(ref nNbTables); switch (serializer.Mode) { case ModeSerialisation.Ecriture: foreach (string strTable in m_listeTablesARetourner) { string strTmp = strTable; serializer.TraiteString(ref strTmp); } break; case ModeSerialisation.Lecture: m_listeTablesARetourner.Clear(); for (int n = 0; n < nNbTables; n++) { string strTmp = ""; serializer.TraiteString(ref strTmp); m_listeTablesARetourner.Add(strTmp); } break; } return(result); }
//--------------------------------------------------- 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); }
//------------------------------------------------------ protected override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } result = serializer.TraiteObject <CChartSetup>(ref m_parametreChart); if (!result) { return(result); } return(result); }
//------------------------------------------- public override sc2i.common.CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } result = base.Serialize(serializer); if (!result) { return(result); } result = serializer.TraiteObject <CFiltreDynamique>(ref m_filtreDynamique); return(result); }
//------------------------------------------------------------------- public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } serializer.TraiteString(ref m_strIdSource); serializer.TraiteString(ref m_strTableName); serializer.TraiteString(ref m_strColumnName); if (nVersion >= 1) { serializer.TraiteObject <C2iExpression>(ref m_formule); } return(result); }
//------------------------------------------------------------------- public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } serializer.TraiteString(ref m_strIdSource); result = serializer.TraiteObject <C2iExpression>(ref m_formule); if (!result) { return(result); } serializer.TraiteBool(ref m_bEvaluateOnEachSourceElement); return(result); }
public override sc2i.common.CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } result = base.Serialize(serializer); if (!result) { return(result); } result = serializer.TraiteObject <C2iExpression>(ref m_formuleObjets); if (!result) { return(result); } return(result); }
//--------------------------------------------------------------- public CResultAErreur Serialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } serializer.TraiteDoubleNullable(ref m_fCoutSaisi); serializer.TraiteIntNullable(ref m_nIdTypeProjet); serializer.TraiteDouble(ref m_fDureeJours); if (nVersion >= 1) { serializer.TraiteString(ref m_strCleProjetTemplate); } if (nVersion >= 2) { serializer.TraiteObject <C2iExpression>(ref m_formuleInitialisation); } return(result); }
//--------------------------------------------------- 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 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); }
/// //////////////////////////////////////////////////////// protected override CResultAErreur MySerialize(sc2i.common.C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } if (serializer.Mode == ModeSerialisation.Lecture && serializer.GetObjetAttache(typeof(CContexteDonnee)) != null) { ContexteDonnee = (CContexteDonnee)serializer.GetObjetAttache(typeof(CContexteDonnee)); } else { ContexteDonnee = CContexteDonneeSysteme.GetInstance(); } serializer.TraiteInt(ref m_nIdNextObjet); if (nVersion > 0) { bool bHasType = TypeCible != null; serializer.TraiteBool(ref bHasType); if (bHasType) { serializer.TraiteType(ref m_typeCible); } else { m_typeCible = null; } } else { m_typeCible = null; } //Lit les variables en premier car on en a besoin dans les actions serializer.AttacheObjet(typeof(IElementAVariablesDynamiquesBase), this); if (result) { result = serializer.TraiteArrayListOf2iSerializable(m_listeVariables, this); } foreach (IVariableDynamique variable in m_listeVariables) { if (variable.IdVariable == c_strIdVariableElement) //TESTDBKEYOK { m_variableCible = (CVariableProcessTypeComplexe)variable; } } if (serializer.Mode == ModeSerialisation.Lecture) { foreach (IVariableDynamique var in m_listeVariables) { if (var.IdVariable == c_strIdVariableElement && var is CVariableProcessTypeComplexe) { m_variableCible = (CVariableProcessTypeComplexe)var; m_typeCible = m_variableCible.TypeDonnee.TypeDotNetNatif; m_bSurTableauDeCible = m_variableCible.TypeDonnee.IsArrayOfTypeNatif; } } } result = serializer.TraiteArrayListOf2iSerializable(m_listeActions, this); if (result) { result = serializer.TraiteArrayListOf2iSerializable(m_listeLiensActions, this); } serializer.DetacheObjet(typeof(IElementAVariablesDynamiquesBase), this); //Lit les valeurs des variables if (nVersion > 2) { result = SerializeValeursVariables(nVersion, serializer); } if (nVersion >= 3) { serializer.TraiteBool(ref m_bModeAsynchrone); } else { m_bModeAsynchrone = false; } if (nVersion >= 4) { serializer.TraiteString(ref m_strLibelle); } AssureVariableCible(); if (nVersion >= 5) { I2iSerializable objet = m_infoDeclencheur; serializer.TraiteObject(ref objet); m_infoDeclencheur = (CInfoDeclencheurProcess)objet; } if (nVersion >= 7) { serializer.TraiteBool(ref m_bSurTableauDeCible); } else { m_bSurTableauDeCible = false; } if (nVersion >= 9) { serializer.TraiteString(ref m_strLastErreur); } else { m_strLastErreur = ""; } if (nVersion >= 10) { if (nVersion < 14 && serializer.Mode == ModeSerialisation.Lecture) { int nIdTemp = -1; serializer.TraiteInt(ref nIdTemp); m_strIdVariableRetour = nIdTemp.ToString(); } else { serializer.TraiteString(ref m_strIdVariableRetour); } } Dictionary <int, I2iObjetGraphique> dicIdToObjet = null; if (nVersion >= 12) { int nbEle = m_ordreZ.Count; serializer.TraiteInt(ref nbEle); if (serializer.Mode == ModeSerialisation.Lecture) { dicIdToObjet = new Dictionary <int, I2iObjetGraphique>(); foreach (CAction action in ListeActions) { dicIdToObjet[action.IdObjetProcess] = action; } foreach (CLienAction lien in ListeLiens) { dicIdToObjet[lien.IdObjetProcess] = lien; } m_ordreZ.Clear(); for (int n = 0; n < nbEle; n++) { int nId = 0; serializer.TraiteInt(ref nId); I2iObjetGraphique objTmp = null; if (dicIdToObjet.TryGetValue(nId, out objTmp)) { m_ordreZ.Add((IObjetDeProcess)objTmp); } } } else if (serializer.Mode == ModeSerialisation.Ecriture) { foreach (IObjetDeProcess objet in m_ordreZ) { int nCopy = objet.IdObjetProcess; serializer.TraiteInt(ref nCopy); } } } else { m_ordreZ = new List <IObjetDeProcess>(); foreach (CAction action in ListeActions) { m_ordreZ.Add(action); } foreach (CLienAction lien in ListeLiens) { m_ordreZ.Add(lien); } } if (nVersion >= 13) { serializer.TraiteBool(ref m_bModeTransactionnel); } else { m_bModeTransactionnel = false; } return(result); }
/// ///////////////////////////////////////////////////////// public CResultAErreur Serialize(C2iSerializer serializer) { int nVersion = GetNumVersion(); CResultAErreur result = serializer.TraiteVersion(ref nVersion); if (!result) { return(result); } int nNb = m_tableRestrictions.Count; serializer.TraiteInt(ref nNb); switch (serializer.Mode) { case ModeSerialisation.Ecriture: foreach (Type tp in m_tableRestrictions.Keys) { Type tpTemp = tp; I2iSerializable restriction = (I2iSerializable)m_tableRestrictions[tp]; serializer.TraiteType(ref tpTemp); result = serializer.TraiteObject(ref restriction); if (!result) { return(result); } } break; case ModeSerialisation.Lecture: m_tableRestrictions.Clear(); for (int nType = 0; nType < nNb; nType++) { Type tp = null; I2iSerializable rest = null; serializer.TraiteType(ref tp); result = serializer.TraiteObject(ref rest, tp); if (!result) { return(result); } if (tp != null) { m_tableRestrictions[tp] = rest; } } break; } if (nVersion >= 1) { serializer.TraiteBool(ref m_bIsAdministrateur); } if (nVersion >= 2) { bool bHasAnnulation = SeuilAnnulationPriorites != null; serializer.TraiteBool(ref bHasAnnulation); if (bHasAnnulation) { int nTmp = SeuilAnnulationPriorites == null ? 0 : (int)m_nSeuilAnnulationPriorites; serializer.TraiteInt(ref nTmp); SeuilAnnulationPriorites = nTmp; } } return(result); }