private void RptBind(string strWhere, string orderby) { if (!int.TryParse(Request.Params["page"] as string, out this.page)) { this.page = 0; } Spread.BLL.Pgame bll = new Spread.BLL.Pgame(); //获得总条数 this.pcount = bll.GetRecordCount(strWhere); if (this.pcount > 0) { this.lbtnDel.Enabled = true; } else { this.lbtnDel.Enabled = false; } this.txtKeywords.Text = this.keywords; this.rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby); this.rptList.DataBind(); }
//绑定游戏 private void PgameBind(string game, string menu) { game = game.Replace(" ", "|").Replace("-", "|").Replace("-", "|"); string[] gameArr = game.Split('|'); string strWhere = ""; if (menu != "") { strWhere = " and Platform='" + menu + "' "; } Spread.BLL.Pgame cbll = new Spread.BLL.Pgame(); DataTable dt = cbll.GetList(" Name like '%" + gameArr[0].ToString().Trim() + "%'" + strWhere).Tables[0]; ddlGame.DataSource = dt; ddlGame.DataTextField = "Name"; ddlGame.DataValueField = "Name"; ddlGame.DataBind(); ListItem item = new ListItem("请选择所属游戏...", "0"); ddlGame.Items.Insert(0, item); }