Esempio n. 1
0
        /// <summary>
        ///  获得信息详细
        /// </summary>
        /// <returns></returns>
        public string getNewsDetailInfo()
        {
            JObject msg   = new JObject();
            string  appid = this.Request.Form["aid"];
            string  id    = this.Request.Form["id"];

            if (!Lw_Utils.WeChartCertify(appid))
            {
                msg.Add("msg", "APPIDERROR");
            }
            else
            {
                WebReference.WebService1 client = Lw_Utils.getServiceMethod();
                JArray NewsDetail;
                NewsDetail = (JArray)JsonConvert.DeserializeObject(client.GetNewsDetail(id));
                if (NewsDetail.LongCount() == 0)
                {
                    msg.Add("data", new JArray());
                    msg.Add("msg", "NOTFOUNT");
                }
                else
                {
                    foreach (JToken jt in NewsDetail)
                    {
                        JObject item    = (JObject)jt;
                        string  hasfile = (string)item["FileLoad"];
                        if (hasfile == "1")
                        {
                            JArray FileList = (JArray)JsonConvert.DeserializeObject(client.GetFiles((string)item["id"]));
                            item.Add("FileList", FileList);
                        }
                        else
                        {
                            item.Add("FileList", new JArray());
                        }
                        JArray ja = new JArray();
                        ja.Add(item);
                        msg.Add("data", NewsDetail);
                        msg.Add("msg", "OK");
                    }
                }
            }
            return(msg.ToString());
        }