protected void btnXoa_Click(object sender, EventArgs e) { try { //lay thong tin tu textbox int mahoatdong = int.Parse(Request.QueryString["id"]); //Goi ham xoa BUSCauHoiKhaoSat BUSCauHoiKhaoSat = new BUSCauHoiKhaoSat(); if (BUSCauHoiKhaoSat.Xoa(mahoatdong) == 0) { //Thong bao lbThongBao.Text = "Xóa Thành Công"; lbThongBao.Visible = true; Response.Redirect("CauHoiKhaoSat.aspx"); } else { lbThongBao.Text = "Xóa Không Thành Công"; lbThongBao.Visible = true; } } catch { lbThongBao.Text = "Xoa Không Thành Công"; lbThongBao.Visible = true; } }
protected void XoaCauHoiKhaoSat(int maCauHoi) { try { //xac nhan truoc khi xoa //Goi ham xoa BUSCauHoiKhaoSat BUSCauHoiKhaoSat = new BUSCauHoiKhaoSat(); if (BUSCauHoiKhaoSat.Xoa(maCauHoi) == 0) { //Thong bao Response.Redirect("CauHoiKhaoSat.aspx"); } } catch { } }