Exemple #1
0
        static void AddBook()
        {
            Book book = new Book();

            Console.Write("Enter the book ID : ");
            book.BookID = int.Parse(Console.ReadLine());
            Console.Write("Enter the book name : ");
            book.BookName = Console.ReadLine();
            Console.Write("Enter the author name : ");
            book.AuthorName = Console.ReadLine();
            Console.Write("Enter the publisher name : ");
            book.Publisher = Console.ReadLine();
            Console.Write("Enter the number of this book : ");
            book.NoOfCopies = int.Parse(Console.ReadLine());
            Console.Write("Enter the book price : ");
            book.Price = int.Parse(Console.ReadLine());

            //insert using Business Layer
            BusinessLayer bll = new BusinessLayer();

            bll.AddBook(book);
            Console.WriteLine("Record inserted successfully");
        }