//Voegt student toe aan database
 public void AddStudentToDatabase()
 {
     StudentWasFilledInCorrectly = false;
     if (ParentWasFilledInCorrectly)
     {
         //Kijkt of input valide is
         if (InputInformationValidator.ValidateAddStudentInputWithPassword(windowAddStudent, ref errorMessage))
         {
             using (DatabaseContext db = new DatabaseContext())
             {
                 //Creeer een leerling object
                 User newUser = new User()
                 {
                     FirstName   = windowAddStudent.NameTextbox.Text,
                     LastName    = windowAddStudent.LastNameTextBox.Text,
                     Gender      = windowAddStudent.addStudentGenderComboBox.SelectedItem.ToString(),
                     Address     = windowAddStudent.StreetTextBox.Text,
                     Postalcode  = windowAddStudent.PostalcodeTextBox.Text,
                     Residence   = windowAddStudent.DialogAddResidence.Text,
                     Email       = windowAddStudent.EmailTextBox.Text,
                     Password    = EncryptionHelper.HashStringSHA512(windowAddStudent.PasswordTextBox.Text),
                     Niveau      = Int32.Parse(windowAddStudent.DialogAddLevel.Text),
                     DateOfBirth = windowAddStudent.dateTimePicker1.Value,
                     IsOwner     = false
                 };
                 if (!IsAdult)
                 {
                     newUser.ParentID = db.Parents.Max(x => x.ParentID);
                 }
                 db.Users.Add(newUser);
                 db.SaveChanges();
                 windowOwner.UpdateDataGridPanelWithStudent();
                 var result = MessageBox.Show("Leerling toegevoegd");
                 db.Dispose();
                 if (result == DialogResult.Yes)
                 {
                     this.Close();
                 }
             }
             windowOwner.UpdateListStudentsFromDatabase();
             StudentWasFilledInCorrectly = true;
         }
         else
         {
             MessageBox.Show(errorMessage);
             errorMessage = null;
         }
     }
 }