public object Search2(OrderSearchInfo info) { info.CheckPagingInfoState(); List<Order> list = BllFactory.GetOrderBLL().Search(info); var result = new GridResult<Order>(list, info.RecCount); return new JsonResult(result); }
public object Search(OrderSearchInfo info, int? page) { info.PageIndex = page.HasValue ? page.Value - 1 : 0; info.PageSize = AppHelper.DefaultPageSize; OrderListModel data = new OrderListModel(); // 搜索数据库 data.List = BllFactory.GetOrderBLL().Search(info); data.SearchInfo = info; return new UcResult("/Controls/Style1/OrderList.ascx", data); }
// 根据指定的查询日期范围及分页参数,获取订单记录列表 public List<Order> Search(OrderSearchInfo option) { option.EndDate = option.EndDate.AddDays(1); var query = from ord in WebSiteDB.MyNorthwind.Orders.AsQueryable() where ord.OrderDate >= option.StartDate && ord.OrderDate < option.EndDate orderby ord.OrderDate descending select ord; // 获取订单列表,此时将返回符合分页的结果。 return query.GetPagingList<Order>(option); }