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