protected void XoaChuyenMuc(int maChuyenMuc)
        {
            try
            {

                //xac nhan truoc khi xoa

                BUSBaiViet busBaiViet = new BUSBaiViet();
                List<BAIVIET> lstBaiViet = busBaiViet.LayDSBaiVietTheoChuyenMuc(maChuyenMuc);
                if (lstBaiViet != null)
                {
                    foreach (BAIVIET bv in lstBaiViet)
                    {
                        BUSTapTinBaiViet busTapTin = new BUSTapTinBaiViet();
                        List<TAPTINBAIVIET> lstTapTin = busTapTin.TimKiemMaBaiViet(bv.MaBaiViet);
                        if (lstTapTin != null)
                        {
                            foreach (TAPTINBAIVIET taptin in lstTapTin)
                            {
                                busTapTin.Xoa(taptin.MaTapTin);
                            }
                        }

                        busBaiViet.Xoa(bv.MaBaiViet);
                    }
                }

                    BUSChuyenMuc busChuyenMuc = new BUSChuyenMuc();
                    if (busChuyenMuc.Xoa(maChuyenMuc) == 0)
                    {
                        //Thong bao

                        Response.Redirect("ChuyenMuc.aspx");
                    }

            }

            catch
            {
            }
        }
        protected void btnXoa_Click(object sender, EventArgs e)
        {
            try
            {
                //lay thong tin tu textbox
                int machuyenmuc = int.Parse(Request.QueryString["id"]);
                BUSBaiViet busBaiViet = new BUSBaiViet();
                List<BAIVIET> lstBaiViet = busBaiViet.LayDSBaiVietTheoChuyenMuc(machuyenmuc);
                if (lstBaiViet != null)
                {
                    foreach (BAIVIET bv in lstBaiViet)
                    {
                        BUSTapTinBaiViet busTapTin = new BUSTapTinBaiViet();
                        List<TAPTINBAIVIET> lstTapTin = busTapTin.TimKiemMaBaiViet(bv.MaBaiViet);
                        if (lstTapTin != null)
                        {
                            foreach (TAPTINBAIVIET taptin in lstTapTin)
                            {
                                busTapTin.Xoa(taptin.MaTapTin);
                            }
                        }

                        busBaiViet.Xoa(bv.MaBaiViet);
                    }
                }

                //xac nhan truoc khi xoa

                    //Goi ham xoa
                    BUSChuyenMuc BUSChuyenMuc = new BUSChuyenMuc();
                    if (BUSChuyenMuc.Xoa(machuyenmuc) == 0)
                    {
                        //Thong bao
                        lbThongBao.Text = "Xóa Thành Công";
                        lbThongBao.Visible = true;
                        Response.Redirect("HoatDong.aspx");
                    }

            }

            catch
            {
                lbThongBao.Text = "Xoa Không Thành Công";
                lbThongBao.Visible = true;
            }
        }