Example #1
0
        private async void GetStations(CarDTO c)
        {
            var service = new StationDTOService(w.login,w.password);
            var stationss = await service.Get();
            var stations = stationss.AsEnumerable();

            StationsCollection = ToObservableCollectioncs.ToObservableCollection<StationDTO>(stations);

            var single = await service.Get(c.stationId);
            Station = single;
        }
Example #2
0
        private async void GetStations()
        {
            var service = new StationDTOService(w.login, w.password);
            var stationss = await service.Get();
            var stations = stationss.AsEnumerable();

                if (!string.IsNullOrWhiteSpace(_searchStreet))
                {
                    stations = stations.Where(s => s.street.StartsWith(_searchStreet));
                }
                if (!string.IsNullOrWhiteSpace(_searchStreetNo))
                {
                    int no;
                    if (Int32.TryParse(_searchStreetNo, out no))
                    {
                        stations = stations.Where(s => s.streetNumer == no);
                    }
                }
                if (!string.IsNullOrWhiteSpace(_searchCity))
                {
                    stations = stations.Where(s => s.city.StartsWith(_searchCity));
                }
                if (!string.IsNullOrWhiteSpace(_searchZipCode))
                {
                    stations = stations.Where(s => s.zipCode.StartsWith(_searchZipCode));
                }
            StationsCollection = ToObservableCollectioncs.ToObservableCollection<StationDTO>(stations);
        }
Example #3
0
        private async void DeleteStation()
        {
            if (SelectedStation != null)
            {                  
                var service = new StationDTOService(w.login,w.password);
                var toRemove = await service.Get(SelectedStation.Id);

                await service.Delete(toRemove.Id);
                GetStations();
            }
        }
Example #4
0
 public void EntitiesEddit(int ID, string _city, string _street, string _zipCode, string _streetNo)
 {
     {
         var service = new Mobilek.Services.StationDTOService(w.login,w.password);
         var toEdit = service.Get(ID).Result;
         int no;
         if (Int32.TryParse(_streetNo, out no))
         {
             toEdit.streetNumer = no;
             toEdit.city = _city;
             toEdit.street = _street;
             toEdit.zipCode = _zipCode;
         }
         service.Post(toEdit);
     }
 }
Example #5
0
        private async void Accept()
        {
            int no;
            if (Int32.TryParse(StreetNo, out no))
            {
                StationDTO toUpdate = new StationDTO()
                {
                    Id = selected.Id,
                    city = City,
                    street = Street,
                    zipCode = ZipCode,
                    streetNumer = no
                };
                var service = new StationDTOService(w.login,w.password);
                await service.Put(toUpdate);
                
            }

            var msg = new FireRefresh();
            Messenger.Default.Send<FireRefresh>(msg);
            Exit();
        }
Example #6
0
        private async void GetStations()
        {
            var service = new StationDTOService(w.login,w.password);
            var stationss = Task.Run(() =>  service.Get()).Result;
            var stations = stationss.AsEnumerable();

            StationsCollection = ToObservableCollectioncs.ToObservableCollection<StationDTO>(stations);
        }