You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
namespace CanYouBuildIt.Views;
|
|
using CanYouBuildIt.Model;
|
|
|
|
public partial class Login : ContentPage
|
|
{
|
|
public Manager manager => (App.Current as App).manager;
|
|
|
|
public Login()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private async void BoutonValider(object sender, EventArgs e)
|
|
{
|
|
error.IsVisible = false;
|
|
wrong.IsVisible = false;
|
|
//recupérer les valeurs d'entrées
|
|
string MdpUlti = Mdp.Text;
|
|
string Name = Nom.Text;
|
|
|
|
if (Name == null || MdpUlti == null)
|
|
error.IsVisible = true;
|
|
else
|
|
{
|
|
int idname = manager.rechercheUsername(Name);
|
|
int idmdp = manager.recherchePwd(MdpUlti);
|
|
|
|
if (idname == -1 && idmdp == -1)
|
|
wrong.IsVisible = true;
|
|
else if(idname != idmdp)
|
|
wrong.IsVisible = true;
|
|
else if (idname != -1 && idmdp != -1)
|
|
{
|
|
valide.IsVisible = true;
|
|
await Task.Delay(1000);
|
|
valide.IsVisible = false;
|
|
await Navigation.PushAsync(new Acceuil(idname));
|
|
}
|
|
}
|
|
}
|
|
|
|
private async void BackHome(object sender, EventArgs e)
|
|
{
|
|
await Navigation.PopAsync();
|
|
}
|
|
|
|
private async void NavSignIn(object sender, EventArgs e)
|
|
{
|
|
await Navigation.PushAsync(new SignIn());
|
|
}
|
|
} |