Beispiel #1
0
        public PG <Contact> GetQueryPaging(Contact_filter paging = null, Expression <Func <Contact, bool> > where = null)
        {
            IQueryable <Contact> query;

            //PHÂN QUYỀN ĐỒ
            query = base.GetList(where);
            if (paging.contactstatusid != -1)
            {
                query = query.Where(w => w.ContactStatusId == paging.contactstatusid);
            }

            //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 <Contact>(query)).GetPG(paging));
        }
Beispiel #2
0
        public PartialViewResult ajax_paging(Contact_filter paging)
        {
            PG <Contact> vmpg;

            vmpg = _contactRepo.GetQueryPaging(paging);
            return(PartialView(vmpg));
        }