protected void btnThem_Click(object sender, EventArgs e) { tg = LayDuLieuTuForm(); cn = new chucnang(); bool exist = cn.CheckMaTacGia(tg.MaTacGia); if (exist) { lblThongBao.Text = "Tác Giả này đã có"; } else { bool result = cn.InsertTacGia(tg); if (result) { lblThongBao.Text = "Thêm thành công"; DoDuLieuVaoGridView(); } else { lblThongBao.Text = "Có lỗi"; } } }