Example #1
0
        /// <summary>
        /// 获取新闻详情
        /// </summary>
        /// <returns></returns>
        private Hashtable GetArchiveDetail(HttpContext context)
        {
            Hashtable htRet   = new Hashtable();
            Hashtable rowData = new Hashtable();

            try
            {
                string sID = CConvert.ToString(context.Request["id"]);

                DBIndex dbm = new DBIndex();
                DataSet ds  = dbm.GetAchievementById(sID);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    htRet["ok"]  = true;
                    htRet["cnt"] = 0;
                    htRet["msg"] = "无数据!";
                }
                else
                {
                    ArrayList lst    = new ArrayList();
                    DataRow   dr     = ds.Tables[0].Rows[0];
                    Hashtable htItem = new Hashtable();

                    htItem["id"]      = CConvert.ToString(dr["id"]);
                    htItem["title"]   = CConvert.ToString(dr["title"]);
                    htItem["time"]    = CConvert.ToString(dr["time"]);
                    htItem["content"] = System.Web.HttpUtility.HtmlDecode(CConvert.ToString(dr["content"]));
                    htItem["bigimg"]  = CConvert.ToString(dr["bigimg"]);
                    htItem["img"]     = CConvert.ToString(dr["img"]);


                    htRet["ok"]   = true;
                    htRet["data"] = htItem;
                }
            }
            catch (Exception ex)
            {
                htRet["err"] = true;
                htRet["msg"] = "获取新闻详情失败!" + ex.Message;
            }
            return(htRet);
        }