private void BtnLogin_Click(object sender, RoutedEventArgs e) { //Verify if this pseudo already exists if (PlayerDb.GetPlayer(txbPeuso.Text, txbPassword.Password) == null) { MessageBox.Show("Pseudo ou Mot de passe sont incorrect. Réessayez !"); this.Hide(); SignIn signIn = new SignIn(); signIn.ShowDialog(); } else { Services.GetPlayer(txbPeuso.Text, txbPassword.Password);//Immediately get player Home click = new Home(); MessageBox.Show(click, "Login réussi !"); this.Hide(); click.ShowDialog(); } }
/// <summary> /// Get own player from login/sign up /// </summary> /// <param name="pseudo"></param> /// <param name="pass"></param> public static void GetPlayer(string pseudo, string pass) { Player = PlayerDb.GetPlayer(pseudo, pass); }