Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string types     = context.Request["types"];
            string pageindex = context.Request["pageno"];
            string orderstr  = "";
            string wherestr  = "";

            if (types == "share")
            {
                DataTable dt     = DryShare.GetPageDataTable(orderstr, wherestr, int.Parse(pageindex), 6, out pagecount, out recordcount);
                string    result = "";
                result = JsonConvert.SerializeObject(dt, new DataTableConverter());
                result = "{\"dataList\":" + result + ",\"num\":{\"Pagecount\":\"" + pagecount + "\"}}";
                context.Response.Write(result);
                context.Response.End();
            }
            else
            {
                DataTable dt     = News.GetPageDataTable(orderstr, wherestr, int.Parse(pageindex), 6, out pagecount, out recordcount);
                string    result = "";
                result = JsonConvert.SerializeObject(dt, new DataTableConverter());
                result = "{\"dataList\":" + result + ",\"num\":{\"Pagecount\":\"" + pagecount + "\"}}";
                context.Response.Write(result);
                context.Response.End();
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            shareList.DataSource = DryShare.GetPageDataTable("", "", 1, 6, out pagecount, out recordcount);
            shareList.DataBind();

            newsList.DataSource = News.GetPageDataTable("", "", 1, 6, out pagecount, out recordcount);
            newsList.DataBind();
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["shareId"] != null)
            {
                if (!Request.Cookies["shareId"].Value.Contains(Request["id"] + ",") && !Request.Cookies["shareId"].Value.Contains("," + Request["id"]))
                {
                    //Response.Cookies["shareId"].Value = Request.Cookies["shareId"].Value + "," + Request["id"];
                    HttpCookie hc  = new HttpCookie("shareId", Request.Cookies["shareId"].Value + "," + Request["id"]);
                    string     url = HttpContext.Current.Request.Url.Host;
                    hc.Domain  = "." + url;
                    hc.Expires = DateTime.Now.AddDays(30);
                    Response.AppendCookie(hc);
                }
            }
            else
            {
                HttpCookie hc  = new HttpCookie("shareId", Request["id"]);
                string     url = HttpContext.Current.Request.Url.Host;
                hc.Domain  = "." + url;
                hc.Expires = DateTime.Now.AddDays(30);
                Response.AppendCookie(hc);
            }

            //if (Cache["shareId"] != null)
            //{
            //    if(!Cache["shareId"].ToString().Contains(Request["id"] + ",") && !Cache["shareId"].ToString().Contains("," + Request["id"]))
            //    {
            //        Cache["shareId"] = Request["id"] + "," + Cache["shareId"];
            //    }
            //} else
            //{
            //    Cache["shareId"] = Request["id"];
            //}
            shareList.DataSource = DryShare.GetDataTable(3, Request.Cookies["shareId"].Value);
            shareList.DataBind();
            ds = DryShare.Get_DryShare(int.Parse(Request["id"]));
            DataTable prev = DryShare.GetLastNextData("last", int.Parse(Request["id"]));

            if (prev.Rows.Count <= 0)
            {
                prevId = "<a href=\" javascript:void(0)\" class=\"detail-btn l\">< 上一篇</a>";
            }
            else
            {
                prevId = "<a href=\" /sharedetail/" + prev.Rows[0]["Id"] + ".html\" class=\"detail-btn l\">< 上一篇</a>";
            }
            DataTable next = DryShare.GetLastNextData("next", int.Parse(Request["id"]));

            if (next.Rows.Count <= 0)
            {
                nextId = "<a href=\" javascript:void(0)\" class=\"detail-btn r\">下一篇 ></a>";
            }
            else
            {
                nextId = "<a href=\" /sharedetail/" + next.Rows[0]["Id"] + ".html\" class=\"detail-btn r\">下一篇 ></a>";
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            caseList.DataSource = CustomerCase.GetRecommendDataTable(8);
            caseList.DataBind();

            shareList.DataSource = DryShare.GetRecommendDataTable(2);
            shareList.DataBind();

            newsList.DataSource = News.GetDataTable(10000);
            newsList.DataBind();
        }