private void Button_Click(object sender, RoutedEventArgs e) { User user = new User("Mateusz", "Wiśniewski", 1997, "Gliwice", "Gliwicka", 2, "44-100", ""); PeselValidator peselValidator = new PeselValidator(user); this.Message.Text = "Imie: " + user.FirstName + "\nNazwisko: " + user.LastName + "\nRok urodzienia: " + user.YearOfBirth + "\nLat:" + user.GetAge() + "\nMiasto: " + user.City + "\nAdres: " + user.Street + " " + user.HouseNumber + "\nKod pocztowy: " + user.PostalCode; if (peselValidator.IsValid()) { this.Message.Text += "\nPodany PESEL: \n" + peselValidator.User.PESEL; } else { this.Message.Text += "\nBrak numeru PESEL \nWygenerowany PESEL: \n" + peselValidator.GeneratePesel(); } }