예제 #1
0
        /// <summary>
        /// action view
        /// </summary>
        /// <param name="mid"></param>
        /// <param name="idx"></param>
        /// <returns></returns>
        public ActionResult LoadModel(int lcid, int idx)
        {
            WeChatArticleService pService = new WeChatArticleService("QY", "mpnews");
            WXArticleResultJson  pArticle = pService.LoadResourcesSingleBylcID(lcid);
            var pResult = pService.GetActionResult();

            if (pResult != null || pArticle == null || pArticle.ListNews == null || pArticle.ListNews.Count <= idx)
            {
                return(Content("没有找到对应图文段落!"));
            }

            return(Json(pArticle.ListNews[idx]));
        }
예제 #2
0
        public ActionResult ArticleUpLoad(int?id, string name, string cla, string ListNews, bool bByLink)
        {
            var nw = bByLink ? "news" : "mpnews";
            WeChatArticleService pService = new WeChatArticleService("QY", nw);

            pService.UpdateResources(id, name, cla, ListNews, bByLink);
            EGExceptionResult pResult = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "保存成功", EGActionCode.执行成功.ToString());
            return(Json(pResult));
        }
예제 #3
0
        /// <summary>
        /// 启动图文资源页面后,再单独执行action获取图文资源
        /// </summary>
        /// <returns></returns>
        public ActionResult LoadWXArticles(int PageIndex = 1, int RowCountInPage = 8, string filterString = "")
        {
            int iRecCount = -1;
            //加载图片资源集合
            WeChatArticleService       pService = new WeChatArticleService("QY");
            List <WXArticleResultJson> plist    = pService.LoadResources(PageIndex, RowCountInPage, filterString, out iRecCount);
            EGExceptionResult          pResult  = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }
            var pModel = new
            {
                IsSuccess    = true,
                ListJson     = plist,
                RecordsCount = iRecCount
            };

            return(Json(pModel));
        }