Ejemplo n.º 1
0
        private async void Accept()
        {
            var service = new Mobilek.Services.CarDTOService(w.login,w.password);
            var c = await service.Get(Id);

            c.stationId = Station.Id;
            c.brand = Brand;
            c.colour = Colour;
            c.isEfficient = IsEfficient;
            c.model = Model;
            c.price = Price;
            c.productionDate = ProductionDate;

            await service.Put(c);

            var msg = new FireRefresh();
            Messenger.Default.Send<FireRefresh>(msg);
            Exit();
        }
Ejemplo n.º 2
0
        private async void GetCars()
            {
            var service = new CarDTOService(w.login, w.password);
            var carss = await service.Get();
            var cars = carss.AsEnumerable();
            
                if (!string.IsNullOrWhiteSpace(SearchModel))
                {
                    cars = cars.Where(s => s.model.StartsWith(SearchModel));
                }
                if (!string.IsNullOrWhiteSpace(SearchBrand))
                {
                    cars = cars.Where(s => s.brand.StartsWith(SearchBrand));
                }
                if (!string.IsNullOrWhiteSpace(SearchColour))
                {
                    cars = cars.Where(s => s.colour.StartsWith(SearchColour));
                }
                cars = cars.Where(s => s.productionDate > SearchProductionDate);

            if (!ShowUnavailable)
                {
                    cars = cars.Where(s => s.isEfficient == true);
                }
                
                cars = cars.Where(s => s.price < SearchPrice);
            CarsCollection = ToObservableCollectioncs.ToObservableCollection<CarDTO>(cars);

        }