protected void btnXoa_Click(object sender, EventArgs e) { try { Xoa_Sach(txtMa.Text); GridInfor.DataSource = Sach_DS(); GridInfor.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Xóa thành công!');", true); } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Xóa lỗi!');", true); } }
protected void btnThem_Click(object sender, EventArgs e) { try { String anh = upAnh.FileName; Them_Sach(txtMa.Text, txtTen.Text, anh, txtTacGia.Text, txtNXB.Text, dropLoai.SelectedValue); GridInfor.DataSource = Sach_DS(); GridInfor.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào thành công!');", true); } catch { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Nhập vào lỗi!');", true); } }
protected void Page_Load(object sender, EventArgs e) { GridInfor.DataSource = Sach_DS(); GridInfor.DataBind(); UpdateList(); }