private void btnFindBook_Click(object sender, EventArgs e)
        {
            List <Book> books = DBConnection.findBook(txtISBN.Text);

            foreach (var b in books)
            {
                txtaDisplay.Text = b.GetDisplayText(" - ");
            }
        }
Esempio n. 2
0
        private void btnFind_Click(object sender, EventArgs e)
        {
            List <Book> books = DBConnection.findBook(txtSearchBook.Text);

            foreach (var b in books)
            {
                rchDispaly.Text = b.GetDisplayText(" - ");
            }
        }
        private void cmboBook_SelectedIndexChanged(object sender, EventArgs e)
        {
            listDisplay.Items.Clear();
            var    tmp  = cmboBook.SelectedItem.ToString().Split(',');
            string isbn = tmp[0].Replace("ISBN:", "");

            txtSearchBook.Text = isbn;
            List <Book> books = DBConnection.findBook(txtSearchBook.Text);

            foreach (var item in books)
            {
                listDisplay.Items.Add(item.GetDisplayText(" - "));
            }
            books = null;
        }
 private void btnFindBook_Click(object sender, EventArgs e)
 {
     if (!txtISBN.Text.Equals(""))
     {
         List <Book> books = DBConnection.findBook(txtISBN.Text);
         foreach (var b in books)
         {
             listDisplayBooks.Items.Add(b.GetDisplayText(" - "));
         }
     }
     else
     {
         MessageBox.Show("Please provide the book ISBN in the text field");
     }
 }
        private void btnBooking_Click(object sender, EventArgs e)
        {
            int         BookID = 0;
            int         qty    = 0;
            List <Book> books  = DBConnection.findBook(txtISBN.Text);

            foreach (var item in books)
            {
                BookID = item.BookID;
                qty    = item.Qty;
            }
            if (qty >= Convert.ToInt32(numQty.Value))
            {
                DBConnection.bookingBook(customer.CustomerID, BookID, Convert.ToInt32(numQty.Value), dateOfOreder.Value);
                DBConnection.updateBookQty(Convert.ToInt32(numQty.Value), BookID);
                MessageBox.Show("Book is booked");
            }
            else
            {
                MessageBox.Show("The Book's quantity is not enough");
            }
        }