Пример #1
0
        private static BookClass[] InitializeBookLibary()
        {
            BookClass[] list = new BookClass[4];

            for (int i = 0; i < list.Length; i++)
            {
                list[i] = new BookClass();
            }


            return(list);
        }
Пример #2
0
        static void Main(string[] args)
        {
            BookClass[] books     = InitializeBookLibary();
            string      isbnInput = "";

            OptionMenu.DisplayMenuOnConsole();
            int option = 0;

            do
            {
                Console.WriteLine("Enter Menu Option");
                option = Convert.ToInt32(Console.ReadLine());

                switch (option)
                {
                case OptionMenu.PrintMenu:
                    OptionMenu.DisplayMenuOnConsole();
                    break;

                case OptionMenu.PrintBookList:
                    PrintBookList(books);
                    break;

                case OptionMenu.InsertBook:
                    InsertBooks(books);
                    break;


                case OptionMenu.FindBook:

                    findbook(books, isbnInput);

                    break;

                case OptionMenu.UpdateBook:

                    BookClass book = findbook(books, isbnInput);

                    updatebook(book);
                    //book.Update();


                    break;

                case OptionMenu.Exit:
                    Console.WriteLine("Goodbye");
                    break;
                }
            } while (option != OptionMenu.Exit);
        }
Пример #3
0
 private static void updatebook(BookClass book)
 {
     book.getUserInput();
 }