|
|
|
@ -110,7 +110,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
{
|
|
|
|
|
if (FavList.Contains(note))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Note already in favorites");
|
|
|
|
|
throw new AlreadyExistException("Note already in favorites");
|
|
|
|
|
}
|
|
|
|
|
FavList.Add(note);
|
|
|
|
|
}
|
|
|
|
@ -126,7 +126,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new NullReferenceException("Note not found");
|
|
|
|
|
throw new NotFoundException("Note not found");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -139,7 +139,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
{
|
|
|
|
|
if (existingNote.GetName() == name)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Note already exists");
|
|
|
|
|
throw new AlreadyExistException("Note already exists");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Note note = new Note(name, imagePath, this);
|
|
|
|
@ -159,7 +159,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new NullReferenceException("Note not found");
|
|
|
|
|
throw new NotFoundException("Note not found");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -172,7 +172,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
{
|
|
|
|
|
if (tag.GetName() == name)
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Tag already exists");
|
|
|
|
|
throw new AlreadyExistException("Tag already exists");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
TagList.Add(new Tags(name, color));
|
|
|
|
@ -200,11 +200,11 @@ namespace Biblioteque_de_Class
|
|
|
|
|
{
|
|
|
|
|
if (!TagList.Contains(tagToAdd))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Tag not found");
|
|
|
|
|
throw new NotFoundException("Tag not found");
|
|
|
|
|
}
|
|
|
|
|
if (!NoteList.Contains(note))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Note not found");
|
|
|
|
|
throw new NotFoundException("Note not found");
|
|
|
|
|
}
|
|
|
|
|
NoteTagged[note].Add(tagToAdd);
|
|
|
|
|
}
|
|
|
|
@ -216,11 +216,11 @@ namespace Biblioteque_de_Class
|
|
|
|
|
{
|
|
|
|
|
if (!TagList.Contains(tagToRemove))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Tag not found");
|
|
|
|
|
throw new NotFoundException("Tag not found");
|
|
|
|
|
}
|
|
|
|
|
if (!NoteList.Contains(note))
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("Note not found");
|
|
|
|
|
throw new NotFoundException("Note not found");
|
|
|
|
|
}
|
|
|
|
|
NoteTagged[note].Remove(tagToRemove);
|
|
|
|
|
}
|
|
|
|
|