Exemplo n.º 1
0
        public void DalTester()
        {
            GebruikerSQLContext gsc = new GebruikerSQLContext();
            GebruikerRepository gr  = new GebruikerRepository(gsc);
            Gebruiker           g   = gr.RetrieveGebruiker(1);

            g.Huisnummer = g.Huisnummer + "aangepast";


            gr.UpdateGebruiker(g);
        }
Exemplo n.º 2
0
        private void btGegevensWijzigen_Click(object sender, RoutedEventArgs e)
        {
            var  inf       = new GebruikerSQLContext();
            bool canUpdate = true;
            var  repo      = new GebruikerRepository(inf);

            if (!String.IsNullOrEmpty(tbEmail.Text) && !String.IsNullOrEmpty(tbNaam.Text) &&
                !String.IsNullOrEmpty(tbTelefoon.Text) && !String.IsNullOrEmpty(tbAdres.Text) &&
                !String.IsNullOrEmpty(tbNummer.Text) && !String.IsNullOrEmpty(tbPostcode.Text) && !String.IsNullOrEmpty(tbPlaats.Text) &&
                !String.IsNullOrEmpty(tbLand.Text))
            {
                System.Windows.MessageBox.Show(_g.Wachtwoord);
                _g.Email          = tbEmail.Text;
                _g.Naam           = tbNaam.Text;
                _g.Telefoonnummer = tbTelefoon.Text;
                _g.Straat         = tbAdres.Text;
                _g.Huisnummer     = tbNummer.Text;
                _g.Postcode       = tbPostcode.Text;
                _g.Plaats         = tbPlaats.Text;
                _g.Land           = tbLand.Text;

                //Wanneer 1 van de 2 leeg is
                if (String.IsNullOrEmpty(pwbWachtwoord.Password) || String.IsNullOrEmpty(pwbWachtwoordHerhalen.Password))
                {
                    if (String.IsNullOrEmpty(pwbWachtwoord.Password) &&
                        String.IsNullOrEmpty(pwbWachtwoordHerhalen.Password))
                    {
                        //allebei is leeg
                        _g.Wachtwoord = _g.Wachtwoord;
                        System.Windows.MessageBox.Show("allebei leeg + updaten");
                    }
                    else
                    {
                        //een van de 2 is leeg
                        System.Windows.MessageBox.Show("Vul allebei de velden in.");
                        canUpdate = false;
                    }
                }
                else
                {
                    //allebei gevuld
                    if (!String.IsNullOrEmpty(pwbWachtwoord.Password) &&
                        !String.IsNullOrEmpty(pwbWachtwoordHerhalen.Password))
                    {
                        if (pwbWachtwoord.Password != pwbWachtwoordHerhalen.Password)
                        {
                            System.Windows.MessageBox.Show("De wachtwoorden zijn niet gelijk.");
                            canUpdate = false;
                        }
                        else
                        {
                            _g.Wachtwoord = pwbWachtwoordHerhalen.Password;
                        }
                    }
                }


                if (cbGeslacht.SelectedItem != null)
                {
                    _g.Geslacht = (Gebruiker.GebruikerGeslacht)cbGeslacht.SelectedItem;
                }

                if (img == null)
                {
                }
                else
                {
                    _g.Foto = img;
                }

                if (canUpdate)
                {
                    repo.UpdateGebruiker(_g);
                }
            }
            else
            {
                MessageBox.Show("Er mogen geen velden leeggelaten worden");
            }
        }
Exemplo n.º 3
0
 public void ChangeGebruiker(Gebruiker gebruiker)
 {
     repo.UpdateGebruiker(gebruiker);
 }
Exemplo n.º 4
0
 //Deze methode updatet een gebruiker.
 public void UpdateGebruiker(Gebruiker user)
 {
     _gebruikerRepository.UpdateGebruiker(user);
 }
Exemplo n.º 5
0
 public void UpdateInspector(Gebruiker g)
 {
     GebruikerRepository.UpdateGebruiker(g);
 }