Esempio n. 1
0
        protected override void AddTempData(JinianNet.JNTemplate.TemplateContext context)
        {
            List <DC_House> HouseList  = new List <DC_House>();
            DC_HouseDAL     dal        = new DC_HouseDAL();
            DataSet         Houseds    = dal.GetDCHouseList(SiteCode, "0");
            string          housecount = Houseds.Tables[0].Rows.Count.ToString();

            foreach (DataRow row in Houseds.Tables[0].Rows)
            {
                DC_House model = DataConvert.DataRowToModel <DC_House>(row);
                HouseList.Add(model);
            }
            context.TempData["HouseCount"] = housecount;
            context.TempData["HouseList"]  = HouseList;
        }
Esempio n. 2
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="strWhere">条件</param>
        void LoadData(string strWhere)
        {
            txtTitle.Text = "";
            DC_HouseDAL dal = new DC_HouseDAL();
            DataSet     ds  = dal.GetDCHouseList(strWhere);
            DataView    dv  = ds.Tables[0].DefaultView;

            AspNetPager1.RecordCount = dv.Count;

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = dv;
            pds.AllowPaging      = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize         = AspNetPager1.PageSize;
            Repeater1.DataSource = pds;
            Repeater1.DataBind();
        }