Exemplo n.º 1
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        private void bindData()
        {
            //每页显示像素
            int myPageSize = 10;

            DoCookie.doCook("myPageSize", myPageSize.ToString());
            string keyword = tbSearch.Text.ToString();
            int    start   = (page_index - 1) * myPageSize;

            if (Session["escount"] != null)
            {
                count = (int)Session["escount"];
            }
            if (count >= 760)
            {
                pager.Page_Count = "760";
            }
            else
            {
                pager.Page_Count = count.ToString();
            }
            lbCount.Text    = ThousandPoints.tPoints(count);
            pager.Text_Type = "CN";
            pager.Get_URL();

            //INewsBaseService inbs = new NewsBaseService();
            List <NewsBase> list = inbs.GetList(keyword, start, myPageSize);

            RpNews.DataSource = list;
            RpNews.DataBind();
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "myscript", "<script>shownews()</script>");
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "myscript", "<script>hei()</script>");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 清空list
        /// </summary>
        private void nullDate()
        {
            List <NewsBase> list = new List <NewsBase>();

            RpNews.DataSource = list;
            RpNews.DataBind();
        }
Exemplo n.º 3
0
        private void BindData(string strClass)
        {
            int DataCount = 0;
            int NowPage   = 1;
            int AllPage   = 0;
            int PageSize  = Convert.ToInt32(HPageSize.Value);

            switch (strClass)
            {
            case "next":
                NowPage = Convert.ToInt32(HNowPage.Value) + 1;
                break;

            case "up":
                NowPage = Convert.ToInt32(HNowPage.Value) - 1;
                break;

            case "end":
                NowPage = Convert.ToInt32(HAllPage.Value);
                break;

            default:
                break;
            }
            DataTable dsLog = BLL.bllNews.GetNews(NowPage, PageSize, out AllPage, out DataCount, HWhere.Value);

            if (dsLog.Rows.Count == 0 || AllPage == 1)
            {
                LBEnd.Enabled  = false;
                LBHome.Enabled = false;
                LBNext.Enabled = false;
                LBUp.Enabled   = false;
            }
            else if (NowPage == 1)
            {
                LBHome.Enabled = false;
                LBUp.Enabled   = false;
                LBNext.Enabled = true;
                LBEnd.Enabled  = true;
            }
            else if (NowPage == AllPage)
            {
                LBHome.Enabled = true;
                LBUp.Enabled   = true;
                LBNext.Enabled = false;
                LBEnd.Enabled  = false;
            }
            else
            {
                LBEnd.Enabled  = true;
                LBHome.Enabled = true;
                LBNext.Enabled = true;
                LBUp.Enabled   = true;
            }
            RpNews.DataSource = dsLog;
            RpNews.DataBind();
            PageMes.Text   = string.Format("[每页<font color=green>{0}</font>条 第<font color=red>{1}</font>页/共<font color=green>{2}</font>页   共<font color=green>{3}</font>条]", PageSize, NowPage, AllPage, DataCount);
            HNowPage.Value = Convert.ToString(NowPage++);
            HAllPage.Value = AllPage.ToString();
        }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Users"] != null)
     {
         users = (Users)Session["Users"];
     }
     else
     {
         users = null;
         Response.Write("<script>parent.window.location.href='Login.aspx'</script>");
     }
     if (!IsPostBack)
     {
         txtUserName.Value = users.U_Name.Trim();
         if (Request.QueryString["id"] != null)
         {
             Live live = LiveBLL.GetIdByLive(Convert.ToInt32(Request.QueryString["id"]));
             if (live != null && live.L_Id != 0)
             {
                 txtNo.Value       = live.L_No.Trim();
                 RpNews.DataSource = ConsumptionBLL.AllData(" and L_Id=" + live.L_Id + " order by C_Time desc");
                 RpNews.DataBind();
             }
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 清空list
        /// </summary>
        private void nullDate()
        {
            List <NewsBase> list = new List <NewsBase>();

            RpNews.DataSource = list;
            RpNews.DataBind();
            //List<Member> mlist = new List<Member>();
            //RpCRM.DataSource = mlist;
            //RpCRM.DataBind();
            //List<URLName> ulist = new List<URLName>();
            //RpUrlName.DataSource = ulist;
            //RpUrlName.DataBind();
        }
Exemplo n.º 6
0
 protected void Bind()
 {
     RpNews.DataSource = nBLL.GetDataByIdAndLid(id, 1);
     RpNews.DataBind();
 }