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