示例#1
0
        public void Loadlist()
        {
            try
            {
                int sotin = (_typecat == 0 ? lnews.Getsotin(_Catid) : 100);
                var list  = lnews.Load_listnews(_Catid);
                if (list.Count > 0)
                {
                    if (_page != 0)
                    {
                        Rplistnews.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                        Rplistnews.DataBind();
                    }
                    else
                    {
                        Rplistnews.DataSource = list.Take(sotin);
                        Rplistnews.DataBind();
                    }

                    ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, 0, "", _page, 1);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public void Load_list()
        {
            try
            {
                int _sotin = 25;

                if (_txt == "Nhập từ khóa tìm kiếm…")
                {
                    _txt = "";
                }
                else
                {
                    if (!_txt.Contains("%"))
                    {
                        _txt = "%" + _txt + "%";
                    }
                }
                var _vNews = search.Load_search_result(_txt, -1);
                if (_vNews.ToList().Count > 0)
                {
                    if (_page != 0)
                    {
                        Rplistnews.DataSource = _vNews.Skip(_sotin * _page - _sotin).Take(_sotin);
                        Rplistnews.DataBind();
                    }
                    else
                    {
                        Rplistnews.DataSource = _vNews.Take(_sotin);
                        Rplistnews.DataBind();
                    }
                    ltrPage.Text = change.result(_vNews.ToList().Count, _sotin, _txt, 0, _page, 2);
                }
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }