Exemple #1
0
        protected void btnXoa_Click(object sender, EventArgs e)
        {
            if (Session["MaBL"] != null)
            {
                int          id  = int.Parse(Session["MaBL"].ToString());
                BUS_BinhLuan bus = new BUS_BinhLuan();
                bus.XoaBL(id);
                Session["MaBL"] = null;
                DataTable dt   = new DataTable();
                int       flag = int.Parse(ddlBinhLuan.SelectedValue);
                dt = bus.LoadBinhLuan(0, flag);
                gvBinhLuan.DataSource    = dt.DefaultView;
                gvBinhLuan.SelectedIndex = -1;
                gvBinhLuan.PageIndex     = int.Parse(Session["PageIndex"].ToString());
                gvBinhLuan.DataBind();
                lblThongBao.Text = "";

                txtHoten.Text   = "";
                txtTieuDe.Text  = "";
                txtNoiDung.Text = "";
                txtTenSP.Text   = "";
            }
            else
            {
                lblThongBao.Text = "Chưa chọn bình luận cần xóa !";
            }
        }
Exemple #2
0
        protected void btnCapNhat_Click(object sender, EventArgs e)
        {
            if (Session["MaBL"] != null)
            {
                int          id  = int.Parse(Session["MaBL"].ToString());
                BUS_BinhLuan bus = new BUS_BinhLuan();

                BinhLuan bl = new BinhLuan();
                bl.MABINHLUAN = id;
                bl.TIEUDE     = txtTieuDe.Text;
                bl.NOIDUNG    = txtNoiDung.Text;
                bl.TRANGTHAI  = bool.Parse(ddlTrangThai.SelectedValue);
                bus.CapNhatBinhLuan(bl);
                Session["MaBL"] = null;
                DataTable dt   = new DataTable();
                int       flag = int.Parse(ddlBinhLuan.SelectedValue);
                dt = bus.LoadBinhLuan(0, flag);
                gvBinhLuan.DataSource    = dt.DefaultView;
                gvBinhLuan.SelectedIndex = -1;
                gvBinhLuan.PageIndex     = int.Parse(Session["PageIndex"].ToString());
                gvBinhLuan.DataBind();
                lblThongBao.Text = "";
            }
            else
            {
                lblThongBao.Text = "Chưa chọn bình luận cần cập nhật !";
            }
        }
        public void LoadBinhLuan()
        {
            int          id  = (int)Session["MaSP"];
            BUS_BinhLuan bus = new BUS_BinhLuan();
            DataTable    dt  = bus.LoadBinhLuan(id, 0);

            dlBinhLuan.DataSource = dt;
            dlBinhLuan.DataBind();
        }
Exemple #4
0
        public void LoadBL()
        {
            BUS_BinhLuan busBL = new BUS_BinhLuan();
            DataTable    dt    = new DataTable();

            dt = busBL.LoadBinhLuan(0, 2);

            gvBinhLuan.DataSource = dt.DefaultView;
            gvBinhLuan.DataBind();
        }
Exemple #5
0
        protected void btnDuyet_Click(object sender, EventArgs e)
        {
            BUS_BinhLuan busBL = new BUS_BinhLuan();
            DataTable    dt    = new DataTable();
            int          flag  = int.Parse(ddlBinhLuan.SelectedValue);

            dt = busBL.LoadBinhLuan(0, flag);

            gvBinhLuan.DataSource = dt.DefaultView;
            gvBinhLuan.DataBind();
        }
Exemple #6
0
        protected void gvBinhLuan_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            BUS_BinhLuan busBL = new BUS_BinhLuan();
            DataTable    dt    = new DataTable();
            int          flag  = int.Parse(ddlBinhLuan.SelectedValue);

            dt = busBL.LoadBinhLuan(0, flag);
            Session["PageIndex"]  = e.NewPageIndex;
            gvBinhLuan.DataSource = dt.DefaultView;
            gvBinhLuan.PageIndex  = e.NewPageIndex;
            gvBinhLuan.DataBind();
        }