Пример #1
0
        /// <summary>
        /// Gets the css class name by specified content query result item.
        /// </summary>
        /// <param name="dataItem">The content query result item.</param>
        /// <returns>A string contains css class names.</returns>
        public string GetCssClass(ContentQueryResultItem dataItem)
        {
            var cls = CssClass;

            if (this.FieldType == (int)ContentFieldTypes.Number || FieldType == (int)ContentFieldTypes.Integer || FieldType == (int)ContentFieldTypes.Currency)
            {
                if (dataItem[Name] == DBNull.Value || Convert.ToInt32(dataItem[Name]) == 0)
                {
                    cls += " d-view-field-val-zero";
                }
            }
            return(cls);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the ContentViewFieldValue class with field and item.
 /// </summary>
 /// <param name="field">The view field object</param>
 /// <param name="item">The query result item.</param>
 public ContentViewFieldValue(ContentFieldRef field, ContentQueryResultItem item)
 {
     this.Item = item;
     Field     = field;
 }