Esempio n. 1
0
        //無搜尋值的搜尋方法
        public IQueryable <Guestbooks> GetAllDataList(ForPaging Paging)
        {
            IQueryable <Guestbooks> Data = db.Guestbooks;

            Paging.MaxPage = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(Data.Count()) / Paging.ItemNum));
            Paging.SetRightPage();
            return(Data);
        }
Esempio n. 2
0
        //包含搜尋值的方法
        public IQueryable <Guestbooks> GetAllDataList(ForPaging Paging, string Search)
        {
            IQueryable <Guestbooks> Data = db.Guestbooks.Where(p => p.Acount.Contains(Search) ||
                                                               p.Contents.Contains(Search) || p.Reply.Contains(Search));

            Paging.SetRightPage();

            return(Data);
        }