Exemplo n.º 1
0
        public void SearchData(int pageIndex)
        {
            List <IDataItem> list    = new List <IDataItem>();
            int       allRecordCount = 0;
            DataTable dt             = BLL.RetrieveDxjb_List(list, pageSize, pageIndex, out allRecordCount).Result;

            this.dlDxjbxx.DataSource = dt;
            this.dlDxjbxx.DataBind();
            int pageCount = 0;

            if (allRecordCount % pageSize == 0)
            {
                pageCount = allRecordCount / pageSize;
            }
            else
            {
                pageCount = allRecordCount / pageSize + 1;
            }

            ViewState["pageCount"] = pageCount;
            ViewState["allCount"]  = allRecordCount;

            if (pageCount == 0)
            {
                ViewState["pageIndex"] = 0;
                this.lblPageIndex.Text = "0";
                NoPageHandler();
            }
            else
            if (pageIndex == pageCount - 1 && pageIndex == 0)
            {
                ViewState["pageIndex"] = 0;
                this.lblPageIndex.Text = "0";
                OnePageHandler();
            }
            else
            if (pageIndex <= 0)
            {
                ViewState["pageIndex"] = 0;
                this.lblPageIndex.Text = "0";
                FirstPageHandler(pageCount);
            }
            else
            if (pageIndex >= pageCount - 1)
            {
                ViewState["pageIndex"] = pageCount - 1;
                this.lblPageIndex.Text = (pageCount - 1).ToString();
                LastPageHandler(pageCount);
            }
            else
            {
                ViewState["pageIndex"] = pageIndex;
                this.lblPageIndex.Text = pageIndex.ToString();
                OtherPageHandler(pageIndex, pageCount);
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL = new ZlctBLL(this.WorkUser);
     if (!this.IsPostBack)
     {
         Src = "Txl_Tree.aspx?type=dxjb&dxjbId=";
         List <IDataItem> list = new List <IDataItem>();
         DataTable        dt   = BLL.RetrieveDxjb_List(list).Result;
         if (dt.Rows.Count > 0)
         {
             this.ddl_yzjb.Items.Add(new ListItem("--请选择短信简报模板--", ""));
             foreach (DataRow item in dt.Rows)
             {
                 ListItem li = new ListItem(item["Jbmc"].ToString2(), item["DxjbId"].ToString2());
                 this.ddl_yzjb.Items.Add(li);
             }
         }
         else
         {
             this.ddl_yzjb.Items.Add(new ListItem("--没有短信简报模板--", ""));
         }
     }
 }