예제 #1
0
        /// <inheritdoc/>
        public override string GetTextValue(string value, Dictionary <string, string> configurationValues)
        {
            var intValue = value.AsIntegerOrNull();

            if (!intValue.HasValue)
            {
                return(string.Empty);
            }

            System.DayOfWeek dayOfWeek = (System.DayOfWeek)intValue.Value;
            return(dayOfWeek.ConvertToString());
        }
예제 #2
0
        /// <summary>
        /// Returns the field's current value(s)
        /// </summary>
        /// <param name="parentControl">The parent control.</param>
        /// <param name="value">Information about the value</param>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="condensed">Flag indicating if the value should be condensed (i.e. for use in a grid column)</param>
        /// <returns></returns>
        public override string FormatValue(System.Web.UI.Control parentControl, string value, Dictionary <string, ConfigurationValue> configurationValues, bool condensed)
        {
            string formattedValue = string.Empty;

            int?intValue = value.AsIntegerOrNull();

            if (intValue.HasValue)
            {
                System.DayOfWeek dayOfWeek = (System.DayOfWeek)intValue.Value;
                formattedValue = dayOfWeek.ConvertToString();
            }

            return(base.FormatValue(parentControl, formattedValue, null, condensed));
        }