private void addAdminButton_Click(object sender, RoutedEventArgs e) { addAdminButton.IsEnabled = false; int result = databaseHandler.AddAdmin(new Client { FirstName = @firstNameTB.Text, SecondName = @secondNameTB.Text, CompanyName = @companyNameTB.Text, Email = @emailTB.Text, PhoneNumber = @phoneTB.Text, Country = @countryTB.Text, City = @cityTB.Text, Street = @streetTB.Text, Postcode = @postcodeTB.Text, BuildingNumber = @buildingTB.Text, Username = @usernameTB.Text, Password = @passwordTB.Text, IsAdmin = 1 } ); if (result == 1) { MessageBox.Show("A new account has been created.", "Success!", MessageBoxButton.OK); this.Close(); } else { MessageBox.Show("Something went wrong, please try again.", "Failure!", MessageBoxButton.OK); this.Close(); } }