コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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
            {
            }
        }