Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (ldb.CountBorrow(textID.Text) > LibraryDB.MaxBorrow)
            {
                MessageBox.Show("You can only borrow 3 books! ");
            }

            else if (ldb.BookStock(textbno.Text) == 0)
            {
                string erd = ldb.EarliestReturn(textbno.Text);
                MessageBox.Show("Out of stock, the earliest return date is " + erd);
            }

            else if (ldb.Borrowed(textID.Text, textbno.Text))
            {
                MessageBox.Show("You can only borrow the same book once! ");
            }


            else
            {
                ldb.Borrow(textID.Text, textbno.Text);
                refreshlistview();
                MessageBox.Show("Borrow succeed! ");
            }
        }