Esempio n. 1
0
        /// <summary>
        /// 新闻详情
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public static NewsDetailsInfo QueryNewsDetailsInfo(QueryNewsDetailsParam param)
        {
            Dictionary <String, String> parameters = new Dictionary <String, String>();

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

            //反序列化JSON字符串,将JSON字符串转换成LIST列表
            return(JsonConvert.DeserializeObject <NewsDetailsInfo>(jsonText));
        }
Esempio n. 2
0
 private void query()
 {
     try
     {
         QueryNewsDetailsParam param = new QueryNewsDetailsParam();
         param.articleId   = SysBLL.newsListInfoData.articleId;
         param.articlePath = SysBLL.newsListInfoData.articlePath;
         NewsDetailsInfo info     = NewsAccess.QueryNewsDetailsInfo(param);
         string          htmlText = info.data.content.Replace("body{", "body{ margin:20px;font-family:'微软雅黑';font-size: 20px;");
         htmlText = htmlText.Insert(htmlText.IndexOf("<p"), "<p style=\"text-align:center; color: #17242A;font-family: '微软雅黑';font-size: 24px;margin-bottom: 15px;\">" + info.data.title + "</p>"
                                    + "<p style = \"text-align: center;font-family: '微软雅黑';margin-top:5px;\"><span style=\"color:#960C0F;margin-right: 30px;\">http://www.lzbs.com.cn</span>"
                                    + "<span style=\"margin-right:70px;color: #2F4C59\"> " + info.data.createTime + " </span><span style=\"color:#2F4C59\"> 来源:" + info.data.sourceName + "</span></p><p>");
         webPage.Dispatcher.Invoke(new setWebHtmlDelegate(setWebHtml), htmlText);
     }
     catch (ThreadAbortException ae) { log.Write("error:FormNewsDetails:query:" + ae.Message); }
     catch (Exception e)
     {
         log.Write("error:FormNewsDetails:query:" + e.Message);
     }
 }