예제 #1
0
        public IQueryable <客戶銀行資訊> Query(QueryBankModel model)
        {
            var data = this.All();

            if (!string.IsNullOrEmpty(model.BankName))
            {
                data = data.Where(p => p.帳戶名稱.Contains(model.BankName));
            }

            if (!string.IsNullOrEmpty(model.sort))
            {
                data = data.OrderBy(model.sort + " " + model.sidx);
            }
            else
            {
                data = data.OrderBy(p => p.Id);
            }

            return(data.AsQueryable());
        }
예제 #2
0
        public IPagedList <客戶銀行資訊> Query(QueryBankModel model, int DefaultPage)
        {
            var data = this.Query(model);

            return(data.ToPagedList(model.Page ?? DefaultPage, model.PageSite ?? DefaultPage));
        }