Exemple #1
0
        /*
         * Nhập thông tin sản phẩm
         */
        public void EnterBook()
        {
            //Nhập số lượng sp
            Console.Write("+ Enter number of book: ");
            int num = S_Manager.checkInt();

            for (int i = 0; i < num; i++)
            {
                Sach sach = new Sach();
                Console.WriteLine("-Book {0}:", i + 1);
                //nhập id sach
                Console.Write("\t--Please enter id of book: ");
                sach.IdSach = S_Manager.checkid();
                //nhập tên sach
                Console.Write("\t--Please enter title of book:");
                sach.TieuDe = S_Manager.checkname();
                //nhập giá sach
                Console.Write("\t--Please enter publishing year: ");
                sach.NamXB = S_Manager.checkDateofBook();
                //nhập số lượng sp
                Console.Write("\t--Please enter price of book: ");
                sach.GiaTien = S_Manager.checkPrice();
                //thêm Sach vào arraylist
                listSV.Add(sach);
                Console.WriteLine("\nBook added success!");
            }
        }
Exemple #2
0
        /*
         * Hiển thị menu ra
         * return choicr from user
         */
        public int Menu()
        {
            Console.WriteLine("\n----------MENU----------");
            Console.WriteLine("1.Input Book Information.");
            Console.WriteLine("2.Show list book information.");
            Console.WriteLine("0.Exit and store data to file.");
            Console.Write("Please choose: ");
            int choose = S_Manager.checkInt();

            return(choose);
        }