//--------------------------------------------------------------------------
        public static void SetFormule(int nIdSession, string strKey, C2iExpression formule)
        {
            AssureRecepteurNotifications(nIdSession);
            CDataBaseRegistrePourClient reg = new CDataBaseRegistrePourClient(nIdSession);

            if (formule == null)
            {
                reg.SetValeurBlob("GLOBFOR_" + strKey, null);
            }
            else
            {
                MemoryStream           stream = new MemoryStream();
                BinaryWriter           writer = new BinaryWriter(stream);
                CSerializerSaveBinaire ser    = new CSerializerSaveBinaire(writer);
                CResultAErreur         res    = ser.TraiteObject <C2iExpression>(ref formule);
                if (res)
                {
                    reg.SetValeurBlob("GLOBFOR_" + strKey, stream.GetBuffer());
                    CDonneeNotificationResetCacheDatabaseRegistre notif = new CDonneeNotificationResetCacheDatabaseRegistre(nIdSession);
                    CEnvoyeurNotification.EnvoieNotifications(new IDonneeNotification[] { notif });
                }
                writer.Close();
                stream.Close();
                stream.Dispose();
            }
        }
        //--------------------------------------------------------------------------
        public static C2iExpression GetFormule(int nIdSession, string strKey)
        {
            AssureRecepteurNotifications(nIdSession);
            C2iExpression formule = null;

            if (m_cacheFormule.TryGetValue(strKey, out formule))
            {
                return(formule);
            }
            CDataBaseRegistrePourClient reg = new CDataBaseRegistrePourClient(nIdSession);

            byte[] bts = reg.GetValeurBlob("GLOBFOR_" + strKey);
            if (bts != null)
            {
                MemoryStream           stream = new MemoryStream(bts);
                BinaryReader           reader = new BinaryReader(stream);
                CSerializerReadBinaire ser    = new CSerializerReadBinaire(reader);
                CResultAErreur         result = ser.TraiteObject <C2iExpression>(ref formule);
                if (result)
                {
                    m_cacheFormule[strKey] = formule;
                }
                reader.Close();
                stream.Close();
                stream.Dispose();
            }
            return(formule);
        }