private void buttonGoToUserBooks_Click(object sender, EventArgs e) { FormLoggedBooks formLoggedBooks = new FormLoggedBooks(); formLoggedBooks.Show(); this.Hide(); }
private void goBackButton_Click(object sender, EventArgs e) { FormLoggedBooks formLoggedBooks = new FormLoggedBooks(); formLoggedBooks.Show(); this.Hide(); }
private void RegisterUser() { string userName = textBoxLogin.Text; string password = textBoxPassword.Text; string firstName = textBoxFirstName.Text; string lastName = textBoxSecondName.Text; string city = textBoxCity.Text; string email = textBoxEmail.Text; try { User user = new User(userName, password, firstName, lastName, city, email); user.RegisterUser(); MessageBox.Show("Registration completed. Welcome in our library."); user.LoginUser(); this.Hide(); FormLoggedBooks bio = new FormLoggedBooks(); bio.Show(); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
private void Login() { string userName = textBoxLogin.Text; string password = textBoxPassword.Text; try { User user = new User(userName, password); user.LoginUser(); this.Hide(); FormLoggedBooks bio = new FormLoggedBooks(); bio.Show(); } catch (Exception exception) { //Full exception information: //MessageBox.Show($"An error: {exception}"); // Display only exception Message: MessageBox.Show(exception.Message); } }