protected void btnChkCondition_Click(object sender, EventArgs e) { if (txtBookNumber.Text == null || txtBookNumber.Text.Equals("")) { lblError.Text = "Book Number is not allow to be null"; txtBookNumber.Focus(); } else if (DAO.checkInt(txtBookNumber.Text) == false) { lblError.Text = "Book Number is numberic"; txtBookNumber.Focus(); } else { DataView dv = new DataView(BookDAO.GetDataTableBook()); dv.RowFilter = "bookNumber = " + txtBookNumber.Text; if (dv.Count != 0) //book exist { int availableCopy = CopyDAO.getAvailableCopy(int.Parse(txtBookNumber.Text)); //số lượng bản copy A if (availableCopy > 0) { lblError.Text = "This book having " + availableCopy + " copies available, you can borrow them"; } else { lblError.Text = ""; btnReserve.Enabled = true; } } else { lblError.Text = "Oops! this book number is not exist!"; } } }