Exemplo n.º 1
0
        private void KT_DocGia_Click(object sender, EventArgs e)
        {
            var docGia_BUS = new DocGia_BUS();

            if (txtMaDocGia.Text == "")
            {
                MessageBox.Show("Nhập mã độc giả!!!");
                txtMaDocGia.Focus();
            }
            else if (!DocGia_BUS.KiemTraDocGia(int.Parse(txtMaDocGia.Text)))
            {
                MessageBox.Show("Đây không phải là độc giả");
                btnChiTietSach.Enabled = false;
            }
            else if (!DocGia_BUS.KiemTraDuocMuon(txtMaDocGia.Text.ToInt32()))
            {
                btnChiTietSach.Enabled = false;
                MessageBox.Show("Không được mượn sách nha", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtMaDocGia.Text = "";
                txtMaDocGia.Focus();
            }
            else
            {
                btnChiTietSach.Enabled = true;

                MessageBox.Show("Hợp Lệ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }