示例#1
0
        public List <DL.Inventory> getAllInventory(page page)
        {
            var inventoryList = from i in db.Inventories select i;

            page.setTotalNumber(inventoryList.Count());
            int skipInx = page.getCurrentPage() * page.getPageVolumn();
            var query   = inventoryList.OrderBy(l => l.inventoryCode).Skip(skipInx).Take(page.getPageVolumn());

            return(query.ToList());
        }
示例#2
0
        public List <DL.Inventory> getInventoryByCategory(string cid, page page)
        {
            int id            = Convert.ToInt32(cid);
            var inventoryList = from i in db.Inventories where i.categoryID == id select i;

            page.setTotalNumber(inventoryList.Count());
            int skipInx = page.getCurrentPage() * page.getPageVolumn();
            var query   = inventoryList.OrderBy(l => l.inventoryCode).Skip(skipInx).Take(page.getPageVolumn());

            return(query.ToList());
        }