From 0f995e1684a8fb48e550dfb86fc39cbb7bee784c Mon Sep 17 00:00:00 2001 From: Liam Monchanin Date: Mon, 22 May 2023 18:21:08 +0200 Subject: [PATCH] tri variables --- notus/Notus_Console/Program.cs | 69 ++++++++++++++++------------------ 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/notus/Notus_Console/Program.cs b/notus/Notus_Console/Program.cs index 8d31e45..e860497 100644 --- a/notus/Notus_Console/Program.cs +++ b/notus/Notus_Console/Program.cs @@ -2,39 +2,34 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Diagnostics; - -Console.WriteLine("Coucou"); -string Upseudo = "u"; -string Umail = "u"; -string Upassword = "u"; -string Name = "u"; -string Name2 = "u"; -string nom = "u"; -string nom2 = "u"; -string logoPath = "u"; -string choixNom = "u"; -string choixCouleur = "u"; -string pos = "u"; -string _image = "u"; -string name2 = "u"; +string Upseudo; +string Umail; +string Upassword; +string nomImag; +string linkimage; +string position; +string nomNote; +string logoPath; +string NomTag; +string color; +string nom; +string choixNom; +string choixCouleur; string choixModif; -string choix2; -string color = "u"; -string couleur = "u"; -string newColor = "u"; -string position = "u"; -string linkimage = "u"; +string _image; +string choix; +string newColor; List NewColorList; List listCouleurs; List _searchedNotes; List _searchedTags; User user = new User(Upseudo, Umail, Upassword); -NoteImage image = new NoteImage(nom2, linkimage, position); +NoteImage image = new NoteImage(nomImage, linkimage, position); Database db = new Database(); User u = new User(Upseudo, Umail, Upassword); -Note n = new Note(nom, logoPath, u); -Tags t = new Tags(nom, couleur); +Note n = new Note(nomNote, logoPath, u); +Tags t = new Tags(NomTag, color); int boucle = 0; while (boucle == 0) @@ -78,7 +73,7 @@ while (boucle == 0) switch (Console.ReadLine()) { case "1": ///Connexion - u = db.GetUser(Name); + u = db.GetUser(nom); db.FindEmail(u.GetEmail); db.ComparePassword(u.GetPassword); if (db.UserList.Contains(u)) @@ -110,7 +105,7 @@ while (boucle == 0) break; case "4":///Supprimer Compte Console.WriteLine("Chercher utilisateur"); - Name = Console.ReadLine(); + nom = Console.ReadLine(); u = db.GetUser(Name); db.FindEmail(u.GetEmail); db.ComparePassword(u.GetPassword); @@ -147,8 +142,8 @@ while (boucle == 0) case "8":///Ajouter un tag a une note Console.WriteLine("Cherchez une note"); - name2 = Console.ReadLine(); - _searchedNotes = u.SearchNoteByName(name2); + nom = Console.ReadLine(); + _searchedNotes = u.SearchNoteByName(nom); Console.WriteLine("Cherchez un tag"); nom = Console.ReadLine(); _searchedTags = u.SearchTagByName(nom); ///A voir pour faire correctement @@ -159,8 +154,8 @@ while (boucle == 0) case "9":///Supprimer un tag a une note Console.WriteLine("Cherchez une note"); - name2 = Console.ReadLine(); - _searchedNotes = u.SearchNoteByName(name2); + nom = Console.ReadLine(); + _searchedNotes = u.SearchNoteByName(nom); Console.WriteLine("Cherchez un tag"); nom = Console.ReadLine(); _searchedTags = u.SearchTagByName(nom); ///A voir pour faire correctement @@ -170,7 +165,7 @@ while (boucle == 0) break; case "10":///Ajouter une image - n.AddImage(_image, pos); + n.AddImage(_image, position); break; case "11":///Supprimer une image @@ -178,7 +173,7 @@ while (boucle == 0) break; case "12":///Deplacer une image - //n.DeplacerImage(image); + image.SetPosition(position); break; case "13":///Supprimer un tag definitivement @@ -209,8 +204,8 @@ while (boucle == 0) case "18":///Modifier un theme Console.WriteLine("Cherchez un theme a modifier"); - Name2 = Console.ReadLine(); - th = db.GetTheme(Name2); + nom = Console.ReadLine(); + th = db.GetTheme(nom); th.ChangeColor(color, newColor); db.ModifyThemeName(th, Name); db.ModifyThemeColorList(th, NewColorList); @@ -280,12 +275,12 @@ while (boucle == 0) n.VerifyPrivilege(u); if (true && choix2.Equals('0')) { - user = db.GetUser(Name); + user = db.GetUser(nom); n.AddEditor(u, user); } if (true && choix2.Equals('1')) { - user = db.GetUser(Name); + user = db.GetUser(nom); n.RemoveEditor(u, user); } break; @@ -294,7 +289,7 @@ while (boucle == 0) n.VerifyPrivilege(u); if (true) { - user = db.GetUser(Name); + user = db.GetUser(nom); n.RemoveCollaborator(u, user); } break;