|
|
@ -1,6 +1,7 @@
|
|
|
|
using Biblioteque_de_Class;
|
|
|
|
using Biblioteque_de_Class;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
|
|
|
|
|
|
string Upseudo = "u";
|
|
|
|
string Upseudo = "u";
|
|
|
|
string Umail = "u";
|
|
|
|
string Umail = "u";
|
|
|
@ -11,18 +12,22 @@ string position = "u";
|
|
|
|
string nomNote = "u";
|
|
|
|
string nomNote = "u";
|
|
|
|
string logoPath = "u";
|
|
|
|
string logoPath = "u";
|
|
|
|
string NomTag = "u";
|
|
|
|
string NomTag = "u";
|
|
|
|
string color = "u";
|
|
|
|
|
|
|
|
string nom = "u";
|
|
|
|
string nom = "u";
|
|
|
|
string choixNom;
|
|
|
|
string choixNom;
|
|
|
|
string choixCouleur;
|
|
|
|
string choixCouleur;
|
|
|
|
string choixModif;
|
|
|
|
string choixModif;
|
|
|
|
string _image = "u";
|
|
|
|
string _image = "u";
|
|
|
|
string choix = "u";
|
|
|
|
string choix;
|
|
|
|
string newColor = "u";
|
|
|
|
string newColor = "u";
|
|
|
|
List<string> NewColorList;
|
|
|
|
string color = "u";
|
|
|
|
List<string> listCouleurs;
|
|
|
|
string color2;
|
|
|
|
|
|
|
|
string color3;
|
|
|
|
|
|
|
|
List<string> NewColorList = new List<string> { };
|
|
|
|
|
|
|
|
List<string> listCouleurs = new List<string> { };
|
|
|
|
List<Note> _searchedNotes;
|
|
|
|
List<Note> _searchedNotes;
|
|
|
|
|
|
|
|
List<Note> NoteListe;
|
|
|
|
List<Tags> _searchedTags;
|
|
|
|
List<Tags> _searchedTags;
|
|
|
|
|
|
|
|
List<User> UserListe;
|
|
|
|
|
|
|
|
|
|
|
|
User user = new User(Upseudo, Umail, Upassword);
|
|
|
|
User user = new User(Upseudo, Umail, Upassword);
|
|
|
|
NoteImage image = new NoteImage(nomImage, linkimage, position);
|
|
|
|
NoteImage image = new NoteImage(nomImage, linkimage, position);
|
|
|
@ -73,12 +78,17 @@ while (boucle == 0)
|
|
|
|
switch (Console.ReadLine())
|
|
|
|
switch (Console.ReadLine())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case "1": ///Connexion
|
|
|
|
case "1": ///Connexion
|
|
|
|
|
|
|
|
Console.WriteLine("Entrez votre nom.");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
u = db.GetUser(nom);
|
|
|
|
u = db.GetUser(nom);
|
|
|
|
db.FindEmail(u.GetEmail);
|
|
|
|
Umail = u.GetEmail();
|
|
|
|
db.ComparePassword(u.GetPassword);
|
|
|
|
Upassword = u.GetPassword();
|
|
|
|
if (db.UserList.Contains(u))
|
|
|
|
db.FindEmail(Umail);
|
|
|
|
|
|
|
|
db.ComparePassword(u,Upassword);
|
|
|
|
|
|
|
|
UserListe = db.GetUserList();
|
|
|
|
|
|
|
|
if (UserListe.Contains(u))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
u.SetsConnected(true);
|
|
|
|
u.SetIsConnected(true);
|
|
|
|
Console.WriteLine("Connecté");
|
|
|
|
Console.WriteLine("Connecté");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -106,10 +116,13 @@ while (boucle == 0)
|
|
|
|
case "4":///Supprimer Compte
|
|
|
|
case "4":///Supprimer Compte
|
|
|
|
Console.WriteLine("Chercher utilisateur");
|
|
|
|
Console.WriteLine("Chercher utilisateur");
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
u = db.GetUser(Name);
|
|
|
|
u = db.GetUser(nom);
|
|
|
|
db.FindEmail(u.GetEmail);
|
|
|
|
Umail = u.GetEmail();
|
|
|
|
db.ComparePassword(u.GetPassword);
|
|
|
|
db.FindEmail(Umail);
|
|
|
|
if (db.UserList.Contains(u))
|
|
|
|
Upassword = u.GetPassword();
|
|
|
|
|
|
|
|
db.ComparePassword(u,Upassword);
|
|
|
|
|
|
|
|
UserListe = db.GetUserList();
|
|
|
|
|
|
|
|
if (UserListe.Contains(u))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
db.RemoveUser(u);
|
|
|
|
db.RemoveUser(u);
|
|
|
|
Console.WriteLine("Compte supprimé avec succès.");
|
|
|
|
Console.WriteLine("Compte supprimé avec succès.");
|
|
|
@ -128,6 +141,8 @@ while (boucle == 0)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "6":///Supprimer une note
|
|
|
|
case "6":///Supprimer une note
|
|
|
|
|
|
|
|
Console.WriteLine("Cherchez une note");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
u.SearchNoteByName(nom);
|
|
|
|
u.SearchNoteByName(nom);
|
|
|
|
u.DeleteNote(n);
|
|
|
|
u.DeleteNote(n);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -187,14 +202,27 @@ while (boucle == 0)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "15":///Supprimer une note des favoris
|
|
|
|
case "15":///Supprimer une note des favoris
|
|
|
|
|
|
|
|
Console.WriteLine("Chercher note");
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
u.SearchNoteByName(nom);
|
|
|
|
u.SearchFavoriteNoteByName(nom);
|
|
|
|
u.RemoveFavorite(n);
|
|
|
|
u.RemoveFavorite(n);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "16":///Creer un theme
|
|
|
|
case "16":///Creer un theme
|
|
|
|
|
|
|
|
Console.WriteLine("Choisissez un nom pour votre theme");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
|
|
|
|
Console.WriteLine("Choisissez trois couleurs");
|
|
|
|
|
|
|
|
color = Console.ReadLine();
|
|
|
|
|
|
|
|
color2 = Console.ReadLine();
|
|
|
|
|
|
|
|
color3 = Console.ReadLine();
|
|
|
|
|
|
|
|
listCouleurs.Add(color);
|
|
|
|
|
|
|
|
listCouleurs.Add(color2);
|
|
|
|
|
|
|
|
listCouleurs.Add(color3);
|
|
|
|
Theme th = new Theme(nom, listCouleurs);
|
|
|
|
Theme th = new Theme(nom, listCouleurs);
|
|
|
|
db.AddTheme(th);
|
|
|
|
db.AddTheme(th);
|
|
|
|
|
|
|
|
listCouleurs.RemoveAt(1);
|
|
|
|
|
|
|
|
listCouleurs.RemoveAt(1);
|
|
|
|
|
|
|
|
listCouleurs.RemoveAt(1);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "17":///Supprimer un theme
|
|
|
|
case "17":///Supprimer un theme
|
|
|
@ -207,14 +235,25 @@ while (boucle == 0)
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
th = db.GetTheme(nom);
|
|
|
|
th = db.GetTheme(nom);
|
|
|
|
th.ChangeColor(color, newColor);
|
|
|
|
th.ChangeColor(color, newColor);
|
|
|
|
db.ModifyThemeName(th, Name);
|
|
|
|
db.ModifyThemeName(th,nom);
|
|
|
|
|
|
|
|
Console.WriteLine("Choisissez trois couleurs");
|
|
|
|
|
|
|
|
color = Console.ReadLine();
|
|
|
|
|
|
|
|
color2 = Console.ReadLine();
|
|
|
|
|
|
|
|
color3 = Console.ReadLine();
|
|
|
|
|
|
|
|
NewColorList.Add(color);
|
|
|
|
|
|
|
|
NewColorList.Add(color2);
|
|
|
|
|
|
|
|
NewColorList.Add(color3);
|
|
|
|
db.ModifyThemeColorList(th, NewColorList);
|
|
|
|
db.ModifyThemeColorList(th, NewColorList);
|
|
|
|
|
|
|
|
NewColorList.RemoveAt(1);
|
|
|
|
|
|
|
|
NewColorList.RemoveAt(1);
|
|
|
|
|
|
|
|
NewColorList.RemoveAt(1);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "19":///Rechercher une note
|
|
|
|
case "19":///Rechercher une note
|
|
|
|
Console.WriteLine("Cherchez une note");
|
|
|
|
Console.WriteLine("Cherchez une note");
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
u.SearchNoteByName(u.NoteList, nom);
|
|
|
|
NoteListe = u.GetNoteList();
|
|
|
|
|
|
|
|
u.SearchNoteByName(nom);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "20":///Recherche note par tag
|
|
|
|
case "20":///Recherche note par tag
|
|
|
@ -228,8 +267,10 @@ while (boucle == 0)
|
|
|
|
case "22":///Modifier un tag
|
|
|
|
case "22":///Modifier un tag
|
|
|
|
Console.WriteLine("Cherchez un tag");
|
|
|
|
Console.WriteLine("Cherchez un tag");
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
|
|
|
|
Console.WriteLine("Choisisez une couleur");
|
|
|
|
|
|
|
|
color = Console.ReadLine();
|
|
|
|
t.SetName(nom);
|
|
|
|
t.SetName(nom);
|
|
|
|
t.SetColor();
|
|
|
|
t.SetColor(color);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "23":///Modifier le compte
|
|
|
|
case "23":///Modifier le compte
|
|
|
@ -237,23 +278,30 @@ while (boucle == 0)
|
|
|
|
choixModif = Console.ReadLine();
|
|
|
|
choixModif = Console.ReadLine();
|
|
|
|
if (choixModif.Equals('0'))
|
|
|
|
if (choixModif.Equals('0'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
u.SetUsername();
|
|
|
|
Console.WriteLine("Entrez votre nouveau pseudo");
|
|
|
|
|
|
|
|
Upseudo = Console.ReadLine();
|
|
|
|
|
|
|
|
u.SetUsername(Upseudo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (choixModif.Equals('1'))
|
|
|
|
if (choixModif.Equals('1'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
u.SetPassword();
|
|
|
|
Console.WriteLine("Entrez votre nouveau mot de passe");
|
|
|
|
|
|
|
|
Upassword = Console.ReadLine();
|
|
|
|
|
|
|
|
u.SetPassword(Upassword);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (choixModif.Equals('2'))
|
|
|
|
if (choixModif.Equals('2'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
u.SetEmail();
|
|
|
|
Console.WriteLine("Entrez votre nouvelle adresse mail");
|
|
|
|
|
|
|
|
Umail = Console.ReadLine();
|
|
|
|
|
|
|
|
u.SetEmail(Umail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "24":///Modifier le texte de la note mais jsp c'est quoi qu'il faut set
|
|
|
|
case "24":///Modifier le texte de la note
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
if (true)
|
|
|
|
if (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
n.SetTextLineList();
|
|
|
|
string texte = Console.ReadLine();
|
|
|
|
|
|
|
|
n.SetTextLine(texte);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -265,6 +313,9 @@ while (boucle == 0)
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
if (true)
|
|
|
|
if (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine("Saisissez un utilisateur");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
n.AddCollaborator(u, user);
|
|
|
|
n.AddCollaborator(u, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -275,11 +326,15 @@ while (boucle == 0)
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
if (true && choix.Equals('0'))
|
|
|
|
if (true && choix.Equals('0'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine("Saisissez un utilisateur");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
n.AddEditor(u, user);
|
|
|
|
n.AddEditor(u, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (true && choix.Equals('1'))
|
|
|
|
if (true && choix.Equals('1'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine("Saisissez un utilisateur");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
n.RemoveEditor(u, user);
|
|
|
|
n.RemoveEditor(u, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -289,6 +344,8 @@ while (boucle == 0)
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
n.VerifyPrivilege(u);
|
|
|
|
if (true)
|
|
|
|
if (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Console.WriteLine("Saisissez un utilisateur");
|
|
|
|
|
|
|
|
nom = Console.ReadLine();
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
user = db.GetUser(nom);
|
|
|
|
n.RemoveCollaborator(u, user);
|
|
|
|
n.RemoveCollaborator(u, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|