Esempio n. 1
0
        /// <summary>
        /// Updates the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="name">The name.</param>
        /// <param name="value">The value.</param>
        /// <param name="useDisplayName">if set to <c>true</c> [use display name].</param>
        public void UpdateModel(TModel model, string name, string value, bool useDisplayName)
        {
            ViewField field = useDisplayName ? viewFieldsCollection.FindByDisplayName(name) : viewFieldsCollection.FindByName(name);

            if (field != null)
            {
                modelProperties.TrySetValueFromString(model, field.DisplayName, value);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the display name of the field.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        /// <returns></returns>
        public string GetFieldDisplayName(string fieldName)
        {
            ViewField viewField = viewFieldsCollection.FindByName(fieldName);

            return(viewField != null ? viewField.DisplayName : fieldName);
        }