public OrderListSearchCriteria WithStatus(OrderStatus status) { OrderListSearchCriteria another = this.Clone <OrderListSearchCriteria>(); another.Status = status; // need to reset page index another.PageIndex = 1; return(another); }
public OrderListQueryBuilder(OrderListSearchCriteria criteria) : base(criteria) { if (criteria.UserId.HasValue) { _user = _daoTemplate.FindByID <User>(criteria.UserId); } if (criteria.Status.HasValue) { status = criteria.Status.Value; } }
public ActionResult List(OrderListSearchCriteria criteria) { var queryBuilder = new OrderListQueryBuilder(criteria); var result = queryBuilder.Execute(daoTemplate.Session); return View(result); }