Exemplo n.º 1
0
        private int Applicable(Regle r)
        {
            int iNiveauMax = -1;

            foreach (IFait f in r.Hypot)
            {
                IFait fTrouve = _bdFaits.Chercher(f.Libelle());
                if (fTrouve == null)
                {
                    if (f.Question() != null)
                    {
                        fTrouve = CalculFait.Determiner(f, this);
                        _bdFaits.Ajouter(fTrouve);
                        iNiveauMax = Math.Max(iNiveauMax, 0);
                    }
                    else
                    {
                        return(-1);
                    }
                }
                if (!fTrouve.Valeur().Equals(f.Valeur()))
                {
                    return(-1);
                }
                else
                {
                    iNiveauMax = Math.Max(iNiveauMax, fTrouve.Niveau());
                }
            }
            return(iNiveauMax);
        }
Exemplo n.º 2
0
        public object Valeur(string Libelle_)
        {
            IFait f = Faits.FirstOrDefault(x => x.Libelle().Equals(Libelle_));

            if (f != null)
            {
                return(f.Valeur());
            }
            else
            {
                return(null);
            }
        }