private void filteringDataToolStripMenuItem_Click(object sender, EventArgs e) { FilteringData frmFilterData = new FilteringData(); frmFilterData.MdiParent = this; frmFilterData.Show(); }
public async Task <List <Product> > GetProducts(FilteringData filteringData) { bool orderDesc = SetSorting(filteringData.Sort); SetFiltering(filteringData); return(await sortFilterService.Search(orderDesc, filteringData.Skip, filteringData.Take)); }
public async Task <List <Order> > GetOrders(FilteringData filteringData) { bool orderDesc = true; SetSorting(); SetFiltering(filteringData); return(await sortFilterService.Search(orderDesc)); }
public SearchProductServiceTest() { sortFilterService = new Mock <ISearchSortFilterService <Product, FilteringData> >(); service = new SearchProductsService(sortFilterService.Object); products = new List <Product> { new Product(), new Product() }; filteringData = new FilteringData { Colors = color }; }
public ServicesTest() { sortFilterService = new Mock <ISearchSortFilterService <Order, FilteringData> >(); service = new SearchOrderService(sortFilterService.Object); orders = new List <Order> { new Order(), new Order() }; filteringData = new FilteringData { UserId = userId }; }
private void SetFiltering(FilteringData filteringData) { if (filteringData.OrderStatus != 0) { sortFilterService.SetConcreteFilter(x => x.OrderStatus == filteringData.OrderStatus); } if (filteringData.UserId != null) { sortFilterService.SetConcreteFilter(x => x.UserId == filteringData.UserId); } }
private void SetFiltering(FilteringData filteringData) { if (filteringData.Colors != Colors.All) { sortFilterService.SetConcreteFilter(x => x.Colors == filteringData.Colors); } if (filteringData.BrandId != 0) { sortFilterService.SetConcreteFilter(x => x.BrandId == filteringData.BrandId); } if (filteringData.BikeType != BikeType.All) { sortFilterService.SetConcreteFilter(x => x.BikeType == filteringData.BikeType); } }
// GET: Offers public ActionResult Index() { int?page = null; int value; if (int.TryParse(Request.QueryString["page"], out value)) { page = value; } var tOferta = service.GetOffers(); var filtering = new FilteringData(Request.QueryString, ModelState); tOferta = filtering.Apply(tOferta).OrderBy(i => i.DataWyjazdu); int pageNumber = (page ?? 1); IDictionary <int, bool> offerToReservedMap = service.GetOfferIdToReservedMap(AuthorizeUtil.GetUserId(service, User)); return(View(new OffersViewModel( tOferta.ToPagedList(pageNumber, filtering.ItemsOnPage), filtering, offerToReservedMap))); }
public GetProductsQuery(FilteringData filteringData) { FilteringData = filteringData; }
public async Task <IActionResult> GetOrders([FromQuery] FilteringData filteringData) { return(Ok(await mediator.Send(new GetOrdersQuery(filteringData)))); }
public GetOrdersQuery(FilteringData filteringData) { FilteringData = filteringData; }