Exemple #1
0
        /// <summary>
        /// 获取在线咨询列表信息
        /// </summary>
        /// <returns></returns>
        private Hashtable GetQaList(HttpContext context)
        {
            Hashtable htRet   = new Hashtable();
            Hashtable rowData = new Hashtable();

            try
            {
                int    iLimit   = CConvert.ToInt32(context.Request["limit"]);
                int    iPage    = CConvert.ToInt32(context.Request["page"]);
                string sContent = CConvert.ToString(context.Request["sname"]);
                string sAll     = CConvert.ToString(context.Request["all"]);

                int     allRows = 0;
                DBIndex dbm     = new DBIndex();
                DataSet ds      = dbm.GetQAList(sAll, sContent, iPage, iLimit, ref allRows);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    htRet["ok"]  = true;
                    htRet["cnt"] = 0;
                    htRet["msg"] = "无数据!";
                }
                else
                {
                    ArrayList lst = new ArrayList();
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        Hashtable htItem = new Hashtable();

                        htItem["nickname"]  = CConvert.ToString(dr["nickname"]);
                        htItem["problem"]   = (CConvert.ToString(dr["problem"]));
                        htItem["time"]      = CConvert.ToString(dr["time"]);
                        htItem["id"]        = CConvert.ToString(dr["id"]);
                        htItem["state"]     = CConvert.ToString(dr["state"]);
                        htItem["reply"]     = (CConvert.ToString(dr["reply"]));
                        htItem["replytime"] = CConvert.ToString(dr["replytime"]);

                        lst.Add(htItem);
                    }

                    htRet["ok"]      = true;
                    htRet["lst"]     = lst;
                    htRet["cnt"]     = allRows;
                    htRet["curpage"] = iPage;
                }
            }
            catch (Exception ex)
            {
                htRet["err"] = true;
                htRet["msg"] = "获取轮播信息失败!" + ex.Message;
            }
            return(htRet);
        }