private void GetUIDataFromDB() { FlightsViewModel.GetAllCities().ForEach(c => CitiesList.Add(c)); CitiesList.Insert(0, "Not selected"); SelectedCity = CitiesList[0]; FlightsViewModel.GetAllCompanies().ForEach(c => CompaniesList.Add(c.name)); CompaniesList.Insert(0, "Not selected"); SelectedCompany = CompaniesList[0]; SelectTrips(); }
private void OnSearch() { List <City> listaGradova = new List <City>(); City sc = new City(); CitiesList.Clear(); listaGradova = sc.GetSearchDone(Search); foreach (var item in listaGradova) { CitiesList.Add(item); } }
public void OnShowAll() { bool check = true; if (check) { if (Selected == null) { List <City> listaGradova = new List <City>(); CitiesList.Clear(); City c = new City(); listaGradova = c.GetAllCitiesListDone(); foreach (var item in listaGradova) { CitiesList.Add(item); } List <Comment> com = new List <Comment>(); Comment ccc = new Comment(); CommentList.Clear(); com = ccc.GetAllComment(); foreach (var item in com) { CommentList.Add(item); } } else { List <City> listaGradova = new List <City>(); City c = new City(); c.CityName = Selected.CityName; List <Comment> com = new List <Comment>(); Comment ccc = new Comment(); CommentList.Clear(); com = ccc.GetAllCommentSelected(c.CityName.ToString()); foreach (var item in com) { CommentList.Add(item); } Selected = null; } } }
/// <summary> /// Получения списока городов. /// </summary> private void GetData() { citiesList = new ObservableCollection <City>(); response = new InteractionServer(); List <City> lp = response.GetCitiesList(); for (int i = 0; i < lp.Count; i++) { CitiesList.Add(new City { Idcity = lp[i].Idcity, Town = lp[i].Town }); } base.RaisePropertyChangedEvent("CitiesList"); }
public void Add <T>(T model) { var theType = model.GetType().Name; switch (theType) { case "User": UsersList.Add(model as User); return; case "News": NewsesList.Add(model as Dal.Models.News); return; case "Category": CategoriesList.Add(model as Category); return; case "Magazine": MagazinesList.Add(model as Magazine); return; case "SmartLink": SmartLinksList.Add(model as SmartLink); return; case "Comment": CommentsList.Add(model as Comment); return; case "Visit": VisitsList.Add(model as Visit); return; case "NewsLetter": NewsLettersList.Add(model as NewsLetter); return; case "Slider": SlidersList.Add(model as Slider); return; case "Slide": SlidesList.Add(model as Slide); return; case "UserMagazine": UserMagazinesList.Add(model as UserMagazine); return; case "State": StatesList.Add(model as State); return; case "City": CitiesList.Add(model as City); return; case "Media": MediasList.Add(model as Media); return; case "Report": ReportsList.Add(model as Report); return; case "Vote": VotesList.Add(model as Vote); return; case "Advertise": AdvertisesList.Add(model as Advertise); return; case "AdCategory": AdCategoriesList.Add(model as AdCategory); return; case "Galery": GaleriesList.Add(model as Galery); return; case "GaleryImage": GaleryImagesList.Add(model as GaleryImage); return; case "Image": ImagesList.Add(model as Image); return; case "KeyPoint": KeyPointsList.Add(model as KeyPoint); return; case "KeyPointsContainer": KeyPointsContainersList.Add(model as KeyPointsContainer); return; case "Quiz": QuizesList.Add(model as Quiz); return; case "Question": QuestionsList.Add(model as Question); return; case "Answer": AnswersList.Add(model as Answer); return; case "Option": OptionList.Add(model as Option); return; case "ItemList": ItemsListList.Add(model as ItemList); return; default: throw new Exception("The type " + theType + " is not supported."); } }