示例#1
0
        public static bool UpdateBookGenreID(int id, BookGenre genre)
        {
            if (_bookGenre.ContainsKey(id))
            {
                _bookGenre[id] = genre;
                return(true);
            }

            return(false);
        }
示例#2
0
        public static bool UpdateBookByID(int id, Book book, BookGenre bookGenre)
        {
            if (_books.ContainsKey(id))
            {
                _books[id] = book;
                _authors[book.AuthorID]  = book.Author;
                _bookGenre[book.GenreID] = book.Genre;
                return(true);
            }

            return(false);
        }
示例#3
0
 public static BookGenre AddBookGenre(BookGenre type)
 {
     type.ID = _bookGenre.Keys.Max() + 1;
     _bookGenre.Add(type.ID, type);
     return(type);
 }