コード例 #1
0
        public string Delete(string ArticleID)
        {
            JResult jr = new JResult();
            UserManager.Instance.CheckLogin(Request, ViewBag);
            if (ViewBag.Login)
            {
                var articleItem = ArticleManager.Instance.GetArticleItem(ArticleID);
                if (articleItem == null)
                {
                    jr.ErrorMsg = "文档不存在";

                }
                else
                {
                    if (ViewBag.User.GUID == articleItem.AuthorID)
                    {
                        ArticleManager.Instance.DeleteArticle(articleItem.GUID);
                        jr.Success = true;
                    }
                    else
                    {
                        jr.ErrorMsg = "非文档作者不可删除!";
                    }
                }
            }
            return JsonConvert.SerializeObject(jr);
        }
コード例 #2
0
 public string Publish(string ArticleID)
 {
     JResult jr = new JResult();
     try
     {
         var r = ArticleManager.Instance.Publish(ArticleID);
         jr.Success = r;
     }
     catch (Exception ex)
     {
         jr.ErrorMsg = ex.Message;
         QLog.SendLog_Exception(ex.ToString(), LogTag);
     }
     return JsonConvert.SerializeObject(jr);
 }