private void LoadDuLieuPhim() { string s = Request.QueryString["TheLoai"].Trim(); List <Phim> dsp = phimbll.HienThiTatCaPhim(); if (!string.IsNullOrEmpty(s) && !s.Equals("Thể Loại")) { List <Phim> layp = new List <Phim>(); datalstPhim.Controls.Clear(); foreach (Phim item in dsp) { if (item.TheLoai.Contains(s)) { layp.Add(item); } } if (layp.Count > 0) { datalstPhim.DataSource = layp; datalstPhim.DataBind(); } } else { datalstPhim.Controls.Clear(); if (dsp.Count > 0) { datalstPhim.DataSource = dsp; datalstPhim.DataBind(); } } }
private void LoadDuLieuPhim() { string s = Request.QueryString["QuocGia"].Trim(); if (!string.IsNullOrEmpty(s) && !s.Equals("Quốc Gia")) { List <Phim> dsp = phimbll.HienThiTheoQuocGia(s); datalstPhim.Controls.Clear(); if (dsp.Count > 0) { datalstPhim.DataSource = dsp; datalstPhim.DataBind(); } } else { List <Phim> dsp = phimbll.HienThiTatCaPhim(); datalstPhim.Controls.Clear(); if (dsp.Count > 0) { datalstPhim.DataSource = dsp; datalstPhim.DataBind(); } } }
private void LoadDuLieuPhim() { if (!string.IsNullOrEmpty(Request.QueryString["TrangThai"])) { List <Phim> dsp = new List <Phim>(); List <Phim> layp = phimbll.HienThiTatCaPhim(); foreach (Phim item in layp) { if (item.TrangThai.Equals("1/1") || item.TrangThai.Equals("?/1")) { dsp.Add(item); } } datalstPhim.Controls.Clear(); if (dsp.Count > 0) { datalstPhim.DataSource = dsp; datalstPhim.DataBind(); } } }
private void LoadDuLieuPhim() { List <Phim> dsp = phimbll.HienThiTatCaPhim(); datalstPhim.Controls.Clear(); if (dsp.Count > 0) { p.DataSource = dsp; p.PageSize = 12; p.CurrentPageIndex = tranghientai; p.AllowPaging = true; DatLaiGiaTriTrang(); if (p.IsFirstPage == true && p.IsLastPage == false) { btnFirst.Enabled = false; btnPrevious.Enabled = false; btnNext.Enabled = true; btnLast.Enabled = true; } if (p.IsLastPage == true && p.IsFirstPage == false) { btnFirst.Enabled = true; btnPrevious.Enabled = true; btnNext.Enabled = false; btnLast.Enabled = false; } if (p.IsLastPage == true && p.IsFirstPage == true) { btnFirst.Enabled = false; btnPrevious.Enabled = false; btnNext.Enabled = false; btnLast.Enabled = false; } lblTrangThai.Text = (tranghientai + 1) + ""; datalstPhim.DataSource = p; datalstPhim.DataBind(); } }
private void frmMain_Load(object sender, EventArgs e) { grvPhim.DataSource = obj.HienThiTatCaPhim(); }