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

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