Ejemplo n.º 1
0
        protected void Restore_Click(object sender, EventArgs e)
        {
            ArchiveExistingContent();

            //publish the selected archived content
            Content newContent = Content.GetContentByContentVersionId(
                int.Parse(ContentVersions.SelectedValue));

            newContent.Modified = DateTime.Now;
            newContent.StatusId = 2;//2=active

            newContent.CreateContent();

            leavePage();
        }
Ejemplo n.º 2
0
        protected void ContentVersions_Change(object sender, EventArgs e)
        {
            Content content = Content.GetContentByContentVersionId(
                int.Parse(ContentVersions.SelectedValue));

            if (content.StatusId == 3) //archived content
            {
                ContentTextEditor.Text   = content.Text;
                ContentModifiedDate.Text = content.Modified.ToString();

                SaveAndPublish.Visible  = false;
                Propose.Visible         = false;
                RestoreArchived.Visible = AllowApproveContent();
            }
            else
            {
                LoadContent(content);
            }
        }
Ejemplo n.º 3
0
        protected void SaveAndPublish_Click(object sender, EventArgs e)
        {
            Content content = null;
            int     contentId;

            if (int.TryParse(ContentVersions.SelectedValue, out contentId))
            {
                content = Content.GetContentByContentVersionId(contentId);
            }

            ArchiveExistingContent();

            if (null == content)
            {                      //create and publish new content.
                SaveNewContent(2); //2=active
            }
            else
            {
                if (content.StatusId == 1)
                { //publish the existing pending content.
                    content.Text     = ContentTextEditor.Text;
                    content.Modified = DateTime.Now;
                    content.StatusId = 2;
                    content.UpdateContent();
                }
                else if (content.StatusId == 2)
                {
                    SaveNewContent(2);//2=active
                }
                else //failsafe
                {
                    SaveNewContent(2);//2=active
                }
            }

            leavePage();
        }