Ejemplo n.º 1
0
        public virtual string GetExtendedAttribute(string name)
        {
            name = name.ToLower();
            var returnValue = _extendedAttributes[name];

            if (returnValue == null && _dataItem != null)
            {
                var obj = SqlUtils.Eval(_dataItem, name);
                if (obj != null)
                {
                    if (obj is string)
                    {
                        returnValue = _extendedAttributes[name] = obj as string;
                    }
                    else
                    {
                        returnValue = _extendedAttributes[name] = obj.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(returnValue))
            {
                returnValue = PageUtils.UnFilterSql(returnValue);
            }

            return(returnValue ?? string.Empty);
        }
Ejemplo n.º 2
0
        public bool ContainsKey(string name)
        {
            var returnValue = _extendedAttributes[name];

            if (returnValue == null && _dataItem != null)
            {
                returnValue = SqlUtils.Eval(_dataItem, name);
            }

            return((returnValue == null) ? false : true);
        }
Ejemplo n.º 3
0
        public virtual object GetExtendedAttribute(string name)
        {
            var returnValue = _extendedAttributes[name];

            if (returnValue == null && _dataItem != null)
            {
                returnValue = SqlUtils.Eval(_dataItem, name);
            }

            return(returnValue ?? string.Empty);
        }
Ejemplo n.º 4
0
        public CountInfo(object dataItem)
        {
            if (dataItem == null)
            {
                return;
            }

            foreach (var name in AllAttributes)
            {
                var value = SqlUtils.Eval(dataItem, name);
                if (value != null)
                {
                    SetValueInternal(name, value);
                }
            }
        }
Ejemplo n.º 5
0
 protected BaseInfo(object dataItem)
 {
     if (dataItem != null)
     {
         if (AllAttributes != null)
         {
             foreach (var name in AllAttributes)
             {
                 var value = SqlUtils.Eval(dataItem, name);
                 if (value != null)
                 {
                     SetValueInternal(name, value);
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
        private static string GetValueFromContent(PageInfo pageInfo, ContextInfo contextInfo, string testTypeStr)
        {
            string theValue = null;

            if (contextInfo.ItemContainer?.ContentItem != null)
            {
                theValue = SqlUtils.Eval(contextInfo.ItemContainer.ContentItem.DataItem, testTypeStr) as string;
            }

            if (theValue == null)
            {
                if (contextInfo.ContentInfo == null)
                {
                    var tableName = NodeManager.GetTableName(pageInfo.PublishmentSystemInfo, contextInfo.ChannelId);
                    theValue = BaiRongDataProvider.ContentDao.GetValue(tableName, contextInfo.ContentId, testTypeStr);
                }
                else
                {
                    theValue = contextInfo.ContentInfo.GetExtendedAttribute(testTypeStr);
                }
            }
            return(theValue);
        }
Ejemplo n.º 7
0
        public bool ContainsKey(string name)
        {
            name = name.ToLower();
            var returnValue = _extendedAttributes[name];

            if (returnValue == null && _dataItem != null)
            {
                var obj = SqlUtils.Eval(_dataItem, name);
                if (obj != null)
                {
                    if (obj is string)
                    {
                        returnValue = _extendedAttributes[name] = obj as string;
                    }
                    else
                    {
                        returnValue = _extendedAttributes[name] = obj.ToString();
                    }
                }
            }

            return(returnValue != null);
        }