From f8ba032476501777ec0919ef9cc7d1e01748615c Mon Sep 17 00:00:00 2001 From: Vianney JOURDY Date: Fri, 28 Apr 2023 17:08:30 +0200 Subject: [PATCH] =?UTF-8?q?je=20me=20suis=20tromp=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MangaMap/App.xaml.cs | 5 ++++- MangaMap/Model/Manager.cs | 24 +++++++++++++++++++++++- MangaMap/Model/Oeuvre.cs | 2 +- MangaMap/Model/Utilisateur.cs | 9 ++++++++- MangaMap/Views/signUpPage.xaml.cs | 8 ++++++++ 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/MangaMap/App.xaml.cs b/MangaMap/App.xaml.cs index 74ca949..96e485a 100644 --- a/MangaMap/App.xaml.cs +++ b/MangaMap/App.xaml.cs @@ -1,9 +1,12 @@ -using MangaMap.Views; +using MangaMap.Model; +using MangaMap.Views; namespace MangaMap; public partial class App : Application { + + public Manager MyManager { get; private set; } = new Manager(); public App() { InitializeComponent(); diff --git a/MangaMap/Model/Manager.cs b/MangaMap/Model/Manager.cs index 48c1d72..dd9511d 100644 --- a/MangaMap/Model/Manager.cs +++ b/MangaMap/Model/Manager.cs @@ -6,7 +6,29 @@ using System.Threading.Tasks; namespace MangaMap.Model { - internal class Manager + public class Manager { + + public List Admins { get; private set; } + public List Utilisateurs { get; private set; } + + public List Oeuvres { get; private set; } + + + + + public Manager() { + Admins = new List(); + Utilisateurs = new List(); + Oeuvres = new List(); + } + + public void ajouterUtilisateur(Utilisateur u) + { + Utilisateurs.Add(u); + } + + + } } diff --git a/MangaMap/Model/Oeuvre.cs b/MangaMap/Model/Oeuvre.cs index f506883..c8465b1 100644 --- a/MangaMap/Model/Oeuvre.cs +++ b/MangaMap/Model/Oeuvre.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace MangaMap.Model { - class Oeuvre + public class Oeuvre { public string Nom { get; private set; } public List Genre { get; private set; } diff --git a/MangaMap/Model/Utilisateur.cs b/MangaMap/Model/Utilisateur.cs index cd03369..6564567 100644 --- a/MangaMap/Model/Utilisateur.cs +++ b/MangaMap/Model/Utilisateur.cs @@ -6,14 +6,21 @@ using System.Threading.Tasks; namespace MangaMap.Model { - public class Utilisateur + public class Utilisateur : Personne { public string nom { get; private set; } public string prenom { get; private set; } public int age { get; private set; } + public List ListeOeuvreEnVisionnage { get; private set; } + public List ListeOeuvreDejaVu { get; private set; } + public List ListeOeuvrePourPlusTard { get; private set; } + public List ListeOeuvreFavorites { get; private set; } public Utilisateur(string nom, string prenom, int age) { + this.Email = "rr"; + this.Pseudo = "55"; + this.MotDePasse = "45"; this.nom = nom; this.prenom = prenom; this.age = age; diff --git a/MangaMap/Views/signUpPage.xaml.cs b/MangaMap/Views/signUpPage.xaml.cs index fc6731a..e3ba14a 100644 --- a/MangaMap/Views/signUpPage.xaml.cs +++ b/MangaMap/Views/signUpPage.xaml.cs @@ -1,8 +1,13 @@ namespace MangaMap.Views; + +using MangaMap.Model; using System.Text.RegularExpressions; public partial class signUpPage : ContentPage { + + public Manager my_manager => (App.Current as App).MyManager; + public signUpPage() { InitializeComponent(); @@ -47,6 +52,9 @@ public partial class signUpPage : ContentPage await Navigation.PushAsync(new homePage()); } + Utilisateur util = new Utilisateur("Ryan", "Garcia", 12); + my_manager.ajouterUtilisateur(util); + } bool IsPasswordStrong(string password)