public void OpenToevoegenLocationCustomer() { if (Location != null) { Foutmelding = ""; try { LocationCustomer locationCustomer = new LocationCustomer() { LocationID = Location.LocationID, CustomerID = customer.CustomerID }; if (locationCustomer.IsGeldig()) { unitOfWork.LocationCustomerRepo.Toevoegen(locationCustomer); int ok = unitOfWork.Save(); if (ok > 0) { DuiklocatieViewModel vm = new DuiklocatieViewModel(customer, "FavorietenView"); FavorietenView view = new FavorietenView(); view.DataContext = vm; view.Show(); Application.Current.Windows[0].Close(); } } } catch (Exception) { Foutmelding = "Deze is al toegevoegd bij uw favorieten"; } } }
public void OpenFavorieten() { DuiklocatieViewModel vm = new DuiklocatieViewModel(customer, "FavorietenView"); FavorietenView view = new FavorietenView(); view.DataContext = vm; view.Show(); Application.Current.Windows[0].Close(); }