Пример #1
0
        private void LocatieToevoegenOfAanpassen()
        {
            if (Location.LocationID > 0)
            {
                Location.Naam         = Naam;
                Location.Prijs        = Prijs;
                Location.Diepte       = Diepte;
                Location.Land         = Land;
                Location.Straat       = Straat;
                Location.Stad         = Stad;
                Location.Huisnummer   = Huisnummer;
                Location.Geschiktheid = Geschiktheid;
                Location.Category     = GeselecteerdeCategory;
                Location.Preview.PreviewBeschrijving         = PreviewBeschrijving;
                Location.Description.DescriptionBeschrijving = DescriptionBeschrijving;

                unitOfWork.LocationRepo.Aanpassen(Location);
                MessageBox.Show("De locatie is succesvol aangepast");
                unitOfWork.Save();

                DuiklocatieViewModel vm   = new DuiklocatieViewModel(customer, "");
                DuiklocatieView      view = new DuiklocatieView();
                view.DataContext = vm;
                view.Show();
                Application.Current.Windows[0].Close();
            }
            else
            {
                Location Location = new Location();
                Location.Naam         = Naam;
                Location.Prijs        = Prijs;
                Location.Diepte       = Diepte;
                Location.Land         = Land;
                Location.Straat       = Straat;
                Location.Stad         = Stad;
                Location.Huisnummer   = Huisnummer;
                Location.Geschiktheid = Geschiktheid;
                Location.Category     = GeselecteerdeCategory;
                Preview Preview = new Preview();
                Preview.PreviewBeschrijving = PreviewBeschrijving;
                Description Description = new Description();
                Description.DescriptionBeschrijving = DescriptionBeschrijving;

                unitOfWork.PreviewRepo.Toevoegen(Preview);
                unitOfWork.DescriptionRepo.Toevoegen(Description);
                Location.Description = Description;
                Location.Preview     = Preview;
                unitOfWork.LocationRepo.Toevoegen(Location);
                MessageBox.Show("De locatie is succesvol aangepast");

                unitOfWork.Save();

                DuiklocatieViewModel vm   = new DuiklocatieViewModel(customer, "DuiklocatieView");
                DuiklocatieView      view = new DuiklocatieView();
                view.DataContext = vm;
                view.Show();
                Application.Current.Windows[0].Close();
            }
        }
Пример #2
0
        public void OpenDuiklocaties()
        {
            DuiklocatieViewModel vm   = new DuiklocatieViewModel(customer, "DuiklocatieView");
            DuiklocatieView      view = new DuiklocatieView();

            view.DataContext = vm;
            view.Show();
            Application.Current.Windows[0].Close();
        }
Пример #3
0
        private void LocatieVerwijderen()
        {
            unitOfWork.LocationRepo.Verwijderen(Location);
            unitOfWork.Save();
            DuiklocatieViewModel vm   = new DuiklocatieViewModel(customer, "DuiklocatieView");
            DuiklocatieView      view = new DuiklocatieView();

            view.DataContext = vm;
            view.Show();
            Application.Current.Windows[0].Close();
        }