private bool CheckIfThisLoginIsInDatabase() { RealmUserHandler handler = new RealmUserHandler(); bool exists = !handler.CheckIfLoginIsAvailable(LoginTextBox.Text); if (!exists) { MessageBox.Show("Nie ma takiego Loginu", "Błąd", MessageBoxButton.OK, MessageBoxImage.Information); LoginTextBox.Text = ""; PasswordBox.Password = ""; } return(exists); }
private bool CheckLoginIndivituality() { bool output; RealmUserHandler handler = new RealmUserHandler(); output = handler.CheckIfLoginIsAvailable(LoginTextBox.Text); if (!output) { MessageBox.Show("Niestety, podany przez Ciebie login już istnieje.\nPodaj inny login.", "Błąd", MessageBoxButton.OK, MessageBoxImage.Exclamation); LoginTextBox.Text = ""; } return(output); }
private int AddNewPlayerToRealm() { int newID = 0; try { RealmUserHandler handler = new RealmUserHandler(); newID = handler.AddNewPlayerToDB(NameTextBox.Text, PasswordBoxI.Password, LoginTextBox.Text); } catch (Exception ex) { var logger = NLog.LogManager.GetCurrentClassLogger(); logger.Error($"Error while trying to add new player to DataBase: {ex.Message}."); } return(newID); }
private (SettingsData, int) Login() { RealmUserHandler handler = new RealmUserHandler(); return(handler.Login(LoginTextBox.Text, PasswordBox.Password)); }