|
|
|
@ -34,47 +34,47 @@ namespace Biblioteque_de_Class
|
|
|
|
|
owner = uOwner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// public Note RechercherNote(List<Note> listeNote, string nom)
|
|
|
|
|
/// {
|
|
|
|
|
/// List<Note> newListNote = new List<Note>();
|
|
|
|
|
/// foreach (Note note in listeNote)
|
|
|
|
|
/// {
|
|
|
|
|
/// if (note.Nom == nom)
|
|
|
|
|
/// {
|
|
|
|
|
///
|
|
|
|
|
/// }
|
|
|
|
|
/// }
|
|
|
|
|
/// return newListNote;
|
|
|
|
|
/// }
|
|
|
|
|
|
|
|
|
|
public override string ToString() => $"note -> nom : {Nom}\nlogoPATH : {LogoPATH}\nhow many line : {listeLigneTexte.Count()}";
|
|
|
|
|
|
|
|
|
|
public void AjouterTag(List<Tags> listNote, string name) {
|
|
|
|
|
foreach(Tags tag in listNote)
|
|
|
|
|
{
|
|
|
|
|
if(tag.Nom == name)
|
|
|
|
|
{
|
|
|
|
|
atributionTag.Add(tag);
|
|
|
|
|
}
|
|
|
|
|
foreach(Tags tag in listNote){
|
|
|
|
|
if(tag.Nom == name) { atributionTag.Add(tag); }
|
|
|
|
|
}
|
|
|
|
|
throw new Exception("no tag find with this name");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SupTag(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(Tags tag in atributionTag)
|
|
|
|
|
{
|
|
|
|
|
if(tag.Nom == name)
|
|
|
|
|
{
|
|
|
|
|
atributionTag.Remove(tag);
|
|
|
|
|
}
|
|
|
|
|
public void SupTag(string name){
|
|
|
|
|
foreach(Tags tag in atributionTag){
|
|
|
|
|
if(tag.Nom == name) { atributionTag.Remove(tag); }
|
|
|
|
|
}
|
|
|
|
|
throw new Exception("no tag find with this name");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool VerifOwner(Utilisateur user) {
|
|
|
|
|
|
|
|
|
|
return ;
|
|
|
|
|
if (user == owner) { return true; }
|
|
|
|
|
else { return false; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AjouterCoop(Utilisateur user) {
|
|
|
|
|
if (VerifOwner(user)) { cooperateurs.Add(user); }
|
|
|
|
|
else { throw new Exception("user is not owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SupCoop(Utilisateur user) {
|
|
|
|
|
if (VerifOwner(user)) { cooperateurs.Remove(user); }
|
|
|
|
|
else { throw new Exception("user is not owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AjouterEdit(Utilisateur user) {
|
|
|
|
|
if (VerifOwner(user)) { editeurs.Add(user); }
|
|
|
|
|
else { throw new Exception("user is not owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SupEdit(Utilisateur user) {
|
|
|
|
|
if (VerifOwner(user)) { editeurs.Remove(user); }
|
|
|
|
|
else { throw new Exception("user is not owner"); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|