Esempio n. 1
0
        public IQueryable <LOAISANPHAM> GetLOAISANPHAMs()
        {
            var _db = new StudentShop.Models.SANPHAM_CT();
            IQueryable <LOAISANPHAM> query = _db.LOAISANPHAMs;

            return(query);
        }
Esempio n. 2
0
        public IQueryable <SANPHAM> GetSANPHAMs([QueryString("id")] int?categoryId)
        {
            var _db = new StudentShop.Models.SANPHAM_CT();
            IQueryable <SANPHAM> query = _db.SANPHAMs;

            if (categoryId.HasValue && categoryId > 0)
            {
                query = query.Where(p => p.MALOAISP == categoryId);
            }
            return(query);
        }
Esempio n. 3
0
        public IQueryable <SANPHAM> GetDetails([QueryString("bookID")] int?bookId)
        {
            var _db = new StudentShop.Models.SANPHAM_CT();
            IQueryable <SANPHAM> query = _db.SANPHAMs;

            if (bookId.HasValue && bookId > 0)
            {
                query = query.Where(p => p.MASP == bookId);
            }
            else
            {
                query = null;
            }
            return(query);
        }