예제 #1
0
 public int ReturnBook(LibraryBook book)
 {
     if (!book.isInStack())
     {
         book.PutToStack();
         BookList.Remove(book);
         return(1);
     }
     return(0);
 }
예제 #2
0
파일: Program.cs 프로젝트: nskr/Lab3
        static void Main(string[] args)
        {
            Console.WriteLine("\nТест создания книги\n");
            LibraryBook newBook = new LibraryBook(BookType.Comedy, 23);

            newBook.PutToStack();
            newBook.GetFromStack();
            Reader newReader = new Reader("Mark", 1312);

            Console.WriteLine("\nТест создания полки\n");
            newBook.PutToStack();
            Console.WriteLine(newReader.TakeBook(newBook));
            Console.WriteLine(newReader.TakeBook(newBook));
            Console.WriteLine(newReader.ReturnBook(newBook));
            Console.WriteLine(newReader.ReturnBook(newBook));
            newReader[0] = newBook;
            newReader[0].PutToStack();
            newReader.Serialize("1.txt");
        }