diff --git a/src/MangaMap/CustomHeader.xaml b/src/MangaMap/CustomHeader.xaml index 6e9f252..a801373 100644 --- a/src/MangaMap/CustomHeader.xaml +++ b/src/MangaMap/CustomHeader.xaml @@ -21,7 +21,7 @@ IsVisible="{Binding IsUserLoggedIn}" /> @@ -35,7 +40,7 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged /// L'objet déclencheur de l'événement. /// Les arguments de l'événement. async void SettingButton_Clicked(object sender, System.EventArgs e) - { + { await Shell.Current.GoToAsync("//page/secondaire/settingsPage"); } @@ -46,6 +51,10 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged /// Les arguments de l'événement. async void AccountButton_Clicked(object sender, System.EventArgs e) { + if (my_manager.UtilisateurActuel.Email != null) + { + return; + } await Shell.Current.GoToAsync("//page/secondaire/connexionPage"); } @@ -56,6 +65,11 @@ public partial class NewContent1 : ContentView, INotifyPropertyChanged /// Les arguments de l'événement. async void ListButton_Clicked(object sender, System.EventArgs e) { + if (my_manager.UtilisateurActuel.Email == null) + { + return; + } await Navigation.PushAsync(new listPage()); + //await Shell.Current.GoToAsync("//page/secondaire/listPage"); } } \ No newline at end of file diff --git a/src/MangaMap/MangaMap.csproj b/src/MangaMap/MangaMap.csproj index 8b91f47..d3f4e1d 100644 --- a/src/MangaMap/MangaMap.csproj +++ b/src/MangaMap/MangaMap.csproj @@ -11,6 +11,16 @@ true enable + + MangaMap @@ -135,6 +145,7 @@ + diff --git a/src/MangaMap/Resources/Images/connected.png b/src/MangaMap/Resources/Images/connected.png new file mode 100644 index 0000000..4cd5f02 Binary files /dev/null and b/src/MangaMap/Resources/Images/connected.png differ diff --git a/src/MangaMap/Views/Composants/ListOeuvre.xaml b/src/MangaMap/Views/Composants/ListOeuvre.xaml index 8dc9940..2332e12 100644 --- a/src/MangaMap/Views/Composants/ListOeuvre.xaml +++ b/src/MangaMap/Views/Composants/ListOeuvre.xaml @@ -31,11 +31,12 @@ - + @@ -70,11 +71,12 @@ - + @@ -109,11 +111,12 @@ - + @@ -148,11 +151,12 @@ - + diff --git a/src/MangaMap/Views/Composants/ListOeuvre.xaml.cs b/src/MangaMap/Views/Composants/ListOeuvre.xaml.cs index 72a153e..7b1f8ae 100644 --- a/src/MangaMap/Views/Composants/ListOeuvre.xaml.cs +++ b/src/MangaMap/Views/Composants/ListOeuvre.xaml.cs @@ -1,5 +1,6 @@ namespace MangaMap.Views.Composants; using Models; +using System.Diagnostics; using System.Xml; public partial class ListOeuvre : ContentView diff --git a/src/MangaMap/Views/FicheAnime.xaml.cs b/src/MangaMap/Views/FicheAnime.xaml.cs index 8564ae1..033403f 100644 --- a/src/MangaMap/Views/FicheAnime.xaml.cs +++ b/src/MangaMap/Views/FicheAnime.xaml.cs @@ -279,7 +279,6 @@ namespace MangaMap.Views my_manager.UtilisateurActuel.notesNombres.Remove(AnimeModel.Nom, out x); x[1] = nb; my_manager.UtilisateurActuel.notesNombres.Add(AnimeModel.Nom, x); - return; } else { @@ -288,6 +287,7 @@ namespace MangaMap.Views my_manager.UtilisateurActuel.notesNombres.Add(AnimeModel.Nom, x); } + AnimeModel.NombresEpVu = nb; my_manager.sauvegarder(); } } diff --git a/src/MangaMap/Views/homePage.xaml.cs b/src/MangaMap/Views/homePage.xaml.cs index 86f369e..2b81c2e 100644 --- a/src/MangaMap/Views/homePage.xaml.cs +++ b/src/MangaMap/Views/homePage.xaml.cs @@ -52,13 +52,11 @@ namespace MangaMap.Views int imagesParLigne = 4; int indice = 0; - for (int i = 0; i < my_manager.Oeuvres.Count; i++) + foreach (Oeuvre o in my_manager.Oeuvres) { - Oeuvre favoris = my_manager.Oeuvres[i]; - ImageButton imageButton = new ImageButton { - Source = favoris.Affiche, + Source = o.Affiche, WidthRequest = 170, MaximumHeightRequest = 190, MinimumHeightRequest = 190, diff --git a/src/MangaMap/Views/loginPage.xaml.cs b/src/MangaMap/Views/loginPage.xaml.cs index 91ab0fa..e3d6b29 100644 --- a/src/MangaMap/Views/loginPage.xaml.cs +++ b/src/MangaMap/Views/loginPage.xaml.cs @@ -3,6 +3,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Stub; using Models; +using System.Diagnostics; /// /// Classe représentant la page de connexion de l'application. @@ -68,6 +69,15 @@ public partial class loginPage : ContentPage // On garde l'utilisateur qui vient de se connecter pour accéder à ses informations my_manager.UtilisateurActuel = utilisateur; + List x; + foreach (Oeuvre o in my_manager.Oeuvres) + { + if (my_manager.UtilisateurActuel.notesNombres.TryGetValue(o.Nom, out x)) + o.NombresEpVu = x[1]; + else + o.NombresEpVu = 0; + } + // Rediriger l'utilisateur vers la page principale await Shell.Current.GoToAsync("//page/homePage"); } diff --git a/src/MangaMap/Views/settingsPage.xaml.cs b/src/MangaMap/Views/settingsPage.xaml.cs index bbbdc24..e85426d 100644 --- a/src/MangaMap/Views/settingsPage.xaml.cs +++ b/src/MangaMap/Views/settingsPage.xaml.cs @@ -28,6 +28,12 @@ public partial class settingsPage : ContentPage { my_manager.UtilisateurActuel = new Utilisateur(); my_manager.isAdmin = false; + + foreach (Oeuvre o in my_manager.Oeuvres) + { + o.NombresEpVu = 999; + } + await Shell.Current.GoToAsync("//page/secondaire/connexionPage"); } diff --git a/src/Models/Oeuvre.cs b/src/Models/Oeuvre.cs index f8295e9..6858482 100644 --- a/src/Models/Oeuvre.cs +++ b/src/Models/Oeuvre.cs @@ -74,6 +74,9 @@ namespace Models [DataMember] public string Affiche { get; private set; } + [DataMember] + public int NombresEpVu { get; set; } + /// /// Initialise une nouvelle instance de la classe Oeuvre avec les informations spécifiées. ///