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.
48 lines
1.4 KiB
48 lines
1.4 KiB
namespace CanYouBuildIt.Views;
|
|
|
|
public partial class Login : ContentPage
|
|
{
|
|
public Manager MyManager => (App.Current as App).MyManager;
|
|
public PageConnexion()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private async void BoutonValider(object sender, EventArgs e)
|
|
{
|
|
//recupérer les valeurs d'entrées
|
|
string email = Adresse.Text;
|
|
string MdpUlti = Mdp.Text;
|
|
string Name = Nom.Text;
|
|
int idname = MyManager.rechercheNom(Name);
|
|
int idmail = MyManager.rechercheAdresse(email);
|
|
int idmdp = MyManager.rechercheMdp(MdpUlti);
|
|
|
|
if (Name == null || MdpUlti == null)
|
|
{
|
|
error.IsVisible = true;
|
|
await Task.Delay(3000);
|
|
error.IsVisible = false;
|
|
return;
|
|
}
|
|
else if (idname == -1 && idmail == -1 && idmdp == -1)
|
|
{
|
|
wrong.IsVisible = true;
|
|
await Task.Delay(1000);
|
|
wrong.IsVisible = false;
|
|
return;
|
|
}
|
|
else if (idname != -1 && idmail != -1 && idmdp != -1)
|
|
{
|
|
valide.IsVisible = true;
|
|
await Task.Delay(1000);
|
|
valide.IsVisible = false;
|
|
await Navigation.PushAsync(new Accueil(idname));
|
|
}
|
|
}
|
|
|
|
private void btninsc(object sender, EventArgs e)
|
|
{
|
|
Navigation.PushAsync(new PageInscription());
|
|
}
|
|
} |