public void AddBook(TypeOfBooks book)
 {
     for (int index = 0; index < invoice.Rows.Count; index++)
     {
         if (((string)invoice.Rows[index]["Tên sách"]) == book.Name)
         {
             invoice.Rows[index]["Số lượng"]   = ((int)invoice.Rows[index]["Số lượng"]) + 1;
             invoice.Rows[index]["Thành tiền"] = ((int)invoice.Rows[index]["Đơn giá"]) * ((int)invoice.Rows[index]["Số lượng"]);
             UpdateThanhTien();
             return;
         }
     }
     invoice.Rows.Add(book.Name, 1, book.Price, book.Price);
     UpdateThanhTien();
 }
Exemple #2
0
        private void MyBtn_Click(object sender, EventArgs e)
        {
            TypeOfBooks selectedBook = ((BookButton)sender).MyBook;

            AddSelfHelpBook(selectedBook);
        }
Exemple #3
0
 public void AddImage(TypeOfBooks book)
 {
     pictureBox_AnhSach.Image = book.myImage;
 }