From f307902c6e526bc961fe592582f41cab9de11902 Mon Sep 17 00:00:00 2001
From: hulivet1 <Hugo.LIVET@etu.uca.fr>
Date: Tue, 17 Jan 2023 16:35:52 +0100
Subject: [PATCH] System de connexion Desktop

---
 Sources/IHM/Desktop/MainPage.xaml.cs | 17 +++++++----------
 Sources/Modele/TagOperation.cs       |  2 ++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/Sources/IHM/Desktop/MainPage.xaml.cs b/Sources/IHM/Desktop/MainPage.xaml.cs
index 5b94c97..060b134 100644
--- a/Sources/IHM/Desktop/MainPage.xaml.cs
+++ b/Sources/IHM/Desktop/MainPage.xaml.cs
@@ -12,7 +12,7 @@ public partial class MainPage : ContentPage
         BindingContext = this;
     }
 
-    public void ConnectionOnClicked(object sender, EventArgs e)
+    public async void ConnectionOnClicked(object sender, EventArgs e)
     {
         if (EntryMail.Text == null || EntryPassworld.Text == null)
         {
@@ -20,12 +20,13 @@ public partial class MainPage : ContentPage
         }
         else
         {
-            /*if (Mgr.existEmail(EntryMail.Text))
+            if (await Mgr.Pers.EmailDisponible(EntryMail.Text))
             {
-                if (Mgr.isEqualHash(Mgr.recupMdpBdd(EntryMail.Text), EntryPassworld.Text))
+                if (Mgr.CompareHash(await Mgr.getPassword(EntryMail.Text), EntryPassworld.Text))
                 {
                     Mgr.createUser(EntryMail.Text);
-                    ConnexionValide();
+
+                    Navigation.PushAsync(new Dashboard());
                 }
                 else
                 {
@@ -35,15 +36,11 @@ public partial class MainPage : ContentPage
             else
             {
                 AffichError("Compte inexistant", "Email ou mot de passe invalide", "OK");
-            }*/
+            }
         }
     }
 
-    private async void ConnexionValide()
-    {
-        Navigation.PushAsync(new Dashboard());
-        //await Navigation.PopModalAsync();
-    }
+    
 
     private async void AffichError(string s, string s1, string s2)
     {
diff --git a/Sources/Modele/TagOperation.cs b/Sources/Modele/TagOperation.cs
index 1718c6e..4437b3c 100644
--- a/Sources/Modele/TagOperation.cs
+++ b/Sources/Modele/TagOperation.cs
@@ -21,4 +21,6 @@ namespace Model
         Transaction,
         Santé
     }
+
+    
 }