private void BindData() { List <OrderData> data = null; if (!string.IsNullOrEmpty(Tel)) { if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["page"])) { //缓存取数据 data = Session["OrderInfoListForHB_AjaxList_" + Keyid] as List <OrderData>; } if (data == null) { //查询数据 BLL.OrderInfoListForHB server = new BLL.OrderInfoListForHB(); data = server.QueryOrderInfo(Tel, null, null, 10000); //缓存 Session["OrderInfoListForHB_AjaxList_" + Keyid] = data; } } if (data != null) { PageSize = 10; litPagerDown.Visible = true; //分页 int start = (PageCommon.Instance.PageIndex - 1) * PageSize; int end = PageCommon.Instance.PageIndex * PageSize - 1; List <OrderData> result = Pages(data, start, end); OrderDataList.DataSource = result; OrderDataList.DataBind(); RecordCount = data.Count; litPagerDown.Text = PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, PageCommon.Instance.PageIndex, 1010); } else { OrderDataList.DataSource = null; OrderDataList.DataBind(); litPagerDown.Text = ""; } }
private void BindData() { List <OrderData> data = null; if (!string.IsNullOrEmpty(Tel)) { if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["page"])) { //缓存取数据 data = Session["OrderInfoListForHB_AjaxList_" + Keyid] as List <OrderData>; } if (data == null) { //查询数据 BLL.OrderInfoListForHB server = new BLL.OrderInfoListForHB(); data = server.QueryOrderInfo(Tel, null, null, 50); //缓存 Session["OrderInfoListForHB_AjaxList_" + Keyid] = data; } } if (data != null) { PageSize = 50; //分页 int start = (PageCommon.Instance.PageIndex - 1) * PageSize; int end = PageCommon.Instance.PageIndex * PageSize - 1; List <OrderData> result = Pages(data, start, end); OrderDataList.DataSource = result; OrderDataList.DataBind(); RecordCount = data.Count; } else { OrderDataList.DataSource = null; OrderDataList.DataBind(); } }