Esempio n. 1
0
        private void ArchiveExistingContent()
        {
            Content content = Content.GetActiveContent(_moduleId, _culture);

            if (content != null)
            {
                content.StatusId = 3;//3=archived
                content.UpdateContent();
            }
        }
Esempio n. 2
0
        protected void Propose_Click(object sender, EventArgs e)
        {
            Content pendingContent = Content.GetPendingContent(_moduleId, _culture);

            if (null == pendingContent)
            {
                SaveNewContent(1);//1=pending
            }
            else
            {
                pendingContent.Text     = ContentTextEditor.Text;
                pendingContent.Modified = DateTime.Now;
                pendingContent.UpdateContent();
            }

            SendProposedContentNotificationEmail();

            leavePage();
        }
Esempio 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();
        }