Ejemplo n.º 1
0
        private void uxWorkflowButton_Click(object sender, EventArgs e)
        {
            var history = SitecoreClient.GetItemWorkflowHistory(_parent.ArticleDetails.ArticleGuid);

            if (_parent.ArticleDetails.IsPublished)
            {
                DateTime actualPublishDate = SitecoreClient.GetArticleActualPublishedDate(_parent.ArticleDetails.ArticleGuid);

                if (actualPublishDate != DateTime.MinValue)
                {
                    MessageBox.Show(string.Format("Published on '{0}'", actualPublishDate.ToLocalTime().ToString("MM/dd/yyyy hh:mm:00 tt")));
                }
            }
            else
            {
                MessageBox.Show(string.Format("Workflow state: '{0}' since {1}", _parent.ArticleDetails.ArticleWorkflowState?.DisplayName, history.LastOrDefault().Item1.ToLocalTime().ToString("MM/dd/yyyy hh:mm:00 tt")));
            }
            return;

            var articleWorkFlowInfo = new ArticleWorkflowInfo(_parent)
            {
                StartPosition = FormStartPosition.CenterParent
            };

            articleWorkFlowInfo.ShowDialog();
        }