private bool RepeatedUser() { bool repeated = false; if (permissionController.ExistsUserName(userNameText.Text)) { InputValidations.ErrorMessage(userNameMsg, "This name has been taken"); repeated = true; } return(repeated); }
private void createButton_Click(object sender, EventArgs e) { try { CreateTemplateAndSave(); } catch (InvalidTemplateException ex) { InputValidations.ErrorMessage(msgLabel, ex.ToString()); } catch (TemplateAlreadyExistsException ex) { InputValidations.ErrorMessage(msgLabel, ex.ToString()); } }
private void TryToLogIn() { try { IUserRepository users = new UserRepository(); mother.CurrentSession = connector.LogIn(UsernameText.Text, PasswordText.Text, users); mother.GoToMenu(); } catch (WrongPasswordException) { InputValidations.ErrorMessage(PasswordMsg, "Wrong Password!"); } catch (UserNotFoundException) { InputValidations.ErrorMessage(UserNameMsg, "User doesn't exist!"); } }