Exemple #1
0
        public void Loadlist()
        {
            try
            {
                int sotin = list_pro.Getsotin(_Catid);
                var list  = list_pro.Load_listpro(_Catid);
                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();
                    }

                    ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, 0, _page, 1);
                }
                else
                {
                    lblMsg.Text = "Nội dung đang được cập nhật!";
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void Loadlist()
        {
            try
            {
                int sotin = list_pro.Getsotin(_Catid);
                if (sotin == 0)
                {
                    sotin = 20;
                }
                var list = list_pro.Load_listpro(_Catid, _idhangsx, _pricetype, _price, _sortvl);
                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();
                    }

                    ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, _page, 1, 10);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 public void Loadlist()
 {
     try
     {
         int sotin = list_pro.Getsotin(_Catid);
         if (sotin == 0)
         {
             sotin = 20;
         }
         var list = list_pro.loadCatepro(_Catid);
         if (list.Count > 0)
         {
             if (_page != 0)
             {
                 Re_Cat_Index.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                 Re_Cat_Index.DataBind();
             }
             else
             {
                 Re_Cat_Index.DataSource = list.Take(sotin);
                 Re_Cat_Index.DataBind();
             }
             Page.Visible = true;
             ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, _page, 1, 10);
         }
         else
         {
             Page.Visible = false;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #4
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;
            }
        }