|
|
@ -21,6 +21,9 @@ namespace Biblioteque_de_Class
|
|
|
|
Mail = Umail;
|
|
|
|
Mail = Umail;
|
|
|
|
Password = Upassword;
|
|
|
|
Password = Upassword;
|
|
|
|
NoteList = new List<Note>();
|
|
|
|
NoteList = new List<Note>();
|
|
|
|
|
|
|
|
TagList = new List<Tags>();
|
|
|
|
|
|
|
|
FavList = new List<Note>();
|
|
|
|
|
|
|
|
NoteTaged = new Dictionary<Note, List<Tags>>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetPseudo() { return Pseudo; }
|
|
|
|
public string GetPseudo() { return Pseudo; }
|
|
|
@ -106,11 +109,9 @@ namespace Biblioteque_de_Class
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void CreateNote(string nom, string LogoPath)
|
|
|
|
public void CreateNote(string nom, string LogoPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Note> NoteList = this.GetNoteList();
|
|
|
|
foreach (Note eachnote in NoteList)
|
|
|
|
Dictionary<Note, List<Tags>> NoteTaged = this.GetNoteTaged();
|
|
|
|
|
|
|
|
foreach (Note note in NoteList)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (note.GetNom() == nom)
|
|
|
|
if (eachnote.GetNom() == nom)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception("Note already exist");
|
|
|
|
throw new Exception("Note already exist");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -160,8 +161,7 @@ namespace Biblioteque_de_Class
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void AddOneTagToNoteList(Note note, Tags tagtoadd)
|
|
|
|
public void AddOneTagToNoteList(Note note, Tags tagtoadd)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Tags> ListTags = this.GetTagList();
|
|
|
|
if (TagList.Contains(tagtoadd) == false) { throw new Exception("Tag not found"); }
|
|
|
|
if (ListTags.Contains(tagtoadd) == false) { throw new Exception("Tag not found"); }
|
|
|
|
|
|
|
|
if(NoteList.Contains(note) == false) { throw new Exception("Note not found"); }
|
|
|
|
if(NoteList.Contains(note) == false) { throw new Exception("Note not found"); }
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -174,8 +174,7 @@ namespace Biblioteque_de_Class
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void SupOneTagToNoteList(Note note, Tags tagtosup)
|
|
|
|
public void SupOneTagToNoteList(Note note, Tags tagtosup)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Tags> ListTags = this.GetTagList();
|
|
|
|
if (TagList.Contains(tagtosup) == false) { throw new Exception("Tag not found"); }
|
|
|
|
if (ListTags.Contains(tagtosup) == false) { throw new Exception("Tag not found"); }
|
|
|
|
|
|
|
|
if(NoteList.Contains(note) == false) { throw new Exception("Note not found"); }
|
|
|
|
if(NoteList.Contains(note) == false) { throw new Exception("Note not found"); }
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|