/// <summary> /// 拒绝文章被收录到某主题(操作人是专题的拥有者) /// </summary> /// <param name="TopicOwnerId"></param> /// <param name="ArticleId"></param> /// <returns></returns> public ActionResult RefuseActicle(string TopicId, string ArticleId, string MessageId) { if (Session[ConstHelper.Session_USERID] == null) { return(Redirect("/")); } string accountid = Session[ConstHelper.Session_USERID].ToString(); var article = Article.GetArticleBySn(ArticleId); var topic = Topic.GetTopicBySn(TopicId); if (article == null || topic == null) { SiteMessage.CloseMessage(MessageId, accountid, "没有发现文章或者主题"); } else { if (accountid != topic.OwnerId) { return(Redirect("/")); } TopicArticle.ChangeTopicStatus(topic.OwnerId, ArticleId, false); SiteMessage.CreateNotify(article.OwnerId, "您的收录请求被拒绝,[" + article.Title + "]没有被收录到文集中", accountid); SiteMessage.CloseMessage(MessageId, accountid, "拒绝"); } return(Redirect("/Author/SiteMessageList")); }
/// <summary> /// 拒绝文章首页申请 /// </summary> /// <param name="ArticleId"></param> /// <returns></returns> public ActionResult Reject() { if (Session[ConstHelper.Session_USERID] == null) { return(Redirect("/")); } if ((UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Admin && (UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Editor) { return(Redirect("/")); } string strMessage = Request.Form["message"]; string ArticleId = Request.Form["ArticleID"]; if (string.IsNullOrEmpty(ArticleId)) { return(Redirect("/")); } if (Article.GetArticleBySn(ArticleId) == null) { return(Redirect("/")); } if (string.IsNullOrEmpty(strMessage)) { return(Redirect("/")); } Article.Reject(ArticleId, strMessage); Article article = Article.GetArticleBySn(ArticleId); var articleurl = "<a href = '/PostEdit/MarkDownEditor?ArticleId=" + article.Sn + "'>" + article.Title + "</a>"; SiteMessage.CreateNotify(article.OwnerId, "您的文章[" + articleurl + "]没有通过审核,理由:" + strMessage); return(Redirect("/Admin")); }
/// <summary> /// 接受文章被收录到某主题(操作人是文章的拥有者) /// </summary> /// <param name="TopicOwnerId"></param> /// <param name="ArticleId"></param> /// <returns></returns> public ActionResult AcceptTopic(string TopicOwnerId, string ArticleId, string MessageId) { if (Session[ConstHelper.Session_USERID] == null) { return(Redirect("/")); } string accountid = Session[ConstHelper.Session_USERID].ToString(); var article = Article.GetArticleBySn(ArticleId); if (article == null) { SiteMessage.CloseMessage(MessageId, accountid, "没有发现文章"); } else { if (accountid != article.OwnerId) { return(Redirect("/")); } TopicArticle.ChangeTopicStatus(TopicOwnerId, ArticleId, true); SiteMessage.CreateNotify(TopicOwnerId, "您的收录请求被接受,[" + article.Title + "]被收录到您的文集中", accountid); SiteMessage.CloseMessage(MessageId, accountid, "接受"); } return(Redirect("/Author/SiteMessageList")); }
/// <summary> /// 移出首页 /// </summary> /// <param name="ArticleId"></param> /// <returns></returns> public ActionResult RemoveFromFirstPage(string ArticleId) { if (Session[ConstHelper.Session_USERID] == null || (UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Admin) { return(Redirect("/")); } if (string.IsNullOrEmpty(ArticleId)) { return(Redirect("/")); } Article.Reject(ArticleId, "移出首页"); Article article = Article.GetArticleBySn(ArticleId); var articleurl = "<a href = '/PostEdit/MarkDownEditor?ArticleId=" + article.Sn + "'>" + article.Title + "</a>"; SiteMessage.CreateNotify(article.OwnerId, "您的文章[" + articleurl + "]被移出首页"); return(Redirect("/Admin/ArticleList?PageNo=1")); }
/// <summary> /// 接受文章首页申请 /// </summary> /// <param name="ArticleId"></param> /// <returns></returns> public ActionResult Accept(string ArticleId) { if (string.IsNullOrEmpty(ArticleId)) { return(Redirect("/")); } if (Session[ConstHelper.Session_USERID] == null) { return(Redirect("/")); } if ((UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Admin && (UserType)Session[ConstHelper.Session_PRIVILEGE] != UserType.Editor) { return(Redirect("/")); } if (Article.GetArticleBySn(ArticleId) == null) { return(Redirect("/")); } Article.Accept(ArticleId); Article article = Article.GetArticleBySn(ArticleId); var articleurl = "<a href = '/Article/Index?ArticleId=" + article.Sn + "'>" + article.Title + "</a>"; SiteMessage.CreateNotify(article.OwnerId, "您的文章[" + articleurl + "]通过审核"); if (article.IsPutToMyTopic) { //发布后则加入到自己专题 var topic = Topic.GetTopicByAccountId(article.OwnerId); if (topic != null) { TopicArticle.InsertTopicArticle(new TopicArticle() { ArticleID = article.Sn, TopicID = topic.Sn, PublishStatus = ApproveStatus.NotNeed }); } } return(Redirect("/Admin")); }