예제 #1
0
        public JsonResult ArticleInsert(ArticleVO articleVO)
        {
            articleVO.Content = HttpUtility.UrlDecode(articleVO.Content);
            int articleId = ArticleBasisService.Insert(articleVO);
            int agentId   = 0;

            if (articleVO.Application == ArticleEnums.LegalComplianceApplication)
            {
                agentId = int.Parse(AppSettingManager.GetSetting("WorkWXConfig", "LegalComplianceApplicationAgentId"));
            }
            else if (articleVO.Application == ArticleEnums.ExpertManagement)
            {
                agentId = int.Parse(AppSettingManager.GetSetting("WorkWXConfig", "ExpertManagementAgentId"));
            }
            // 微信推送消息
            new RestClient().Post(ConfigurationManager.AppSettings["WxMessageUrl"].ToString(), new
            {
                agentId  = agentId,
                content  = string.Format("新推文:{0}", articleVO.Title),
                partyIds = articleVO.ArticleDepartmentList != null && articleVO.ArticleDepartmentList.Count > 0
                ? string.Join("|", articleVO.ArticleDepartmentList.Select(p => p.DepartmentId)) : "",
                userIds = articleVO.UserIds
            }, RequestFormat.Json);
            return(Json(new AjaxResult()
            {
                Success = true, Data = articleId
            }));
        }
예제 #2
0
 public JsonResult ArticleDelete(int articleId)
 {
     ArticleBasisService.Delete(articleId);
     return(Json(new AjaxResult()
     {
         Success = true, Data = true
     }, JsonRequestBehavior.AllowGet));
 }
예제 #3
0
 public JsonResult ArticleUpdate(ArticleVO articleVO)
 {
     articleVO.Content = HttpUtility.UrlDecode(articleVO.Content);
     ArticleBasisService.Update(articleVO);
     return(Json(new AjaxResult()
     {
         Success = true, Data = true
     }));
 }
예제 #4
0
        public JsonResult GetById(int articleId)
        {
            var           temp    = ArticleBasisService.GetById(articleId);
            List <string> userIds = ArticleBasisService.SearchArticleUserList(articleId);

            temp.ArticleDepartmentList = ArticleDepartmentService.ListByArticleId(articleId);
            temp.UserIds = string.Join("|", userIds);
            return(Json(new AjaxResult()
            {
                Success = true, Data = temp
            }, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public JsonResult Query()
        {
            QF_Article filter = BuildQueryFilterEntity <QF_Article>();

            return(AjaxGridJson(ArticleBasisService.SearchPageList(filter)));
        }