Esempio n. 1
0
        public void DeleteTag(Tag TagToDelete)
        {
            foreach (var location in AllLocations)
            {
                if (location.Tags.Contains(TagToDelete))
                {
                    MessageBox.Show(string.Format(AppResources.TagAssignedMessage, location.Name), AppResources.TagAssignedTitle, MessageBoxButton.OK);
                    return;
                }
            }

            AllTags.Remove(TagToDelete);
            db.Tags.DeleteOnSubmit(TagToDelete);

            db.SubmitChanges();
        }
Esempio n. 2
0
        private void CreateDefaultEntries()
        {
            var tagBar = new Tag { TagName = AppResources.BarLabel };
            var tagRestaurant = new Tag { TagName = AppResources.RestaurantLabel };
            var tagHotel = new Tag { TagName = AppResources.HotelLabel };
            var tagShop = new Tag { TagName = AppResources.ShopLabel };
            var tagWork = new Tag { TagName = AppResources.WorkLabel };
            var tagMuseum = new Tag { TagName = AppResources.MuseumLabel };
            var tagViewpoint = new Tag { TagName = AppResources.ViewpointLabel };
            var tagFriends = new Tag { TagName = AppResources.FriendsLabel };
            var tagFamily = new Tag { TagName = AppResources.FamilyLabel };
            var tagClub = new Tag { TagName = AppResources.ClubLabel };
            var tagTouristAttraction = new Tag { TagName = AppResources.TouristAttractionLabel };

            AddTag(tagBar);
            AddTag(tagRestaurant);
            AddTag(tagHotel);
            AddTag(tagShop);
            AddTag(tagWork);
            AddTag(tagMuseum);
            AddTag(tagViewpoint);
            AddTag(tagFriends);
            AddTag(tagFamily);
            AddTag(tagClub);
            AddTag(tagTouristAttraction);
        }
Esempio n. 3
0
        public void AddTag(Tag newTag)
        {
            AllTags.Add(newTag);
            db.Tags.InsertOnSubmit(newTag);

            db.SubmitChanges();
        }