private void RefreshingListItems() { foreach (Tour item in this.itemFactory.GetItems()) { Tours.Add(item); } }
//if (destinationPurpose == Global.Settings.Purposes.Work) { // SimulatedWorkStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.School) { // SimulatedSchoolStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Escort) { // SimulatedEscortStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.PersonalBusiness) { // SimulatedPersonalBusinessStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Shopping) { // SimulatedShoppingStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Meal) { // SimulatedMealStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Social) { // SimulatedSocialStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Recreation) { // SimulatedRecreationStops++; //} //else if (destinationPurpose == Global.Settings.Purposes.Medical) { // SimulatedMedicalStops++; //} //} public virtual ITourWrapper GetEscortTour(int originAddressType, int originParcelId, int originZoneKey) { var tour = CreateTour(originAddressType, originParcelId, originZoneKey, Global.Settings.Purposes.Escort); _personDay.EscortTours++; Tours.Add(tour); return(tour); }
private void Search(object commandParameter) { IEnumerable foundItems = this.tourItemFactory.Search(SearchName); Tours.Clear(); foreach (TourItem item in foundItems) { Tours.Add(item); } }
public void FillListView() { Tours.Clear(); foreach (TourEntry tour in this.tourPlannerAppFactory.GetTours()) { Tours.Add(tour); Log.Info($"{ tour.Name } Tour has been added to our Tour list."); } Log.Info("Tours are filled with the database data."); }
//Search method: public void Search(object commandParameter) { IEnumerable <TourEntry> foundTours = this.tourPlannerAppFactory.Search(SearchName); Tours.Clear(); SearchName = ""; Log.Info("search method of MainVM is called."); foreach (TourEntry tour in foundTours) { Tours.Add(tour); Log.Info($"{ tour.Name } Tour has been added to our Tour list."); } }
void AddTourCompleted(object sender, AddTourCompletedEventArgs e) { if (e.Error == null) { selectedTour.ID = e.Result; Tours.Add(selectedTour); SelectedTour = selectedTour; } else { ErrorProvider.ShowError(e.Error, Navigator); SelectedTour = null; } dataClient.AddTourCompleted -= AddTourCompleted; Busy = false; }
private void Search(object commandParameter) { if (tours.Count == 0) { MessageBox.Show("No Data Available to search for!"); } else { IEnumerable <Tour> search_outcome = itemFactory.Search(SearchName); Tours.Clear(); foreach (Tour t in search_outcome) { Tours.Add(t); } } }
private void FillListBox() { if (this.tourItemFactory.GetItems() == null) { Tours.Add(new TourItem { Name = "No Tours added yet" }); } else { foreach (TourItem item in this.tourItemFactory.GetItems()) { Tours.Add(item); log.Info("Added Tour called: " + item.Name); } } }
public async Task AddTour() { if (string.IsNullOrWhiteSpace(Name) && string.IsNullOrWhiteSpace(Description) && string.IsNullOrWhiteSpace(RouteInformation) && this.Distance != default) { return; } Tour t = new Tour(this.Name, this.Description, this.RouteInformation, this.Distance); this.Name = string.Empty; this.Description = string.Empty; this.RouteInformation = string.Empty; this.Distance = 0; Tours.Add(t); DataAccess.SaveTour(t); _addTour.Visibility = System.Windows.Visibility.Hidden;//Closing makes the window unusable for reshowing it. }
public virtual ITourWrapper GetNewTour(int originAddressType, int originParcelId, int originZoneKey, int purpose) { var tour = CreateTour(originAddressType, originParcelId, originZoneKey, purpose); Tours.Add(tour); if (purpose == Global.Settings.Purposes.Escort) { _personDay.EscortTours++; } else if (purpose == Global.Settings.Purposes.PersonalBusiness) { _personDay.PersonalBusinessTours++; } else if (purpose == Global.Settings.Purposes.Shopping) { _personDay.ShoppingTours++; } else if (purpose == Global.Settings.Purposes.Meal) { _personDay.MealTours++; } else if (purpose == Global.Settings.Purposes.Social) { _personDay.SocialTours++; } else if (purpose == Global.Settings.Purposes.Recreation) { _personDay.RecreationTours++; } else if (purpose == Global.Settings.Purposes.Medical) { _personDay.MedicalTours++; } return(tour); }
//public static Folder LoadFromXML(XmlNode node) //{ // Folder temp = new Folder(); // temp.ParseXML(node); // return temp; //} private void ParseXML(XmlNode node) { if (node.Attributes.GetNamedItem("Name") != null) { nameField = node.Attributes.GetNamedItem("Name").Value; } else { nameField = ""; } if (node.Attributes.GetNamedItem("Url") != null) { urlField = node.Attributes.GetNamedItem("Url").Value; } if (node.Attributes.GetNamedItem("Thumbnail") != null) { thumbnailUrlField = node.Attributes.GetNamedItem("Thumbnail").Value; } // load Children foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "Folder": Folder temp = new Folder(); temp.Parent = this; //if (Parent != null && IsProxy) //{ // temp.Parent = Parent.Parent; //} temp.ParseXML(child); folders.Add(temp); break; case "Place": places.Add(Place.FromXml(child)); break; case "ImageSet": Imagesets.Add(Imageset.FromXMLNode(child)); break; case "Tour": Tours.Add(Tour.FromXml(child)); break; } } //bool Browseable { get; set; } //System.Collections.Generic.List<Folder> Folders { get; set; } //FolderGroup Group { get; set; } //System.Collections.Generic.List<Imageset> Imagesets { get; set; } //long MSRCommunityId { get; set; } //long MSRComponentId { get; set; } //string Name { get; set; } //long Permission { get; set; } //System.Collections.Generic.List<Place> Places { get; set; } //bool ReadOnly { get; set; } //string RefreshInterval { get; set; } //FolderRefreshType RefreshType { get; set; } //bool RefreshTypeSpecified { get; set; } //bool Searchable { get; set; } //string SubType { get; set; } //string ThumbnailUrl { get; set; } //System.Collections.Generic.List<Tour> Tours { get; set; } //FolderType Type { get; set; } //string Url { get; set; } }