예제 #1
0
        /// <summary>
        /// Restores the view-state information from a previous user control request that was saved by the <see cref="M:System.Web.UI.UserControl.SaveViewState" /> method.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Object" /> that represents the user control state to be restored.</param>
        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);
            RockContext rockContext = new RockContext();

            CreateFilterControl(ViewState["EntityTypeId"] as int?, DataViewFilter.FromJson(ViewState["DataViewFilter"].ToString()), false, rockContext);
        }
예제 #2
0
        /// <summary>
        /// Restores the view-state information from a previous user control request that was saved by the <see cref="M:System.Web.UI.UserControl.SaveViewState" /> method.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Object" /> that represents the user control state to be restored.</param>
        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);

            var fieldSettingJson = ViewState["FieldSettings"].ToString();

            if (fieldSettingJson.IsNotNullOrWhiteSpace())
            {
                _fieldSettings = JsonConvert.DeserializeObject <List <ContentChannelItemList.FieldSetting> >(fieldSettingJson);
            }

            var propertyInfoJson = ViewState["PropertyInfo"].ToString();

            if (propertyInfoJson.IsNotNullOrWhiteSpace())
            {
                _contentChannelProperties = JsonConvert.DeserializeObject <List <PropertyInfoSummary> >(propertyInfoJson);
            }

            var channelId = ViewState["ChannelId"] as int?;

            using (var rockContext = new RockContext())
            {
                var channel = new ContentChannelService(rockContext).Queryable("ContentChannelType")
                              .FirstOrDefault(c => c.Id == channelId.Value);
                if (channel != null)
                {
                    CreateFilterControl(channel, DataViewFilter.FromJson(ViewState["DataViewFilter"].ToString()), false, rockContext);
                }
            }
        }
        /// <summary>
        /// Restores the view-state information from a previous user control request that was saved by the <see cref="M:System.Web.UI.UserControl.SaveViewState" /> method.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Object" /> that represents the user control state to be restored.</param>
        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);

            var rockContext = new RockContext();

            CreateFilterControl(this.ContentChannelTypeId, DataViewFilter.FromJson(ViewState["DataViewFilter"].ToString()), false, rockContext);
        }
        /// <summary>
        /// Restores the view-state information from a previous user control request that was saved by the <see cref="M:System.Web.UI.UserControl.SaveViewState" /> method.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Object" /> that represents the user control state to be restored.</param>
        protected override void LoadViewState(object savedState)
        {
            base.LoadViewState(savedState);

            ChannelGuid = ViewState["ChannelGuid"] as Guid?;

            var rockContext = new RockContext();

            var channel = new ContentChannelService(rockContext).Queryable("ContentChannelType")
                          .FirstOrDefault(c => c.Guid.Equals(ChannelGuid.Value));

            if (channel != null)
            {
                CreateFilterControl(channel, DataViewFilter.FromJson(ViewState["DataViewFilter"].ToString()), false, rockContext);
            }
        }