diff --git a/Sources/IHM/AppShellDesktop.xaml.cs b/Sources/IHM/AppShellDesktop.xaml.cs
index 6ecd0d7..0a77dfd 100644
--- a/Sources/IHM/AppShellDesktop.xaml.cs
+++ b/Sources/IHM/AppShellDesktop.xaml.cs
@@ -1,6 +1,7 @@
using IHM.Desktop;
using IHM.Mobile;
using Model;
+using ForgetPassword = IHM.Desktop.ForgetPassword;
namespace IHM
{
@@ -11,11 +12,13 @@ namespace IHM
public AppShellDesktop()
{
InitializeComponent();
-
+ Routing.RegisterRoute("ForgetPassword", typeof(ForgetPassword));
+
+
}
-
-
-
+
+
+
}
}
\ No newline at end of file
diff --git a/Sources/IHM/Desktop/ForgetPassword.xaml b/Sources/IHM/Desktop/ForgetPassword.xaml
new file mode 100644
index 0000000..ec779f4
--- /dev/null
+++ b/Sources/IHM/Desktop/ForgetPassword.xaml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/IHM/Desktop/ForgetPassword.xaml.cs b/Sources/IHM/Desktop/ForgetPassword.xaml.cs
new file mode 100644
index 0000000..fabcb9f
--- /dev/null
+++ b/Sources/IHM/Desktop/ForgetPassword.xaml.cs
@@ -0,0 +1,68 @@
+using Model;
+using Email = Model.Email;
+
+namespace IHM.Desktop;
+
+public partial class ForgetPassword : ContentPage
+{
+ public Manager Mgr => (App.Current as App).Manager;
+ private string code;
+ //private DateTime _startTime;
+ //private CancellationTokenSource _cancellationTokenSource;
+
+ public ForgetPassword()
+ {
+ InitializeComponent();
+ }
+ public void SearchEmail(object sender, EventArgs e)
+ {
+ if (EntryMail.Text == null)
+ {
+ AffichError("Email inconnue", "Aucun compte existant portant cette adresse mail", "OK");
+ }
+ if (Mgr.existEmail(EntryMail.Text))
+ {
+ Random generator = new Random();
+ code = generator.Next(0, 1000000).ToString("D6");
+ Email.CreateMail(EntryMail.Text, code);
+ ValidateReceptCode.IsVisible = true;
+ ConnexionButton.IsEnabled = false;
+ UpdateArc();
+ }
+ }
+ private async void AffichError(string s, string s1, string s2)
+ {
+ await DisplayAlert(s, s1, s2);
+ }
+ private async void UpdateArc()
+ {
+ int timeRemaining = 60;
+ while (timeRemaining != 0)
+ {
+ ConnexionButton.Text = $"{timeRemaining}";
+
+ timeRemaining--;
+
+ await Task.Delay(1000);
+ }
+
+ ConnexionButton.Text = "valider Email";
+ ConnexionButton.IsEnabled = true;
+ }
+ private void ValideCode(object sender, EventArgs e)
+ {
+ if (EntryCodeRecept.Text == code)
+ {
+ NavigateTo();
+ }
+ else
+ {
+ AffichError("Code non identique", "Veuillez entrer le même code que celui reçu par mail", "OK");
+ }
+ }
+
+ public async void NavigateTo()
+ {
+ //await Navigation.PushModalAsync(new ForgetPassword(EntryMail.Text));
+ }
+}
\ No newline at end of file
diff --git a/Sources/IHM/IHM.csproj b/Sources/IHM/IHM.csproj
index 5953feb..223d9d1 100644
--- a/Sources/IHM/IHM.csproj
+++ b/Sources/IHM/IHM.csproj
@@ -93,6 +93,9 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile