Esempio n. 1
0
        protected void btnThem_Click(object sender, EventArgs e)
        {
            ls = LayDuLieuTuForm();
            cn = new chucnang();
            bool exist = cn.CheckMaLoaiSach(ls.MaLoai);

            if (exist)
            {
                lblThongBao.Text = "Tác Giả này đã có";
            }
            else
            {
                bool result = cn.InsertLoaiSach(ls);
                if (result)
                {
                    lblThongBao.Text = "Thêm thành công";
                    DoDuLieuVaoGridView();
                }
                else
                {
                    lblThongBao.Text = "Có lỗi";
                }
            }
        }