コード例 #1
0
        public static void FoundBook()
        {
            string name;
            string autor;

            Console.WriteLine("Please enter information about book \n");
            Console.WriteLine("Name of book: ");
            name = Console.ReadLine();
            Console.WriteLine("Autor of book: ");
            autor = Console.ReadLine();
            List <BookAll> booklist = MainPro.OpenListBooks();

            Console.WriteLine("Information about this book \n");
            foreach (BookAll book in booklist)
            {
                if (book.NameB == name && book.AutorB == autor)
                {
                    Console.WriteLine("Name: " + book.NameB);
                    Console.WriteLine("Autor: " + book.AutorB);
                    Console.WriteLine("Ganre: " + book.GanreB);
                    Console.WriteLine("PersonState: " + book.PersonStateB);
                    Console.WriteLine("\n");
                }
            }
        }
コード例 #2
0
        public static void AllBooks()
        {
            Console.WriteLine("All books: \n");

            List <BookAll> booklist = MainPro.OpenListBooks();

            foreach (BookAll book in booklist)
            {
                Console.WriteLine("Name: " + book.NameB);
                Console.WriteLine("Autor: " + book.AutorB);
                Console.WriteLine("Ganre: " + book.GanreB);
                Console.WriteLine("PersonState: " + book.PersonStateB);
                Console.WriteLine("\n");
            }
        }
コード例 #3
0
        public static void FoundBookGanre()
        {
            string ganre;

            Console.WriteLine("Please enter information about book \n");
            Console.WriteLine("Ganre of book: ");
            ganre = Console.ReadLine();

            List <BookAll> booklist = MainPro.OpenListBooks();

            Console.WriteLine("Books \n");
            foreach (BookAll book in booklist)
            {
                if (book.GanreB == ganre)
                {
                    Console.WriteLine("Name: " + book.NameB);
                    Console.WriteLine("Autor: " + book.AutorB);
                    Console.WriteLine("Ganre: " + book.GanreB);
                    Console.WriteLine("PersonState: " + book.PersonStateB);
                    Console.WriteLine("\n");
                }
            }
        }
コード例 #4
0
        public void Convert(int val)
        {
            if (val == 1)
            {
                Console.WriteLine(" h - help \n a - account \n f - found book \n p - print book \n d - do order \n t - take a book \n r - return book \n c - timetable \n b - add book \n o - all books \n");
            }
            else if (val == 2)
            {
                MainPro.Enter();
            }

            else if (val == 3)
            {
                FoundBookMenu();
            }
            else if (val == 4)
            {
                ChooseAgen();
                PrintBookAll();
            }
            else if (val == 5)
            {
                DoOrder();
            }
            else if (val == 6)
            {
                string name;
                string autor;

                Console.WriteLine("Please enter information about book \n");
                Console.WriteLine("Name of book: ");
                name = Console.ReadLine();
                Console.WriteLine("Autor of book: ");
                autor = Console.ReadLine();

                String loginP;
                string passwordP;
                Console.WriteLine("Login: "******"Password: "******"Try again");
                        }
                    }
                }
            }
            else if (val == 7)
            {
                string name;
                string autor;

                Console.WriteLine("Please enter information about book \n");
                Console.WriteLine("Name of book: ");
                name = Console.ReadLine();
                Console.WriteLine("Autor of book: ");
                autor = Console.ReadLine();

                String loginP;
                string passwordP;
                Console.WriteLine("Login: "******"Password: "******"Try again");
                        }
                    }
                }
            }
            else if (val == 8)
            {
                MainPro.Room();
            }
            else if (val == 9)
            {
                MainPro.AddBook();
            }
            else if (val == 10)
            {
                AllBooks();
            }

            else
            {
                Console.WriteLine("ERROR");
            }
        }