private async void GetStations() { //using (var entities = new MobilekEntities()) { var service = new Mobilek.Services.StationDTOService(w.userName,w.password); var stations = await service.Get(); var stationList = stations.AsEnumerable(); //var stationList = entities.Stations.AsEnumerable(); if (!string.IsNullOrEmpty(_order_city)) { stationList = stationList.Where(s => s.city.StartsWith(_order_city)); } if (!string.IsNullOrEmpty(_order_street)) { stationList = stationList.Where(s => s.street.StartsWith(_order_street)); } if (!string.IsNullOrEmpty(_order_streetNumber)) { stationList = stationList.Where(s => s.streetNumer.Equals(_order_streetNumber)); } if (!string.IsNullOrEmpty(_order_zipCode)) { stationList = stationList.Where(s => s.zipCode.StartsWith(_order_zipCode)); } StationCollection = ToObservableCollectioncs.ToObservableCollection<StationDTO>(stationList); } }
private async void Accept() { Validate(); if (validationErrors.Count == 0) { int no; if (Int32.TryParse(StreetNo, out no)) { var sDTO = new StationDTO(); sDTO.streetNumer = no; sDTO.city = City; sDTO.street = Street; sDTO.zipCode = zipCode; var service = new Mobilek.Services.StationDTOService(w.login,w.password); await service.Post(sDTO); } var msg = new FireRefresh(); Messenger.Default.Send<FireRefresh>(msg); Exit(); } }