diff --git a/MangaMap/AppShell.xaml b/MangaMap/AppShell.xaml
index 0bc2603..d9797d4 100644
--- a/MangaMap/AppShell.xaml
+++ b/MangaMap/AppShell.xaml
@@ -33,4 +33,4 @@
Title="Fiche Exemple"
ContentTemplate="{DataTemplate Views:ficheAnime}" />
-
+
\ No newline at end of file
diff --git a/MangaMap/MangaMap.csproj b/MangaMap/MangaMap.csproj
index 4edc76d..d595fae 100644
--- a/MangaMap/MangaMap.csproj
+++ b/MangaMap/MangaMap.csproj
@@ -91,6 +91,7 @@
+
diff --git a/MangaMap/Model/Admin.cs b/MangaMap/Model/Admin.cs
index a8ff102..1ba1fe6 100644
--- a/MangaMap/Model/Admin.cs
+++ b/MangaMap/Model/Admin.cs
@@ -1,4 +1,5 @@
-using System;
+using MangaMap.Views;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,11 +7,18 @@ using System.Threading.Tasks;
namespace MangaMap.Model
{
- class Admin
- {
+ public class Admin : Personne
+ {
+ public Admin(string mdp, string email, string pseudo) : base(mdp, email, pseudo)
+ {
+ }
+
public int Id { get; private set; }
- public Admin(int id)
- { this.Id = id; }
+
+
+ public void ajouterAnime() { }
+
+ public void supprimerAnime() { }
}
}
diff --git a/MangaMap/Model/Oeuvre.cs b/MangaMap/Model/Oeuvre.cs
index 984e300..f506883 100644
--- a/MangaMap/Model/Oeuvre.cs
+++ b/MangaMap/Model/Oeuvre.cs
@@ -9,13 +9,13 @@ namespace MangaMap.Model
class Oeuvre
{
public string Nom { get; private set; }
- public string[] Genre { get; private set; }
+ public List Genre { get; private set; }
public string Type { get; private set; }
public string Description { get; private set; }
public int Note { get; private set; }
public int NbEpisodes { get; private set; }
- public Oeuvre(string nom, string[] genre, string type, string description, int note, int nbEpisode)
+ public Oeuvre(string nom, List genre, string type, string description, int note, int nbEpisode)
{
Nom = nom;
Genre = genre;
diff --git a/MangaMap/Model/Personne.cs b/MangaMap/Model/Personne.cs
index 72ca6c0..0a4652c 100644
--- a/MangaMap/Model/Personne.cs
+++ b/MangaMap/Model/Personne.cs
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MangaMap.Model
{
- class Personne
+ public class Personne
{
public string MotDePasse { get; private set; }
public string Email { get; private set; }
@@ -62,5 +62,9 @@ namespace MangaMap.Model
return false;
}
+
+
+
+
}
}
diff --git a/MangaMap/Model/Utilisateur.cs b/MangaMap/Model/Utilisateur.cs
index dd8010d..cd03369 100644
--- a/MangaMap/Model/Utilisateur.cs
+++ b/MangaMap/Model/Utilisateur.cs
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MangaMap.Model
{
- class Utilisateur
+ public class Utilisateur
{
public string nom { get; private set; }
public string prenom { get; private set; }
diff --git a/MangaMap/Views/listPage.xaml b/MangaMap/Views/listPage.xaml
index 9f03ebd..933ecdb 100644
--- a/MangaMap/Views/listPage.xaml
+++ b/MangaMap/Views/listPage.xaml
@@ -3,89 +3,169 @@
x:Class="MangaMap.Views.listPage"
BackgroundColor="Black">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MangaMap/Views/loginPage.xaml b/MangaMap/Views/loginPage.xaml
index b1bd35c..6ab0ff7 100644
--- a/MangaMap/Views/loginPage.xaml
+++ b/MangaMap/Views/loginPage.xaml
@@ -9,9 +9,9 @@
-
+
-
+
diff --git a/MangaMap/Views/loginPage.xaml.cs b/MangaMap/Views/loginPage.xaml.cs
index 17b4576..8343627 100644
--- a/MangaMap/Views/loginPage.xaml.cs
+++ b/MangaMap/Views/loginPage.xaml.cs
@@ -1,4 +1,6 @@
namespace MangaMap.Views;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
public partial class loginPage : ContentPage
{
@@ -7,8 +9,34 @@ public partial class loginPage : ContentPage
InitializeComponent();
}
- private void OnLoginClicked(object sender, EventArgs e)
+ async void OnLoginClicked(object sender, EventArgs e)
{
- //
+ // Récupération de l'email et du mot de passe entrés
+ string email = emailEntry.Text;
+ string password = passwordEntry.Text;
+
+ if (string.IsNullOrWhiteSpace(email) ||
+ string.IsNullOrWhiteSpace(password))
+ {
+ await DisplayAlert("Erreur", "Veuillez remplir tous les champs.", "OK");
+ return;
+ }
+
+ // Vérifier que l'e-mail a la bonne forme
+ if (!Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$"))
+ {
+ await DisplayAlert("Erreur", "L'e-mail n'est pas valide.", "OK");
+ return;
+ }
+
+ // Vérification du mot de passe
+ if (password != "monmotdepasse")
+ {
+ DisplayAlert("Erreur", "Le mot de passe entré est incorrect.", "OK");
+ return;
+ }
+
+ // Redirection vers la page suivante si le mot de passe est correct
+ Navigation.PushAsync(new homePage());
}
-}
\ No newline at end of file
+}
diff --git a/MangaMap/Views/signUpPage.xaml b/MangaMap/Views/signUpPage.xaml
index c36c10d..cf42d95 100644
--- a/MangaMap/Views/signUpPage.xaml
+++ b/MangaMap/Views/signUpPage.xaml
@@ -10,15 +10,15 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/MangaMap/Views/signUpPage.xaml.cs b/MangaMap/Views/signUpPage.xaml.cs
index 3f40078..fc6731a 100644
--- a/MangaMap/Views/signUpPage.xaml.cs
+++ b/MangaMap/Views/signUpPage.xaml.cs
@@ -1,4 +1,5 @@
namespace MangaMap.Views;
+using System.Text.RegularExpressions;
public partial class signUpPage : ContentPage
{
@@ -7,8 +8,76 @@ public partial class signUpPage : ContentPage
InitializeComponent();
}
- private void OnLoginClicked(object sender, EventArgs e)
+ async void OnSignUpClicked(object sender, System.EventArgs e)
{
- //
+ // Récupérer les valeurs des entrées
+ string email = emailEntry.Text;
+ string password = passwordEntry.Text;
+ string confirmPassword = confirmPasswordEntry.Text;
+
+ if (string.IsNullOrWhiteSpace(email) ||
+ string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(confirmPassword))
+ {
+ await DisplayAlert("Erreur", "Veuillez remplir tous les champs.", "OK");
+ return;
+ }
+
+ // Vérifier que l'e-mail a la bonne forme
+ if (!Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$"))
+ {
+ await DisplayAlert("Erreur", "L'e-mail n'est pas valide.", "OK");
+ return;
+ }
+
+ if (IsPasswordStrong(password) == false)
+ {
+ await DisplayAlert("Erreur", "Le mot de passe n'est pas assez fort", "OK");
+ return;
+ }
+
+ // Vérifier si les mots de passe correspondent
+ if (password != confirmPassword)
+ {
+ await DisplayAlert("Erreur", "Les mots de passe ne correspondent pas", "OK");
+ return;
+ }
+
+ if (password == confirmPassword)
+ {
+ await Navigation.PushAsync(new homePage());
+ }
+
+ }
+
+ bool IsPasswordStrong(string password)
+ {
+ // Vérifier si le mot de passe est assez long
+ if (password.Length < 8)
+ {
+ return false;
+ }
+
+ // Vérifier si le mot de passe contient au moins une majuscule, une minuscule et un chiffre
+ bool hasUppercase = false;
+ bool hasLowercase = false;
+ bool hasDigit = false;
+
+ foreach (char c in password)
+ {
+ if (char.IsUpper(c))
+ {
+ hasUppercase = true;
+ }
+ else if (char.IsLower(c))
+ {
+ hasLowercase = true;
+ }
+ else if (char.IsDigit(c))
+ {
+ hasDigit = true;
+ }
+ }
+
+ return hasUppercase && hasLowercase && hasDigit;
}
}
\ No newline at end of file