|
|
@ -1,8 +1,13 @@
|
|
|
|
namespace GameAtlas.Views;
|
|
|
|
namespace GameAtlas.Views;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using GameAtlas.Models;
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class PageConnexion : ContentPage
|
|
|
|
public partial class PageConnexion : ContentPage
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Manager ConnexionManager => (App.Current as App).MyManager;
|
|
|
|
public PageConnexion()
|
|
|
|
public PageConnexion()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
@ -21,7 +26,26 @@ public partial class PageConnexion : ContentPage
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Verification(username, password);
|
|
|
|
await Navigation.PushAsync(new PageAcceuil());
|
|
|
|
await Navigation.PushAsync(new PageAcceuil());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool Verification(string username, string password)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (Utilisateur user in ConnexionManager.Utilisateurs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (user.Pseudo == username)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.WriteLine($"Pseudo \"{user.Pseudo}\" vérifié et valide");
|
|
|
|
|
|
|
|
if (user.Mdp == password)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.WriteLine("Mot de Passe verifié et valide");
|
|
|
|
|
|
|
|
ConnexionManager.ConnectedUser = user;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|