Exemplo n.º 1
0
 private void detach_Location(Location location)
 {
     location.LocationAddress = null;
 }
Exemplo n.º 2
0
        public void AddLocation(Location newLocation)
        {
            if (AllLocations == null)
            {
                LoadLocationsByCity(newLocation.LocationAddress.City);
            }
            if (AllCities != null && newLocation.LocationAddress != null
                && newLocation.LocationAddress.City != null)
            {
                AllCities.Add(newLocation.LocationAddress.City);
            }

            AllLocations.Add(newLocation);
            var unsortedLocations = AllLocations;
            AllLocations = new ObservableCollection<Location>(
                    unsortedLocations.OrderByDescending(location => location)
                    );

            var unsortedLocation = AllLocations;
            AllLocations = new ObservableCollection<Location>(
                unsortedLocation.OrderByDescending(sleep => sleep)
                );

            db.Locations.InsertOnSubmit(newLocation);
            db.SubmitChanges();
        }
Exemplo n.º 3
0
 private void attach_Location(Location location)
 {
     location.LocationAddress = this;
 }
Exemplo n.º 4
0
        public void DeleteLocation(Location LocationToDelete)
        {
            if (LocationToDelete.Tags != null)
            {
                LocationToDelete.Tags = null;
            }
            AllLocations.Remove(LocationToDelete);
            db.Locations.DeleteOnSubmit(LocationToDelete);
            db.LocationAddresses.DeleteOnSubmit(LocationToDelete.LocationAddress);

            db.SubmitChanges();
        }