private void filteringDataToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FilteringData frmFilterData = new FilteringData();

            frmFilterData.MdiParent = this;
            frmFilterData.Show();
        }
Exemple #2
0
        public async Task <List <Product> > GetProducts(FilteringData filteringData)
        {
            bool orderDesc = SetSorting(filteringData.Sort);

            SetFiltering(filteringData);

            return(await sortFilterService.Search(orderDesc, filteringData.Skip, filteringData.Take));
        }
Exemple #3
0
        public async Task <List <Order> > GetOrders(FilteringData filteringData)
        {
            bool orderDesc = true;

            SetSorting();

            SetFiltering(filteringData);

            return(await sortFilterService.Search(orderDesc));
        }
Exemple #4
0
 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
     };
 }
Exemple #5
0
 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
     };
 }
Exemple #6
0
        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);
            }
        }
Exemple #7
0
        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);
            }
        }
Exemple #8
0
        // 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)));
        }
Exemple #9
0
 public GetProductsQuery(FilteringData filteringData)
 {
     FilteringData = filteringData;
 }
Exemple #10
0
 public async Task <IActionResult> GetOrders([FromQuery] FilteringData filteringData)
 {
     return(Ok(await mediator.Send(new GetOrdersQuery(filteringData))));
 }
 public GetOrdersQuery(FilteringData filteringData)
 {
     FilteringData = filteringData;
 }