Exemple #1
0
        public PG <Article> GetQueryPaging(article_sp paging = null, Expression <Func <Article, bool> > where = null)
        {
            IQueryable <Article> query;

            //PHÂN QUYỀN ĐỒ
            query = GetList(where);

            if (paging.catid != -1)
            {
                query = query.Where(w => w.CategoryId == paging.catid);
            }

            //SORTING
            query = query.OrderByField(paging.tentruongsort, paging.giatrisort == "asc");
            //FILTERING
            if (paging.bolocs != null)
            {
                foreach (var loc in paging.bolocs)
                {
                    //if (loc.tentruongloc.Equals("Username"))
                    //{
                    //    boloc loc1 = loc;
                    //    // query = query.Where(q => q.Username.Contains(loc1.giatriloc));
                    //}
                }
            }
            return((new PGQuery <Article>(query)).GetPG(paging));
        }
Exemple #2
0
        public PartialViewResult ajax_paging(article_sp paging)
        {
            PG <Article> vmpg;

            vmpg = _ArticleServ.GetQueryPaging(paging);
            var tim = __db.Settings.Find(1);

            ViewBag.AboutUsMainId = tim.AboutUsMainId;
            return(PartialView(vmpg));
        }