Esempio n. 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);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the Click event of the Delete Button 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 DeleteBtn_Click(object sender, System.EventArgs e)
        {
            try
            {
                UoW.BeginTransaction();

                TopicBo.Delete(this.CurrentTopic);

                UoW.CommitTransaction();
                Response.Redirect(this.HomeURL, false);
            }
            catch (System.Exception exc)
            {
                UoW.RollbackTransaction();

                Exceptions.LogException(exc);
                this.Messages.ShowError(Localization.GetString("ErrorDeletingTopic", this.LocalResourceFile));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Handles the Click event of the Submit 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 BtnSubmit_Click(object sender, System.EventArgs e)
        {
            bool save = false;

            save = false;
            if (this.rating1.Checked)
            {
                this.InnerTopic.RatingOneCount = this.InnerTopic.RatingOneCount + 1;
                save = true;
            }
            else if (this.rating2.Checked)
            {
                this.InnerTopic.RatingTwoCount = this.InnerTopic.RatingTwoCount + 1;
                save = true;
            }
            else if (this.rating3.Checked)
            {
                this.InnerTopic.RatingThreeCount = this.InnerTopic.RatingThreeCount + 1;
                save = true;
            }
            else if (this.rating4.Checked)
            {
                this.InnerTopic.RatingFourCount = this.InnerTopic.RatingFourCount + 1;
                save = true;
            }
            else if (this.rating5.Checked)
            {
                this.InnerTopic.RatingFiveCount = this.InnerTopic.RatingFiveCount + 1;
                save = true;
            }

            if (save)
            {
                TopicBo.Update(this.InnerTopic);
            }

            this.HasVoted = true;
            this.DisplayHasVoted();
        }