Exemplo n.º 1
0
        protected void CheckOut()
        {
            try
            {
                if (_scTree.DoesArticleHaveText(GetArticleNumber()))
                {
                    DialogResult dialogResult = MessageBox.Show
                                                    ("This article already has some content uploaded. If you choose to check out the article now and later upload, you will overwrite that content. Are you sure you wish to checkout this article?",
                                                    "Elsevier",
                                                    MessageBoxButtons.YesNo,
                                                    MessageBoxIcon.Question);
                    if (dialogResult != DialogResult.Yes)
                    {
                        return;
                    }
                }

                GetArticeDetailsFromSitecore();
                bool result = _scServer.CheckOutArticle(GetArticleNumber(), _user.Username);
                if (!result)
                {
                    throw new WebException("Error checking in article");
                }
                IsCheckedOutByMe = true;
                IsCheckedOut     = true;
            }
            catch (Exception ex)
            {
                AlertConnectionFailed();
                Globals.SitecoreAddin.LogException("Error in article details when checking out article", ex);
            }
        }