|
|
|
@ -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<string> NewColorList;
|
|
|
|
|
List<string> listCouleurs;
|
|
|
|
|
List<Note> _searchedNotes;
|
|
|
|
|
List<Tags> _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;
|
|
|
|
|