示例#1
0
        public void Loadlist()
        {
            try
            {
                if (_cat_seo_url.Contains("san-pham-yeu-thich"))
                {
                    Rplistpro.DataSource = list_pro.Load_listproLike(cki.Listcookie_like());
                    Rplistpro.DataBind();
                    return;
                }
                int sotin = list_pro.Getsotin(_Catid);
                if (list_pro.checkHangsx(_Catid))
                {
                    var listhsx = list_pro.loadProhangsx(_Catid, _pricetype, _price, _sortvl, _param);
                    if (listhsx.Count > 0)
                    {
                        if (_page != 0)
                        {
                            Rplistpro.DataSource = listhsx.Skip(sotin * _page - sotin).Take(sotin);
                            Rplistpro.DataBind();
                        }
                        else
                        {
                            Rplistpro.DataSource = listhsx.Take(sotin);
                            Rplistpro.DataBind();
                        }

                        string _listid = _sortvl.ToString();
                        ltrPage.Text = change.resultListproduct(listhsx.Count, sotin, _cat_seo_url, 0, _listid, _price, _pricetype, _param, _page, 1);
                    }
                    return;
                }

                var list = list_pro.Load_listpro(_Catid, _idhangsx, _pricetype, _price, _sortvl, _param);
                if (list.Count > 0)
                {
                    if (_page != 0)
                    {
                        Rplistpro.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                        Rplistpro.DataBind();
                    }
                    else
                    {
                        Rplistpro.DataSource = list.Take(sotin);
                        Rplistpro.DataBind();
                    }

                    string _listid = _sortvl.ToString();
                    ltrPage.Text = change.resultListproduct(list.Count, sotin, _cat_seo_url, 0, _listid, _price, _pricetype, _param, _page, 1);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }