public void AddToLikeList(Book book) { bool userChanged = false; if (!LikeListID.Contains(book.Name)) { LikeListID.Add(book.Name); book.Likes++; userChanged = true; } if (DislikeListID.Contains(book.Name)) { DislikeListID.Remove(book.Name); book.Dislike--; userChanged = true; } if (userChanged) { Database.EditUser(); Database.Edit(book); } }
public void RemoveFromLikeAndDislikeList(Book book) { // TODO: change book bool userChanged = false; if (LikeListID.Contains(book.Name)) { LikeListID.Remove(book.Name); book.Likes--; userChanged = true; } if (DislikeListID.Contains(book.Name)) { DislikeListID.Remove(book.Name); book.Dislike--; userChanged = true; } if (userChanged) { Database.EditUser(); Database.Edit(book); } }