private void btnCheckMember_Click(object sender, EventArgs e) { try { memcode = int.Parse(txtMemberCode.Text); BorrowBL b = new BorrowBL(); if (b.checkMember(memcode)) { txtName.Text = b.showMemberName(memcode); } else { MessageBox.Show("doesn't match with any menber ! Please try again."); return; } } catch (Exception ex) { if (ex is FormatException || ex is OverflowException || ex is ArgumentNullException) { MessageBox.Show("Wrong input"); return; } else MessageBox.Show("somethings wrong in checkmember funtion"); } txtMemberCode.Enabled = false; txtBookNumber.Enabled = true; btnCheckReservation.Enabled = true; DataSet ds = ReserveBL.selectTableReservation(memcode); DataView dv = new DataView(ds.Tables[0]); dataGridView1.DataSource = dv; label6.Text = "" + ds.Tables[0].Rows.Count; }
private void btnCheckReservation_Click(object sender, EventArgs e) { try { BorrowBL b = new BorrowBL(); bookcode = int.Parse(txtBookNumber.Text); if (ReserveBL.checkReservation(bookcode, memcode) && b.checkMember(memcode)) { txtName.Text = b.showMemberName(bookcode); textBox4.Enabled = true; button3.Enabled = true; } } catch (Exception ex) { if (ex is FormatException || ex is OverflowException || ex is ArgumentNullException) { MessageBox.Show("Wrong book number!"); return; } else MessageBox.Show("somethings wrong in checkReservation funtion"); } }