Example #1
0
        /// <summary>
        /// Handles the Click event of the Restore control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event
        /// data.</param>
        protected void CmdRestore_Click(object sender, System.EventArgs e)
        {
            if (this.Request.QueryString["ShowHistory"] != null)
            {
                string historyPK = this.Request.QueryString["ShowHistory"];
                var topicHistoryItem = TopicHistoryBo.GetItem(int.Parse(historyPK));
                topicHistoryItem.TabID = this.TabId;
                topicHistoryItem.PortalSettings = this.PortalSettings;
                var topicHistoryBO = new DotNetNuke.Wiki.BusinessObjects.Models.TopicHistory();
                topicHistoryBO.TabID = this.TabId;
                topicHistoryBO.PortalSettings = this.PortalSettings;
                topicHistoryBO.Content = CurrentTopic.Content;
                topicHistoryBO.TopicId = this.TopicId;
                topicHistoryBO.UpdatedBy = CurrentTopic.UpdatedBy;
                topicHistoryBO.UpdateDate = CurrentTopic.UpdateDate;
                topicHistoryBO.Name = this.PageTopic;
                topicHistoryBO.Title = CurrentTopic.Title;
                topicHistoryBO.UpdatedByUserID = CurrentTopic.UpdatedByUserID;

                CurrentTopic.Content = topicHistoryItem.Content;
                CurrentTopic.Name = topicHistoryItem.Name;
                CurrentTopic.Title = topicHistoryItem.Title;
                CurrentTopic.Keywords = topicHistoryItem.Keywords;
                CurrentTopic.Description = topicHistoryItem.Description;
                CurrentTopic.UpdatedBy = UserInfo.Username;
                CurrentTopic.UpdateDate = DateTime.Now;
                CurrentTopic.UpdatedByUserID = this.UserId;
                TopicBo.Update(this.CurrentTopic);
                TopicHistoryBo.Add(topicHistoryBO);

                Response.Redirect(this.HomeURL, true);
            }
        }
Example #2
0
        /// <summary>
        /// Handles the Click event of the Restore control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event
        /// data.</param>
        protected void CmdRestore_Click(object sender, System.EventArgs e)
        {
            if (this.Request.QueryString["ShowHistory"] != null)
            {
                string historyPK        = this.Request.QueryString["ShowHistory"];
                var    topicHistoryItem = TopicHistoryBo.GetItem(int.Parse(historyPK));
                topicHistoryItem.TabID          = this.TabId;
                topicHistoryItem.PortalSettings = this.PortalSettings;
                var topicHistoryBO = new DotNetNuke.Wiki.BusinessObjects.Models.TopicHistory();
                topicHistoryBO.TabID           = this.TabId;
                topicHistoryBO.PortalSettings  = this.PortalSettings;
                topicHistoryBO.Content         = CurrentTopic.Content;
                topicHistoryBO.TopicId         = this.TopicId;
                topicHistoryBO.UpdatedBy       = CurrentTopic.UpdatedBy;
                topicHistoryBO.UpdateDate      = CurrentTopic.UpdateDate;
                topicHistoryBO.Name            = this.PageTopic;
                topicHistoryBO.Title           = CurrentTopic.Title;
                topicHistoryBO.UpdatedByUserID = CurrentTopic.UpdatedByUserID;

                CurrentTopic.Content         = topicHistoryItem.Content;
                CurrentTopic.Name            = topicHistoryItem.Name;
                CurrentTopic.Title           = topicHistoryItem.Title;
                CurrentTopic.Keywords        = topicHistoryItem.Keywords;
                CurrentTopic.Description     = topicHistoryItem.Description;
                CurrentTopic.UpdatedBy       = UserInfo.Username;
                CurrentTopic.UpdateDate      = DateTime.Now;
                CurrentTopic.UpdatedByUserID = this.UserId;
                TopicBo.Update(this.CurrentTopic);
                TopicHistoryBo.Add(topicHistoryBO);

                Response.Redirect(this.HomeURL, true);
            }
        }