private void btnCheckCondition_Click(object sender, EventArgs e) { if (txtCopyNumber.Text != "") { if (CopyDAO.CheckCondition(int.Parse(txtCopyNumber.Text)) == 0) { MessageBox.Show("This book is available."); btnBorrow.Enabled = true; } else if (CopyDAO.CheckCondition(int.Parse(txtCopyNumber.Text)) == 2) { if (ReservationDAO.GetFirstReservation(CopyDAO.GetCopy(int.Parse(txtCopyNumber.Text)).BookNumber).MemberNumber == int.Parse(txtMemberCode.Text)) { check = 1; MessageBox.Show("This copy is available."); btnBorrow.Enabled = true; } else { MessageBox.Show("This copy is not available."); } } else { display(2); MessageBox.Show("Copy Number is invalid or This book is not available."); } } else { MessageBox.Show("Copy Code can not be blank."); } }