From 57b0538e9d85fa7c21e73c6ed89bb6137af3c3ed Mon Sep 17 00:00:00 2001 From: V J Date: Wed, 31 May 2023 10:53:03 +0200 Subject: [PATCH 1/5] avancement --- MangaMap/App.xaml.cs | 1 - MangaMap/Model/Manager.cs | 2 +- MangaMap/Model/Utilisateur.cs | 6 +++--- MangaMap/Stub/Stub.cs | 2 +- MangaMap/Views/FicheAnime.xaml.cs | 15 +++++++------- MangaMap/Views/listPage.xaml | 34 +++++++++++++++++-------------- MangaMap/Views/listPage.xaml.cs | 31 ++++++++++++++++++++++++++-- MangaMap/Views/loginPage.xaml.cs | 10 ++++----- 8 files changed, 66 insertions(+), 35 deletions(-) diff --git a/MangaMap/App.xaml.cs b/MangaMap/App.xaml.cs index bc05b10..d992022 100644 --- a/MangaMap/App.xaml.cs +++ b/MangaMap/App.xaml.cs @@ -24,7 +24,6 @@ public partial class App : Application MyManager.charger(); MyManager.Admins.Add(MyAdmin); - //MyManager.UtilisateurActuel = MyManager.charger(); MainPage = new AppShell(); diff --git a/MangaMap/Model/Manager.cs b/MangaMap/Model/Manager.cs index e2d2e6a..1aa5f8d 100644 --- a/MangaMap/Model/Manager.cs +++ b/MangaMap/Model/Manager.cs @@ -20,7 +20,7 @@ namespace MangaMap.Model Admins = new List(); Utilisateurs = new List(); Oeuvres = new List(); - UtilisateurActuel = null; + UtilisateurActuel = new Utilisateur(); Persistance = Pers; } diff --git a/MangaMap/Model/Utilisateur.cs b/MangaMap/Model/Utilisateur.cs index 750614a..1c209e2 100644 --- a/MangaMap/Model/Utilisateur.cs +++ b/MangaMap/Model/Utilisateur.cs @@ -19,11 +19,11 @@ namespace MangaMap.Model [DataMember] public List ListeOeuvreEnVisionnage { get; set; } [DataMember] - public List ListeOeuvreDejaVu { get; private set; } + public List ListeOeuvreDejaVu { get; set; } [DataMember] - public List ListeOeuvrePourPlusTard { get; private set; } + public List ListeOeuvrePourPlusTard { get; set; } [DataMember] - public List ListeOeuvreFavorites { get; private set; } + public List ListeOeuvreFavorites { get; set; } public Utilisateur(string email, string pseudo, string mdp, string nom, string prenom, int age) { diff --git a/MangaMap/Stub/Stub.cs b/MangaMap/Stub/Stub.cs index 25c19a1..aa2c5bf 100644 --- a/MangaMap/Stub/Stub.cs +++ b/MangaMap/Stub/Stub.cs @@ -17,7 +17,7 @@ namespace MangaMap.Stub List l1 = new List(); List l2 = new List(); - Utilisateur u1 = new Utilisateur("test@test.tst", "Pseudo1", "MotDePasse123", "Jean", "Baptiste", 12); + Utilisateur u1 = new Utilisateur("t", "Pseudo1", "t", "Jean", "Baptiste", 12); Utilisateur u2 = new Utilisateur("test@test.ts", "Pseudo2", "MotDePasse123", "Baptiste", "Jean", 12); Utilisateur u3 = new Utilisateur("test@test.ts", "Pseudo3", "MotDePasse123", "David", "Marc", 12); List genres = new List(); diff --git a/MangaMap/Views/FicheAnime.xaml.cs b/MangaMap/Views/FicheAnime.xaml.cs index ea5f9ac..0b49980 100644 --- a/MangaMap/Views/FicheAnime.xaml.cs +++ b/MangaMap/Views/FicheAnime.xaml.cs @@ -32,7 +32,7 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged public async void AjouterListe(object sender, EventArgs e) { - if (my_manager.UtilisateurActuel == null) + if (my_manager.UtilisateurActuel.Email == null) { await DisplayAlert("Erreur", "Vous n'êtes pas connecté.", "OK"); return; @@ -66,15 +66,16 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged break; } - foreach (Oeuvre oeuvre in my_manager.UtilisateurActuel.ListeOeuvreEnVisionnage) - { - Debug.WriteLine("Titre de l'oeuvre : " + oeuvre.Nom); - // Faites d'autres opérations avec chaque élément de la liste - } + ////foreach (oeuvre oeuvre in my_manager.utilisateuractuel.listeoeuvreenvisionnage) + ////{ + //// debug.writeline("titre de l'oeuvre : " + oeuvre.nom); + //// // faites d'autres opérations avec chaque élément de la liste + ////} my_manager.sauvegarder(); - await Navigation.PushAsync(new listPage()); + //await Navigation.PushAsync(new listPage()); + await Shell.Current.GoToAsync("//page/secondaire/listPage"); } diff --git a/MangaMap/Views/listPage.xaml b/MangaMap/Views/listPage.xaml index adae05b..293eb06 100644 --- a/MangaMap/Views/listPage.xaml +++ b/MangaMap/Views/listPage.xaml @@ -2,8 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MangaMap" x:Class="MangaMap.Views.listPage" - BackgroundColor="Black" - x:Name="listPage"> + BackgroundColor="Black"> @@ -40,19 +39,24 @@ - - - - - - - - - - + + + + + + + + + + + + diff --git a/MangaMap/Views/listPage.xaml.cs b/MangaMap/Views/listPage.xaml.cs index 29066e2..449192f 100644 --- a/MangaMap/Views/listPage.xaml.cs +++ b/MangaMap/Views/listPage.xaml.cs @@ -1,5 +1,6 @@ namespace MangaMap.Views; using MangaMap.Model; +using static System.Net.Mime.MediaTypeNames; public partial class listPage : ContentPage { @@ -8,10 +9,36 @@ public partial class listPage : ContentPage public listPage() { InitializeComponent(); - BindingContext = my_manager.UtilisateurActuel; + BindingContext = my_manager; + if (my_manager.UtilisateurActuel.Email != null) + { + chargerFavoris(); + } } - + private void chargerFavoris() + { + int indice = 0; + for (int i = 0; i < my_manager.UtilisateurActuel.ListeOeuvreEnVisionnage.Count; i++) + { + Oeuvre favoris = my_manager.UtilisateurActuel.ListeOeuvreEnVisionnage[i]; + ImageButton imageButton = new ImageButton + { + Source = favoris.Affiche, + WidthRequest = 100, + HeightRequest = 100, + }; + + int ligne = 1 + indice; + + Grid.SetRow(imageButton, ligne); + Grid.SetColumn(imageButton, 0); + + //grille.Children.Add(imageButton); + + indice++; + } + } } \ No newline at end of file diff --git a/MangaMap/Views/loginPage.xaml.cs b/MangaMap/Views/loginPage.xaml.cs index 5a52a7c..624e48b 100644 --- a/MangaMap/Views/loginPage.xaml.cs +++ b/MangaMap/Views/loginPage.xaml.cs @@ -27,11 +27,11 @@ public partial class loginPage : ContentPage } // Vérifier que l'e-mail a la bonne forme - if (!Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$")) - { - await DisplayAlert("Erreur", "L'email n'est pas valide.", "OK"); - return; - } + //if (!Regex.IsMatch(email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$")) + //{ + // await DisplayAlert("Erreur", "L'email n'est pas valide.", "OK"); + // return; + //} // Vérifier que l'utilisateur existe Utilisateur utilisateur = my_manager.Utilisateurs.FirstOrDefault(u => u.Email == email && u.MotDePasse == password); From bf9d9205c54ab68ff6a3eb11ea028c437f776f91 Mon Sep 17 00:00:00 2001 From: V J Date: Wed, 31 May 2023 11:12:09 +0200 Subject: [PATCH 2/5] =?UTF-8?q?connection=20+=20deconnection=20am=C3=A9lia?= =?UTF-8?q?r=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MangaMap/CustomHeader.xaml | 9 ++++++++- MangaMap/CustomHeader.xaml.cs | 5 +++++ MangaMap/MangaMap.csproj | 1 + MangaMap/Resources/Images/account_circle.png | Bin 0 -> 1428 bytes MangaMap/Views/settingsPage.xaml.cs | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 MangaMap/Resources/Images/account_circle.png diff --git a/MangaMap/CustomHeader.xaml b/MangaMap/CustomHeader.xaml index d736f8f..51fb1da 100644 --- a/MangaMap/CustomHeader.xaml +++ b/MangaMap/CustomHeader.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MangaMap.NewContent1" Background="{StaticResource Primary}"> - + + + + diff --git a/MangaMap/Resources/Images/account_circle.png b/MangaMap/Resources/Images/account_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..98f1e1429dc7fe2794c45d350a89ae77203a237c GIT binary patch literal 1428 zcmV;F1#9|=P)Px)PDw;TRA@u(nOBG{MG%I+`y!YV3Zh~_5fyXx!HkMo!JNS?M$8H-m=$wYFpDT+ zKt(b8V9sI|71S5SoWK|5lb)rvcV@ch?7eqcxCO(UGgDpN)m2^fSIrEjIn9{n>t~Jv zQ*FVSX@RAHO@VcRWy7V8Ux({W;6>ounW6k-6<7s01lSnZVBmsY16~Gh1wI-$c8q;g z1r`8K1Wo|_JsJ89xB|Ew@b@4ZMS*>QGk{gInZ5w-0lrD@(cERzy_OF5eSsCS@gD*g z19uJ4V5kCT0_SBDyae2x7XMe}M2!Nw1NR3(4*+|V z1gG~arTeFq{JE8n1a9mbTT&oj{I$R_g~d4LIAC>P{>1w`@IG)A;0E;3p1^&9Vejn! zxUqc-7#@w&O|*F$*t#(JslY`Ap6h|53p{RA!(((Z&$NcvJ_VvV4T&28-}Owq4q%pT z=x^Zj^k+q2?(pvTWQ{IyMyXel73Db>a6J>KO93;i0-7Xcq^*2?+Y z6c9;jVo7+g22jedj|1DKG1~)AbSz9Bc_n$|?IT_Dy#PCwOQ?2iOq&7+0k z3~F{Bx*3iYVw(V~T__%60hQryD#`F{n3k#zaSWriv3gc27;{Wj7&T5Cucba*GbvEelgFCQCk$UgCKmC^jQz`RFa6*GbP#C7}pT%0&}khXlz~DAkA7u76H5#O#^HI z{FJU*8S)8B?nnb{gbBgNQI`TXnM9S6IDgB+tO7uzg<#E+vX3k&1#-HlEyq537T6*& zcs6aORVk1cG(roLR8AHhb|<_>A!}c+F4-d&G%hBhKwU~K)6}Id*xgvKu (App.Current as App).MyManager; + public settingsPage() { InitializeComponent(); @@ -9,6 +12,7 @@ public partial class settingsPage : ContentPage private async void OnDisconnectClicked(object sender, EventArgs e) { + my_manager.UtilisateurActuel = new Utilisateur(); await Shell.Current.Navigation.PushAsync(new loginPage()); } From 0c259649173a6162117cdf5493d5451be6684e6c Mon Sep 17 00:00:00 2001 From: Matheo HERSAN Date: Wed, 31 May 2023 11:47:34 +0200 Subject: [PATCH 3/5] Button --- MangaMap/Views/listPage.xaml | 39 ++++++++++++++++--------------- MangaMap/Views/listPage.xaml.cs | 2 +- MangaMap/Views/loginPage.xaml | 7 +++--- MangaMap/Views/loginPage.xaml.cs | 5 ++++ MangaMap/Views/signUpPage.xaml | 4 ++-- MangaMap/Views/signUpPage.xaml.cs | 5 ++++ 6 files changed, 36 insertions(+), 26 deletions(-) diff --git a/MangaMap/Views/listPage.xaml b/MangaMap/Views/listPage.xaml index 293eb06..7f43a5b 100644 --- a/MangaMap/Views/listPage.xaml +++ b/MangaMap/Views/listPage.xaml @@ -2,7 +2,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:MangaMap" x:Class="MangaMap.Views.listPage" - BackgroundColor="Black"> + BackgroundColor="Black" +> @@ -39,24 +40,24 @@ - - - - - - - - - - - - + + + + + + + + diff --git a/MangaMap/Views/listPage.xaml.cs b/MangaMap/Views/listPage.xaml.cs index 449192f..4550dab 100644 --- a/MangaMap/Views/listPage.xaml.cs +++ b/MangaMap/Views/listPage.xaml.cs @@ -36,7 +36,7 @@ public partial class listPage : ContentPage Grid.SetRow(imageButton, ligne); Grid.SetColumn(imageButton, 0); - //grille.Children.Add(imageButton); + grille.Children.Add(imageButton); indice++; } diff --git a/MangaMap/Views/loginPage.xaml b/MangaMap/Views/loginPage.xaml index 295c48b..ddccf49 100644 --- a/MangaMap/Views/loginPage.xaml +++ b/MangaMap/Views/loginPage.xaml @@ -13,12 +13,11 @@ -