protected void GetOrderinfo() { string UserName = buser.GetLogin().UserName; #region 获取页数 int CPage; int temppage; if (Request.Form["DropDownList3"] != null) { temppage = Convert.ToInt32(Request.Form["DropDownList3"]); } else { temppage = Convert.ToInt32(Request.QueryString["CurrentPage"]); } CPage = temppage; if (CPage <= 0) { CPage = 1; } #endregion this.Label1.Text = "我的订单列表"; DataTable olist = oll.GetUserlist(UserName, 0, 3); EGV1.DataSource = olist; EGV1.DataBind(); //PagedDataSource cc = new PagedDataSource(); //if (olist != null && olist.Rows.Count > 0) //{ // cc.DataSource = olist.DefaultView; // cc.AllowPaging = true; // if (Request.QueryString["txtPage"] != null && Request.QueryString["txtPage"] != "") // { // cc.PageSize = DataConverter.CLng(Request.QueryString["txtPage"]); // } // if (Request.Form["txtPage"] != null && Request.Form["txtPage"] != "") // { // cc.PageSize = DataConverter.CLng(Request.Form["txtPage"]); // } // if (olist != null && cc.PageSize >= olist.Rows.Count) // { // cc.CurrentPageIndex = 0; // CPage = 1; // } // cc.CurrentPageIndex = CPage - 1; //int thispagenull = cc.PageCount;//总页数 //int CurrentPage = cc.CurrentPageIndex; //int nextpagenum = CPage - 1;//上一页 //int downpagenum = CPage + 1;//下一页 //int Endpagenum = thispagenull; //if (thispagenull <= CPage) //{ // downpagenum = thispagenull; //} //if (nextpagenum <= 0) //{ // nextpagenum = 0; //} // Label2.Text = olist.DefaultView.Count.ToString(); // int thispagenull3 = cc.PageCount;//总页数 // int CurrentPage3 = cc.CurrentPageIndex; // int nextpagenum3 = CPage - 1;//上一页 // int downpagenum3 = CPage + 1;//下一页 // int Endpagenum3 = thispagenull; // if (thispagenull <= CPage) // { // downpagenum = thispagenull; // } // if (nextpagenum <= 0) // { // nextpagenum = 0; // } // Label3.Text = "<a href=?menu=Orderinfo&Currentpage=0" + "&txtPage=" + cc.PageSize + ">首页</a>"; // if (Label4.Enabled) // { // this.Label4.Text = "<a href=?menu=Orderinfo&Currentpage=" + nextpagenum.ToString() + "&txtPage=" + cc.PageSize + ">上一页</a>"; // } // else // { // this.Label4.Text = "上一页"; // } // if (Label5.Enabled) // { // this.Label5.Text = "<a href=?menu=Orderinfo&Currentpage=" + downpagenum.ToString() + "&txtPage=" + cc.PageSize + ">下一页</a>"; // } // else // { // this.Label5.Text = "下一页"; // } // Label6.Text = "<a href=?menu=Orderinfo&Currentpage=" + Endpagenum.ToString() + "&txtPage=" + cc.PageSize + ">尾页</a>"; // Label7.Text = thispagenull.ToString(); // Label8.Text = CPage.ToString(); // txtPage.Text = cc.PageSize.ToString(); // DropDownList3.Items.Clear(); // for (int i = 1; i <= thispagenull; i++) // { // this.DropDownList3.Items.Add(i.ToString()); // } // for (int j = 0; j < DropDownList3.Items.Count; j++) // { // if (DropDownList3.Items[j].Value == Label8.Text) // { // DropDownList3.SelectedValue = Label8.Text; // break; // } // } }
private void DataBind1(string keys = "") { EGV1.DataSource = proBll.GetProByProClass(M_Product.ClassType.IDC); EGV1.DataBind(); }