Exemplo n.º 1
0
        /// <summary>
        /// Sets the value on select.
        /// </summary>
        protected override void SetValueOnSelect()
        {
            var      dataViewId = ItemId.AsIntegerOrNull();
            DataView dataView   = null;

            if (dataViewId.HasValue && dataViewId > 0)
            {
                dataView = new DataViewService(new RockContext()).Get(ItemId.AsInteger());
            }

            SetValue(dataView);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the selected value as an integer, returning NULL if the selected value is "0"
        /// </summary>
        /// <param name="noneAsNull">if set to <c>true</c> [none as null].</param>
        /// <returns></returns>
        /// <value>
        /// The selected value as int.
        /// </value>
        public int?SelectedValueAsInt(bool noneAsNull = true)
        {
            if (string.IsNullOrWhiteSpace(ItemId))
            {
                return(null);
            }

            int result = ItemId.AsInteger();

            if (noneAsNull)
            {
                if (result == Constants.None.Id)
                {
                    return(null);
                }
            }

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the value of the currently selected item.
        /// It will return NULL if either <see cref="T:Rock.Constants.None"/> or <see cref="T:Rock.Constants.All"/> is selected. />
        /// </summary>
        /// <returns></returns>
        public int?SelectedValueAsId()
        {
            if (string.IsNullOrWhiteSpace(ItemId))
            {
                return(null);
            }

            int result = ItemId.AsInteger();

            if (result == Constants.None.Id)
            {
                return(null);
            }

            if (result == Constants.All.Id)
            {
                return(null);
            }

            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the value on select.
        /// </summary>
        protected override void SetValueOnSelect()
        {
            var metric = new MetricService(new RockContext()).Get(ItemId.AsInteger());

            SetValue(metric);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets the value on select.
        /// </summary>
        protected override void SetValueOnSelect()
        {
            var report = new ReportService(new RockContext()).Get(ItemId.AsInteger());

            SetValue(report);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Sets the value on select.
        /// </summary>
        protected override void SetValueOnSelect()
        {
            var item = new MergeTemplateService(new RockContext()).Get(ItemId.AsInteger());

            this.SetValue(item);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Sets the value on select.
        /// </summary>
        protected override void SetValueOnSelect()
        {
            var dataView = new DataViewService(new RockContext()).Get(ItemId.AsInteger());

            SetValue(dataView);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Sets the value on select.
 /// </summary>
 protected override void SetValueOnSelect()
 {
     SetValueFromCache(NamedScheduleCache.Get(ItemId.AsInteger()));
 }