Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
            width = Request.QueryString["w"];

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }

            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = MusicController.GetAlbumHasCache(Session["telco"].ToString(), curpage, pagesize, out totalrecord);

            DataSet ds = ConvertUtility.SplitDataTable(dtCat, 3);

            rptAlbum1.DataSource = ds.Tables[0];
            rptAlbum1.DataBind();

            rptAlbum11.DataSource = ds.Tables[0];
            rptAlbum11.DataBind();

            rptAlbum2.DataSource = ds.Tables[1];
            rptAlbum2.DataBind();

            rptAlbum22.DataSource = ds.Tables[1];
            rptAlbum22.DataBind();

            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
            width = Request.QueryString["w"];
            if (!Page.IsPostBack)
            {
                int       totalrecord = 0;
                DataTable dtCat       = Library.Component.Video.VideoController.GetAllVideoByCategoryAndDisplayType(Session["telco"].ToString(), 6, 0, (int)Constant.Video.Category, 10, 1, out totalrecord);
                Random    rnd         = new Random();
                while (dtCat.Rows.Count > 3)
                {
                    dtCat.Rows.RemoveAt(rnd.Next(0, dtCat.Rows.Count));
                    dtCat.AcceptChanges();
                }

                rptClipNhac.DataSource     = dtCat;
                rptClipNhac.ItemDataBound += rptClipNhac_ItemDataBound;
                rptClipNhac.DataBind();

                rptMusicMoiNhat.DataSource = MusicController.GetItemTopHasCache(Session["telco"].ToString(), 5);
                rptMusicMoiNhat.DataBind();

                rptMusicHotThang.DataSource = MusicController.GetItemTopByAlbumHasCache(3, Session["telco"].ToString(), 5);
                rptMusicHotThang.DataBind();

                rptTopCaSy.DataSource = MusicController.GetArtistTopHasCache(5);
                rptTopCaSy.DataBind();

                rptTheLoai.DataSource = MusicController.GetStyleTopHasCache(5);
                rptTheLoai.DataBind();

                DataTable dtAlbum = MusicController.GetAlbumHotHasCache(Session["telco"].ToString());

                DataSet   dsFirst  = ConvertUtility.SplitDataTable(dtAlbum, 3);
                DataTable dt1      = dsFirst.Tables[0];
                DataSet   dsSecond = ConvertUtility.SplitDataTable(dsFirst.Tables[1], 3);
                DataTable dt2      = dsSecond.Tables[0];

                rptAlbum1.DataSource = dt1;
                rptAlbum1.DataBind();

                rptAlbum11.DataSource = dt1;
                rptAlbum11.DataBind();

                rptAlbum2.DataSource = dt2;
                rptAlbum2.DataBind();

                rptAlbum22.DataSource = dt2;
                rptAlbum22.DataBind();
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width = Request.QueryString["w"];
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);

            if (!IsPostBack)
            {
                //lastest News
                DataTable dtlatest = TintucController.GetTopNewsHasCache(ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("news_zoneid")), 3);
                DataSet   ds       = ConvertUtility.SplitDataTable(dtlatest, 1);

                rptTopNews.DataSource = ds.Tables[0];
                rptTopNews.DataBind();

                rptNews.DataSource = ds.Tables[1];
                rptNews.DataBind();
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width = Request.QueryString["w"];
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["tpage"]))
            {
                tpage = ConvertUtility.ToInt32(Request.QueryString["tpage"]);
            }
            int totalrecord = 0;

            if (lang == 0)
            {
                litGia.Text          = "(Gia: " + AppEnv.GetSetting("wallprice") + " d/hinh nen)";
                litTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat_KD;
                litMoiCapNhat.Text   = Resources.Resource.wMoiCapNhat_KD;
            }
            else
            {
                litGia.Text          = "(Giá: " + AppEnv.GetSetting("wallprice") + " đ/hình nền)";
                litTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat;
                litMoiCapNhat.Text   = Resources.Resource.wMoiCapNhat;
            }

            //Tải nhiều nhất
            DataTable dtHottest = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 4, (int)Constant.HinhNen.Topdownload, pagesize, curpage, out totalrecord);

            if (dtHottest.Rows.Count > 3)
            {
                DataSet ds = ConvertUtility.SplitDataTable(dtHottest, 3);

                rptTaiNhieuNhat1.DataSource = ds.Tables[0];
                rptTaiNhieuNhat1.DataBind();

                rptTaiNhieuNhat11.DataSource = ds.Tables[0];
                rptTaiNhieuNhat11.DataBind();

                rptTaiNhieuNhat2.DataSource = ds.Tables[1];
                rptTaiNhieuNhat2.DataBind();

                rptTaiNhieuNhat22.DataSource = ds.Tables[1];
                rptTaiNhieuNhat22.DataBind();
            }
            else
            {
                rptTaiNhieuNhat1.DataSource = dtHottest;
                rptTaiNhieuNhat1.DataBind();

                rptTaiNhieuNhat11.DataSource = dtHottest;
                rptTaiNhieuNhat11.DataBind();
            }

            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"] + "&cpage=";

            //Mới nhất
            DataTable dtLatest = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 2, (int)Constant.HinhNen.Lastest, pagesize, tpage, out totalrecord);

            if (dtLatest.Rows.Count > 3)
            {
                DataSet ds = ConvertUtility.SplitDataTable(dtLatest, 3);

                rptMoiCapNhat1.DataSource = ds.Tables[0];
                rptMoiCapNhat1.DataBind();

                rptMoiCapNhat11.DataSource = ds.Tables[0];
                rptMoiCapNhat11.DataBind();

                rptMoiCapNhat2.DataSource = ds.Tables[1];
                rptMoiCapNhat2.DataBind();

                rptMoiCapNhat22.DataSource = ds.Tables[1];
                rptMoiCapNhat22.DataBind();
            }
            else
            {
                rptMoiCapNhat1.DataSource = dtLatest;
                rptMoiCapNhat1.DataBind();

                rptMoiCapNhat11.DataSource = dtLatest;
                rptMoiCapNhat11.DataBind();
            }

            Paging2.totalrecord  = totalrecord;
            Paging2.pagesize     = pagesize;
            Paging2.numberpage   = pagenumber;
            Paging2.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"];
            Paging2.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"] + "&tpage=";
        }