Пример #1
0
        //------------------------------------------------------------
        public CResultAErreur GetValue(object objet, string strPropriete)
        {
            CResultAErreur result      = CResultAErreur.True;
            CObjetDonnee   objetDonnee = objet as CObjetDonnee;

            if (objetDonnee == null)
            {
                result.Data = null;
                return(result);
            }
            int nIdSmartField = -1;

            try
            {
                nIdSmartField = Int32.Parse(strPropriete);
            }
            catch
            {
                result.EmpileErreur(I.T("Bad SmartField field format (@1)|20059", strPropriete));
                return(result);
            }
            CContexteDonnee contexte   = objetDonnee.ContexteDonnee;
            CSmartField     smartField = new CSmartField(contexte);

            if (!smartField.ReadIfExists(nIdSmartField))
            {
                result.EmpileErreur(I.T("Smart field @1 doesn't exists|20060", strPropriete));
                return(result);
            }
            if (smartField.Definition != null)
            {
                return(CInterpreteurProprieteDynamique.GetValue(objet, smartField.Definition));
            }
            result.Data = null;
            return(result);
        }
Пример #2
0
 /// //////////////////////////////////////////////////////
 public CDefinitionProprieteDynamiqueSmartField(CSmartField smartField)
     : base(smartField.Libelle.Replace(" ", "_"), smartField.Id.ToString(),
            smartField.Definition.TypeDonnee, false, true)
 {
     m_nIdSmartField = smartField.Id;
 }