Beispiel #1
0
        /// <summary>
        /// 新闻列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static NewsListInfo QueryNewsLists(QueryNewsParam param)
        {
            Dictionary <String, String> parameters = new Dictionary <String, String>();

            parameters.Add("appId", News.queryPoliticalNewsAppId);
            parameters.Add("conName", param.conName);
            string jsonText = HttpHelper.getHttp(SysConfigHelper.readerNode("queryPoliticalNewsName"), parameters, null);

            //反序列化JSON字符串,将JSON字符串转换成LIST列表
            return(JsonConvert.DeserializeObject <NewsListInfo>(jsonText));
        }
Beispiel #2
0
        /// <summary>
        /// 查询
        /// </summary>
        private void Query()
        {
            QueryNewsParam param = new QueryNewsParam();

            param.conName = "政务信息列表查询";
            newsListInfo  = null;
            newsListInfo  = NewsAccess.QueryNewsLists(param);
            if ("9999".Equals(newsListInfo.success))
            {
                setShowinfo(newsListInfo.msg);
                hideTitle();
                return;
            }
            int j = newsListInfo.data.Count;

            j--;
            int count = 0;

            for (int i = j; i >= 0; i--)
            {
                resultInfo.Add(count, new string[] { newsListInfo.data[i].pubTime, newsListInfo.data[i].title });
                count++;
            }
            setPage(pageNo);

            if (newsListInfo.data.Count == 0)
            {
                hideTitle();
                throw new Exception();
            }
            else
            {
                showTitle();
                showinfo.Dispatcher.Invoke(new setTextBlockVisibilityDelegate(setTextBlockVisibility), showinfo, false);
            }
        }