Esempio n. 1
0
        private void BindData(int PageIndex)
        {
            int RecordCount = 0;

            DataTable newRents = bll.GetList(1, 5, "", " createtime desc", out RecordCount);
            DataTable rentings = bll.GetList(PageIndex, AspNetPager.PageSize, " and status=" + (int)RentProductStatus.申请中, " createtime desc", out RecordCount);

            foreach (DataRow row in newRents.Rows)
            {
                row["smallimage"] = MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString()); row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString());
            }
            foreach (DataRow row in rentings.Rows)
            {
                row["smallimage"] = MagicWorldImageRule.GetMainImageUrl(row["smallimage"].ToString()); row["mediumimage"] = MagicWorldImageRule.GetMainImageUrl(row["mediumimage"].ToString());
            }

            Repeater_NewRents.DataSource = newRents;
            Repeater_NewRents.DataBind();

            Repeater_Rentings.DataSource = rentings;
            Repeater_Rentings.DataBind();

            AspNetPager.RecordCount = RecordCount;
        }
Esempio n. 2
0
        private void BindData(int PageIndex)
        {
            int    RecordCount     = 0;
            string ForeFlatRootUrl = System.Configuration.ConfigurationManager.AppSettings["foreFlatRootUrl"];

            ForeFlatRootUrl = ForeFlatRootUrl.EndsWith("/") ? ForeFlatRootUrl : ForeFlatRootUrl + "/";

            DataTable dt = bll.GetList(PageIndex, AspNetPager.PageSize, "", "", out RecordCount);

            dt.Columns.Add("foreurl");
            foreach (DataRow row in dt.Rows)
            {
                row["foreurl"] = String.Format("{0}magic/rent.aspx?pid={1}", ForeFlatRootUrl, row["rentid"]);
            }

            GridView1.DataSource = dt;
            GridView1.DataBind();

            AspNetPager.RecordCount = RecordCount;
        }