/// <summary>
        /// 删除规则
        /// </summary>
        protected void DeleteMsgRule()
        {
            int  msgId  = EConvert.ConvertTo <int>(Request["msgId"]);
            bool result = MsgReplyBll.DeleteMsgRule(msgId);

            Json(new { state = result });
        }
Exemple #2
0
        //获取图文、图片永久素材列表
        protected void GetMediaList()
        {
            bool   useSync = EConvert.ConvertTo <bool>(Request["mode"]);
            string type    = Request["type"];

            try
            {
                if (useSync)
                {
                    MpDataSyncApi api = new MpDataSyncApi();
                    api.SaveMmaterialData();
                }
                List <mpmateriallib> newsList = null;
                List <mpmateriallib> imgList  = null;
                int imgNum  = EConvert.ConvertTo <int>(ConfigurationManager.AppSettings["WeChatImgDefaultCount"]);
                int newsNum = EConvert.ConvertTo <int>(ConfigurationManager.AppSettings["WeChatNewsDefaultCount"]);
                if (type == "img")
                {
                    imgList = MpMaterialLibBll.GetMaterialList(UploadMediaFileType.image.ToString(), imgNum);
                }
                else if (type == "news")
                {
                    newsList = MpMaterialLibBll.GetMaterialList(UploadMediaFileType.news.ToString(), newsNum);
                }
                else
                {
                    imgList  = MpMaterialLibBll.GetMaterialList(UploadMediaFileType.image.ToString(), imgNum);
                    newsList = MpMaterialLibBll.GetMaterialList(UploadMediaFileType.news.ToString(), newsNum);
                }
                Json(new { state = true, newsList = newsList, imgList = imgList });
            }
            catch (Exception e)
            {
                Json(new { state = false });
            }
        }