コード例 #1
0
ファイル: WorkerPanelViewModel.cs プロジェクト: mkwie/mobRepo
        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);

        }
コード例 #2
0
ファイル: CarEditViewModel.cs プロジェクト: mkwie/mobRepo
        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();
        }
コード例 #3
0
ファイル: CarAddViewModel.cs プロジェクト: mkwie/mobRepo
        private async void Accept()
        {
            Validate();
            if (validationErrors.Count == 0)
            {
                var c = new CarDTO();
                c.stationId = Station.Id;
                c.brand = SelectedBrand;
                c.colour = Colour;
                c.isEfficient = IsEfficient;
                c.model = Model;
                c.price = Price;
                c.productionDate = ProductionDate;
                c.frenchId = SelectedModel.recordid;

                var service = new CarDTOService(w.login, w.password);
                await service.Post(c);

                var msg = new FireRefresh();
                Messenger.Default.Send<FireRefresh>(msg);
                Exit();
            }
        }