From ed44acf09338e21f9d9e090e6556e34e45b8d3eb Mon Sep 17 00:00:00 2001 From: V J Date: Wed, 26 Apr 2023 13:57:55 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9but=20du=20C#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MangaMap/MangaMap.csproj | 4 +++ MangaMap/Model/Admin.cs | 16 +++++++++ MangaMap/Model/Liste.cs | 23 ++++++++++++ MangaMap/Model/Oeuvre.cs | 33 ++++++++++++++++++ MangaMap/Model/Personne.cs | 66 +++++++++++++++++++++++++++++++++++ MangaMap/Model/Utilisateur.cs | 29 +++++++++++++++ 6 files changed, 171 insertions(+) create mode 100644 MangaMap/Model/Admin.cs create mode 100644 MangaMap/Model/Liste.cs create mode 100644 MangaMap/Model/Oeuvre.cs create mode 100644 MangaMap/Model/Personne.cs create mode 100644 MangaMap/Model/Utilisateur.cs diff --git a/MangaMap/MangaMap.csproj b/MangaMap/MangaMap.csproj index 05dcba1..38d05e2 100644 --- a/MangaMap/MangaMap.csproj +++ b/MangaMap/MangaMap.csproj @@ -82,4 +82,8 @@ + + + + diff --git a/MangaMap/Model/Admin.cs b/MangaMap/Model/Admin.cs new file mode 100644 index 0000000..a8ff102 --- /dev/null +++ b/MangaMap/Model/Admin.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MangaMap.Model +{ + class Admin + { + public int Id { get; private set; } + + public Admin(int id) + { this.Id = id; } + } +} diff --git a/MangaMap/Model/Liste.cs b/MangaMap/Model/Liste.cs new file mode 100644 index 0000000..81d04f8 --- /dev/null +++ b/MangaMap/Model/Liste.cs @@ -0,0 +1,23 @@ +using System; +using MangaMap.Model; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MangaMap.Model +{ + class Liste + { + public string Nom { get; private set; } + public int NbAnime { get; private set; } + public Oeuvre[] AnimeListe { get; private set; } + + public Liste(string nom, int nbAnime) + { + Nom = nom; + NbAnime = nbAnime; + AnimeListe = null; + } + } +} diff --git a/MangaMap/Model/Oeuvre.cs b/MangaMap/Model/Oeuvre.cs new file mode 100644 index 0000000..984e300 --- /dev/null +++ b/MangaMap/Model/Oeuvre.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MangaMap.Model +{ + class Oeuvre + { + public string Nom { get; private set; } + public string[] 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) + { + Nom = nom; + Genre = genre; + Type = type; + Description = description; + Note = note; + NbEpisodes = nbEpisode; + } + + public void AjouterEpisode(int nb) + { + NbEpisodes = NbEpisodes + nb; + } + } +} diff --git a/MangaMap/Model/Personne.cs b/MangaMap/Model/Personne.cs new file mode 100644 index 0000000..72ca6c0 --- /dev/null +++ b/MangaMap/Model/Personne.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MangaMap.Model +{ + class Personne + { + public string MotDePasse { get; private set; } + public string Email { get; private set; } + public string Pseudo { get; private set; } + + /*public Liste[] Listes { get; private set; }*/ + + public Personne(string mdp, string email, string pseudo) + { + Email = email; + Pseudo = pseudo; + MotDePasse = mdp; + } + + public bool MofifierMotDePasse(string MotDePasse) + { + string test = ""; + test = Console.ReadLine(); + + if (test == this.MotDePasse) + { + this.MotDePasse = MotDePasse.Trim(); + return true; + } + + return false; + } + + public bool MofifierEmail(string Email) + { + string test = ""; + test = Console.ReadLine(); + + if (test == this.MotDePasse) + { + this.Email = Email.Trim(); + return true; + } + + return false; + } + + public bool MofifierPseudo(string Pseudo) + { + string test = ""; + test = Console.ReadLine(); + + if (test == this.MotDePasse) + { + this.Pseudo = Pseudo.Trim(); + return true; + } + + return false; + } + } +} diff --git a/MangaMap/Model/Utilisateur.cs b/MangaMap/Model/Utilisateur.cs new file mode 100644 index 0000000..dd8010d --- /dev/null +++ b/MangaMap/Model/Utilisateur.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MangaMap.Model +{ + class Utilisateur + { + public string nom { get; private set; } + public string prenom { get; private set; } + public int age { get; private set; } + + public Utilisateur(string nom, string prenom, int age) + { + this.nom = nom; + this.prenom = prenom; + this.age = age; + } + + public void SupprimerUtilisateur() + { + this.nom = null; + this.prenom = null; + this.age = 0; + } + } +}