Exemplo n.º 1
0
        private void BindGridNews()
        {
            var pageindex = 1;

            drpPageNum.Items.Clear();
            drpPageNum.Items.Add(new ListItem("1"));
            if (!string.IsNullOrEmpty(Request.QueryString["page"]) && int.Parse(Request.QueryString["page"]) > 1)
            {
                pageindex = int.Parse(Request.QueryString["page"]);
            }
            int totalRow;
            var dtsNews   = ServiceFactory.GetInstancePrice().GetList(pageindex - 1, _pageSize, out totalRow, int.Parse(drpCate.SelectedItem.Value));
            var totalPage = totalRow % _pageSize == 0 ? totalRow / _pageSize : (totalRow / _pageSize) + 1;

            if (totalPage > 1)
            {
                for (int i = 2; i <= totalPage; i++)
                {
                    drpPageNum.Items.Add(i.ToString());
                }
            }
            drpPageNum.DataBind();
            GridNews.DataSource = dtsNews;
            GridNews.DataBind();
        }
 void BindGrid()
 {
     GridNews.DataSource = CMSActivieies.GetSubProducts();
     GridNews.DataBind();
 }
Exemplo n.º 3
0
 void BindGrid()
 {
     GridNews.DataSource = DBAccess.GetProducts();
     GridNews.DataBind();
 }