|
|
|
@ -55,11 +55,11 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// rechercher une note dans la liste de note de l'utilisateur
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Note> SearchNoteByName(string name)
|
|
|
|
|
public List<Note> SearchNoteByName(List<Note> ToResearchIntoList, string name)
|
|
|
|
|
{
|
|
|
|
|
List<Note> searchedNotes = new List<Note>();
|
|
|
|
|
string search = name.ToLower();
|
|
|
|
|
foreach (Note note in NoteList)
|
|
|
|
|
foreach (Note note in ToResearchIntoList)
|
|
|
|
|
{
|
|
|
|
|
if (note.GetName().ToLower().Contains(search))
|
|
|
|
|
{
|
|
|
|
@ -72,11 +72,11 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// rechercher une note dans la liste de note favoris de l'utilisateur
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Note> SearchFavoriteNoteByName(string name)
|
|
|
|
|
public List<Note> SearchFavoriteNoteByName(List<Note> ToResearchIntoList, string name)
|
|
|
|
|
{
|
|
|
|
|
List<Note> searchedNotes = new List<Note>();
|
|
|
|
|
string search = name.ToLower();
|
|
|
|
|
foreach (Note note in FavList)
|
|
|
|
|
foreach (Note note in ToResearchIntoList)
|
|
|
|
|
{
|
|
|
|
|
if (note.GetName().ToLower().Contains(search))
|
|
|
|
|
{
|
|
|
|
@ -89,11 +89,11 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// rechercher un tag dans la liste de tag de l'utilisateur
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<Tags> SearchTagByName(string name)
|
|
|
|
|
public List<Tags> SearchTagByName(List<Tags> ToResearchIntoList, string name)
|
|
|
|
|
{
|
|
|
|
|
List<Tags> searchedTags = new List<Tags>();
|
|
|
|
|
string search = name.ToLower();
|
|
|
|
|
foreach (Tags tag in TagList)
|
|
|
|
|
foreach (Tags tag in ToResearchIntoList)
|
|
|
|
|
{
|
|
|
|
|
if (tag.GetName().ToLower().Contains(search))
|
|
|
|
|
{
|
|
|
|
@ -109,7 +109,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
string search = name.ToLower();
|
|
|
|
|
foreach (Note note in ToResearchIntoList)
|
|
|
|
|
{
|
|
|
|
|
if (note.GetName().ToLower().Contains(search) && note.GetCreationDate() >= FirstDate && note.GetCreationDate() <= SecondeDate)
|
|
|
|
|
if (note.GetName().ToLower().Contains(search) && note.GetCreationDate() >= FirstDate && note.GetCreationDate() <= SecondeDate || note.GetModificationDate() >= FirstDate && note.GetModificationDate() <= SecondeDate)
|
|
|
|
|
{
|
|
|
|
|
searchedNotes.Add(note);
|
|
|
|
|
}
|
|
|
|
@ -164,16 +164,16 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// supprimer une note
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DeleteNote(string name)
|
|
|
|
|
public void DeleteNote(string note)
|
|
|
|
|
{
|
|
|
|
|
foreach (Note note in NoteList)
|
|
|
|
|
foreach (Note existingNote in NoteList)
|
|
|
|
|
{
|
|
|
|
|
if (note.GetName() == name)
|
|
|
|
|
if (existingNote.GetName() == note)
|
|
|
|
|
{
|
|
|
|
|
NoteList.Remove(note);
|
|
|
|
|
NoteTagged.Remove(note);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
NoteList.Remove(existingNote);
|
|
|
|
|
NoteTagged.Remove(existingNote);
|
|
|
|
|
return;
|
|
|
|
|
}else
|
|
|
|
|
{
|
|
|
|
|
throw new NotFoundException("Note not found");
|
|
|
|
|
}
|
|
|
|
|