Beispiel #1
0
        //razor - hàm chi cho phép update so luong sach = 0
        //vi thong tin sach con duoc dung trong thong tin hoa don
        public static void deleteBook(Book bookinfo)
        {
            int book_index = MyBookStore.findIndex(bookinfo.bookID);

            MyBookStore.mybs[book_index].bookQty = 0;

            bookinfo.bookQty = 0;
            Bookrw.Bookupdate(bookinfo, book_index);
        }
Beispiel #2
0
        //razor - hàm cho phép chỉnh sửa thông tin sách theo mã sách
        public static void updateBook(Book bookinfo)
        {
            //get lib index of the candidate book for modifying
            int book_index = MyBookStore.findIndex(bookinfo.bookID);

            MyBookStore.mybs[book_index].bookName      = bookinfo.bookName;
            MyBookStore.mybs[book_index].bookPublisher = bookinfo.bookPublisher;
            MyBookStore.mybs[book_index].bookYear      = bookinfo.bookYear;
            MyBookStore.mybs[book_index].bookCat       = bookinfo.bookCat;
            MyBookStore.mybs[book_index].bookQty       = bookinfo.bookQty;
            MyBookStore.mybs[book_index].bookPriceTag  = bookinfo.bookPriceTag;
            MyBookStore.mybs[book_index].bookQty       = bookinfo.bookQty;
            Bookrw.Bookupdate(bookinfo, book_index);
        }